Get Hard disk serial Number

Hm, looking at your first set of code, I think you have retrieved (maybe?) the hard drive model. The serial # comes from Win32_PhysicalMedia. Get Hard Drive model ManagementObjectSearcher searcher = new ManagementObjectSearcher(“SELECT * FROM Win32_DiskDrive”); foreach(ManagementObject wmi_HD in searcher.Get()) { HardDrive hd = new HardDrive(); hd.Model = wmi_HD[“Model”].ToString(); hd.Type = wmi_HD[“InterfaceType”].ToString(); hdCollection.Add(hd); } Get … Read more

How to get hard disk serial number using Python

Linux As you suggested, fcntl is the way to do this on Linux. The C code you want to translate looks like this: static struct hd_driveid hd; int fd; if ((fd = open(“/dev/hda”, O_RDONLY | O_NONBLOCK)) < 0) { printf(“ERROR opening /dev/hda\n”); exit(1); } if (!ioctl(fd, HDIO_GET_IDENTITY, &hd)) { printf(“%.20s\n”, hd.serial_no); } else if (errno … Read more

Python causing: IOError: [Errno 28] No space left on device: ‘../results/32766.html’ on disk with lots of space

The ENOSPC (“No space left on device”) error will be triggered in any situation in which the data or the metadata associated with an I/O operation can’t be written down anywhere because of lack of space. This doesn’t always mean disk space – it could mean physical disk space, logical space (e.g. maximum file length), … Read more

How to view unallocated free space on a hard disk through terminal [closed]

Use GNU parted and print free command: root@sandbox:~# parted GNU Parted 2.3 Using /dev/sda Welcome to GNU Parted! Type ‘help’ to view a list of commands. (parted) print free Model: VMware Virtual disk (scsi) Disk /dev/sda: 64.4GB Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type File system Flags 32.3kB 1049kB 1016kB … Read more

Get hard disk size in Python

For Python 2 till Python 3.3 Notice: As a few people mentioned in the comment section, this solution will work for Python 3.3 and above. For Python 2.7 it is best to use the psutil library, which has a disk_usage function, containing information about total, used and free disk space: import psutil hdd = psutil.disk_usage(“https://stackoverflow.com/”) … Read more

How can I easily add storage to a VirtualBox machine with XP installed?

I found this nugget at the link following. It worked perfect for me and only took 5 seconds. As of VirtualBox 4 they added support for expansion. VBoxManage modifyhd filename.vdi –resize 46080 That will resize a virtual disk image to 45GB. https://superuser.com/questions/172651/increasing-disk-space-on-virtualbox

How can I determine the sector size in windows?

You want fsutil. Make sure you run Command Prompt as Admin. C:\Windows\system32>fsutil fsinfo ntfsinfo c: NTFS Volume Serial Number : 0xf4ca5d7cca5d3c54 Version : 3.1 Number Sectors : 0x00000000378fd7ff Total Clusters : 0x0000000006f1faff Free Clusters : 0x00000000000e8821 Total Reserved : 0x0000000000000910 Bytes Per Sector : 512 Bytes Per Physical Sector : 512 Bytes Per Cluster : … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)