When all bits in a computer hard-disk become zero, we say that the disk was wiped out and is now clean of any data. consider the hypothetical case in which all bits are now one. What will the computer detect this disk to be?(apart from full of course)


Nothing happens. All ones form no partition table and no filesystem(s), just like all zeros. Unless you use the disk in a (custom?) way where all ones do mean something. Similarly all zeros may mean something.

E.g. If you clone a disk to another disk of the same size, the latter disk cannot be "clean of any data". It will contain the state of the original disk. Even if the original was wiped just before cloning, the new one is not interpreted as "clean". It's about context.

You can wipe a disk with all ones, this is discussed here: Zero filling (vs one-filling) drives: convention or practical reason?


Exactly the same thing as if it were a brand new disk and had all bits set to zero. Or if it has any other useless pattern. In either case, the disk will most likely show up as empty and unformatted/uninitialized.

Whether a disk is "full" or "empty" isn't really based on the amount of '1' bits it stores. The usage stats, and the free/used areas, are explicitly tracked by the "file system": it knows which disk areas are being used to store files, and which aren't. (A large file consisting entirely of 0x00 bytes is still "used" space, while deleting, say, a large movie file will mark all its space as "free" even though it still has those various bits and bytes written.)

First the OS tries to detect the partition table type. There are several, with MBR (MS-DOS partition table) and GPT (EFI partition table) being the most common. Both of these formats have certain fixed bytes in fixed locations – e.g. MBR has bytes 0xAA55 at offset 510. If those exact bytes aren't there (because you filled the disk with 0xFF, or 0x00, or something else) – the OS gives up and decides that the disk's format is not recognized, and the disk is considered to be empty. (Windows lets you "initialize" the disk through DiskMgmt.)

Then, if you have a partition table and some partitions listed in it, the OS will try to detect what filesystem it contains. (Also, depending on OS, this might be done even if there is no partition table – the OS will just look for a filesystem on the whole disk. Usually fixed disks must have a partition table, while removable disks can have just a raw filesystem.) Again, this starts by looking for specific indicator bytes at specific locations, and if those bytes don't match, then it's not going to be that filesystem. Eventually the OS gives up because it didn't recognize any FS at all, and considers the partition (or disk) empty. It'll ask whether you want to format the disk.

  • That's cool!! I didn't know of these security measures put in place. Also, consider that I made such corrections so that now the drive can be recognised by the OS.. like 0xAA55 at 510 and so on but kept the other bits one. What would show up in file explorer? – d4rk4ng31 Feb 21 '19 at 5:20
  • 2
    Those aren't security measures. They're mostly ... optimizations, to make detecting known filesystems faster, and to avoid accidentally misdetecting garbage data as if it were a filesystem. If you manually place those marker bytes, well, it varies between OS – it might actually go and interpret all those 0xFFFFF... bytes as if they were real MBR data, so you end up with a partition of type 0xFF that starts at 0xFFFFFFFF and ends at 0xFFFFFFFF... which the OS will usually reject as nonsensical simply because it's far beyond the end of the disk. But again, results may vary. – user1686 Feb 21 '19 at 5:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.