Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

When I need to properly wipe a harddrive, I tend to use shred on the whole devic

ID: 658307 • Letter: W

Question

When I need to properly wipe a harddrive, I tend to use shred on the whole device, i.e. pointing shred to the /dev/sdX without regard to particular partitions; however I noticed that the device size listed by shred command in the progress lines is always approx. 7 % smaller than the device size listed by fdisk (on a 500 GB disk, shred would be showing 466 GB). Thus I wanted to ask, if shred really wipes the whole drive properly using the method above, or if there still might be some areas of the disk, that remain untouched (or perhaps if it just incorrectly shows the size, calculates it differently...)

Explanation / Answer

You are seeing a consequence of the ongoing war between binary and decimal systems.

Namely, 2^10 = 1024, which is close to 1000. Hence a widespread habit of saying "kilobyte" (as in "1000 byte") for a quantity of 1024 bytes. When we go to megabytes and gigabytes, the deviation increases: 2^20 = 1048576, and 2^30 = 1073741824. Therefore, if tool A displays a size in "decimal gigabytes", it will show a number that is 7.37% higher than tool B that sticks to the traditional "binary gigabytes". This is what you observe here: fdisk uses "true gigabytes" (1000000000 bytes each) while shred reports the same size with "binary gigabytes" (1073741824 bytes each).

Some people have tried to solve the ambiguity by talking of kibibytes (and mebibytes, gibibytes...) for quantities related to the "1024" scale. This would solve the issue if the names were not so ridiculous.

In older times, the "binary" versions were prevalent, but in the late 1990s, hard disk vendors figured out that they could put stickers with bigger numbers on their disks if they switched to the "correct" (decimal) units (the kilo/mega/giga prefixes are part of an international standard that extends way beyond computer matters). RAM vendors resisted, and still use the binary scale (so when you have a "1 GB RAM chip" you actually get 1073741824 bytes of RAM). On the other hand, the telecom industry has used decimal for decades (100 Mbit/s ethernet works at 100 MHz, not 104.9 MHz).

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote