GENERAL HARDWARE SUPPORT IS OFF-TOPIC. Questions about hardware should be asked on https://superuser.com. A hard drive is a physical storage device used to save state for operating systems and individual software programs. Questions should relate to reading and writing via programming.
Questions tagged [hard-drive]
649 questions
90
votes
15 answers
How to list physical disks?
How to list physical disks in Windows?
In order to obtain a list of "\\\\.\PhysicalDrive0" available.

CiNN
- 9,752
- 6
- 44
- 57
74
votes
1 answer
How do I specify a label/path with spaces in /etc/fstab?
I am having trouble trying to get theh permissions for some of my external drives set up.
I believe the probem is due to how I am dealing with spaces in the text such that the commands can be interpreted by the terminal.
I have found this, which…

chase
- 3,592
- 8
- 37
- 58
72
votes
9 answers
How can I determine the sector size in windows?
How can I determine the Physical Sector Size (e.g. if i have an Advanced Format drive with 4,096 byte sectors rather than the legacy 512 byte sectors) in Windows 7?
I know that by clicking on a file and get properties we can find out the NTFS…

Mojtaba Kamyabi
- 3,440
- 3
- 29
- 50
70
votes
15 answers
How can I easily add storage to a VirtualBox machine with XP installed?
When I installed Windows XP on a VirtualBox machine, I made the hard drive only 10 GB since and assumed it would expand in size (as do hard drives in VMWare as far as I can remember, isn't this true?).
In any case, I'm trying to install Visual…

Edward Tanguay
- 189,012
- 314
- 712
- 1,047
69
votes
6 answers
Get hard disk size in Python
I am trying to get the hard drive size and free space using Python (I am using Python 2.7 with macOS).
I am trying with os.statvfs('/'), especially with the following code.
Is it correct what I am doing? Which definition of the variable giga shall I…

Nisba
- 3,210
- 2
- 27
- 46
69
votes
13 answers
How to view unallocated free space on a hard disk through terminal
I want to view the unallocated free space on my hard disk through terminal.
I've burned my brains searching the internet for a possible solution, but all in vain.
I used all sorts of commands like df, du, fdisk, parted, etc.
It tells me about the…

AniketGM
- 901
- 1
- 9
- 17
59
votes
7 answers
Getting a list of logical drives
How can I get the list of logial drives (C#) on a system as well as their capacity and free space?

PaulB
- 23,264
- 14
- 56
- 75
56
votes
9 answers
Python causing: IOError: [Errno 28] No space left on device: '../results/32766.html' on disk with lots of space
I am running a Python script that is causing the above error. The unusual thing is this script is running on a different machine and is having no problems.
The difference is that on the machine that is causing the problems I am writing to an…

josh
- 1,544
- 2
- 16
- 27
36
votes
9 answers
Is there any way of detecting if a drive is a SSD?
I'm getting ready to release a tool that is only effective with regular hard drives, not SSD (solid state drive). In fact, it shouldn't be used with SSD's because it will result in a lot of read/writes with no real effectiveness.
Anyone knows of a…

smartins
- 3,808
- 7
- 42
- 54
35
votes
2 answers
Process permanently stuck on D state
I have an issue with some processes stuck in a D state on Ubuntu 10.04.3 LTS.
They have been in this state since Nov the 5th (today being December 6th). I understand these are uninterruptible sleep states often related to waiting for data from…

Dr Craig
- 371
- 1
- 3
- 6
34
votes
5 answers
How to get hard disk serial number using Python
How can I get the serial number of a hard disk drive using Python on Linux?
I would like to use a Python module to do that instead of running an external program such as hdparm. Perhaps using the fcntl module?

Forge
- 6,538
- 6
- 44
- 64
31
votes
10 answers
Get Hard disk serial Number
I want to get hard disk serial number. How I can I do that?
I tried with two code but I am not getting
StringCollection propNames = new StringCollection();
ManagementClass driveClass = new ManagementClass("Win32_DiskDrive");
PropertyDataCollection …

Joby
- 379
- 1
- 3
- 10
30
votes
3 answers
Direct access to hard disk with no FS from C program on Linux
I want to access the whole hard disk directly from a C program. There's no FS on it and never's gonna be one.
I just want to open /dev/sda (for example) and do I/O at the block/sector level of the disk.
I'm planning to write some programs for…

Angel C
- 301
- 1
- 3
- 4
23
votes
6 answers
Powershell: how to map a network drive with a different username/password
Background: Assume I use the following powershell script from my local machine to automatically map some network drives.
$net = $(New-Object -ComObject WScript.Network);
$net.MapNetworkDrive("p:", "\\papabox\files");
$net = $(New-Object -ComObject…

dreftymac
- 31,404
- 26
- 119
- 182
21
votes
5 answers
Spin Down Hard Disk Programmatically on Windows?
How do you request Windows to spin down a hard disk programmatically? Is there any user-mode function I can call (or kernel-mode function to call or IRP to send) in order to make this happen?
I've tried making a program to send an ATA STANDBY…

user541686
- 205,094
- 128
- 528
- 886