Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Disk formatting
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Modern disks: reinitialization === Modern hard drives can no longer perform post-production LLF, i.e. to re-establish the basic layout of "tracks" and "blocks" on the recording surface. ''Reinitialization'' refers to processes that return a disk to a factory-like configuration: no data, no partitioning, all blocks available to use. ==== Command-set support ==== SCSI provides a {{tt|Format Unit}} command. This command performs the needed certification step to weed out [[bad sector]]s and has the ability to change sector size. The command-line sg_format program may be used to issue the command.<ref>{{man|8|sg_format|Linux}}</ref> A variety of sector sizes may be chosen, but are not available on all devices: 512, 520, 524, 528, 4096, 4112, 4160, and 4224-byte sectors.<ref>[http://www.seagate.com/docs/pdf/whitepaper/tp595_building_faster_more_flexible_infrastructure.pdf Seagate SAS drives] {{webarchive |url=https://web.archive.org/web/20101129180307/http://www.seagate.com/docs/pdf/whitepaper/tp595_building_faster_more_flexible_infrastructure.pdf |date=2010-11-29}}</ref> Although the SCSI command provides many options, even resizing, it does not touch on the track layer where low-level format happens.<ref>{{cite web |title=INCITS 506-202x - Information technology - SCSI Block Commands - 4 (SBC-4) draft revision 22 |url=https://standards.incits.org/apps/group_public/download.php/124286/livelink |access-date=22 May 2023 |date=15 September 2020}}</ref> ATA does not expose a low-level format functionality, but they allow the sector size to be changed via {{tt|SET SECTOR CONFIGURATION}} ({{tt|--set-sector-size}} in <code>[[hdparm]]</code>). (Consumer drives usually only support 512 and [[Advanced Format|4096-byte sector]]s.) Although sector-size change may scramble data, it is not a safe way of erasing data, nor is any certification done. ATA offers a separate {{tt|SECURITY ERASE}} ({{tt|--security-erase}} in <code>[[hdparm]]</code>) command for erasure.<ref>{{man|8|hdparm|Linux}}</ref> [[NVMe]] drives have a standard method of formatting, available in, for example, the Linux command-line program {{tt|nvme format}}. Sector size change and secure erase options are available.<ref>{{man|1|nvme-format|Linux}}</ref> Note that NVMe drives are generally solid-state, making this "track" distinction useless. [[Seagate Technology]] drives offer a [[TTL serial]] debugging console.<ref>{{cite web |title=Seagate Serial Talk {{!}} OS/2 Museum |url=https://www.os2museum.com/wp/seagate-serial-talk/}}</ref> Among other things, the console can format the "system" and "user" partitions while performing defect checks (re-initialization over pre-established logical blocks) and modify track parameters (managing the ''real'' low-level format).<ref>{{cite web |title=F3 Serial Port Diagnostics |url=https://dokumen.tips/documents/f3-serialport-diagnostics.html?page=1}} older version available from </ref> ==== Disk-filling ==== When the hard drive's built-in reinitialization function (see above) is unavailable due to driver or system limitations, it is possible to fill the entire disk instead. On older hard drives without [[bad sector]] management,<ref>{{cite web |title=BadBlockHowto β smartmontools |url=https://www.smartmontools.org/wiki/BadBlockHowto |website=www.smartmontools.org}}</ref> a program will also need to check for any damaged sectors and try to spare them out. On newer drives with defect management, reallocated sectors may be left unerased, whereas the built-in re-initialization function will erase them.<ref name="Secure Deletion" /> In modern times, it is most common to fill hard drives with value of <code>0x00</code>. One popular method for performing this zero-fill operation on a hard disk is by writing zero-value bytes to the drive using the Unix [[dd (Unix)|dd]] utility with the [[/dev/zero]] stream as the input file and the drive itself (or a specific partition) as the output file.<ref>{{cite web|url=http://www.myfixlog.com/fix.php?fid=58|title=How to Securely Erase (Wipe) a Hard Drive for Free with DD|website=myfixlog.com|archive-url=https://web.archive.org/web/20160418143615/http://www.myfixlog.com/fix.php?fid=58|archive-date=April 18, 2016}}</ref> This command may take many hours to complete, and will erase all files and file systems. A value of <code>0xFF</code> is used on flash disks to reduce [[Program-erase cycle|wear]] . The latter value is typically also the default value used on ROM disks (which cannot be reformatted). Some advanced tools allow configuring the fill value.<ref group="lower-alpha" name="NB_Format_Wipe"/> Zero-filling a drive is not a secure method of preparing a drive for use with an encrypted filesystem. Doing so voids the [[deniable encryption|plausible deniability of the process]], as the encrypted areas (indistinguishable from random without a key, unless the cipher is compromised) will stand out among zero blocks. The correct technique is to zero-fill inside a temporary encrypted layer then discard the key and layer setup. ([[/dev/urandom]] provides similar safety, but tends to be slow.)<ref>[http://www.globallinuxsecurity.pro/quickly-fill-a-disk-with-random-bits-without-dev-urandom/ Quickly fill a disk with random bits]</ref> ==== Confusion ==== {{More citations needed section|date=July 2009}} The present ambiguity in the term ''low-level format'' seems to be due to both inconsistent documentation on web sites and the belief by many users that any process below a high-level (file system) format must be called a ''low-level'' format. Since much of the low-level formatting process can today only be performed at the factory, various drive manufacturers describe reinitialization software as LLF utilities on their web sites. Since users generally have no way to determine the difference between a complete LLF and ''reinitialization'' (they simply observe running the software results in a hard disk that must be high-level formatted), both the misinformed user and mixed signals from various drive manufacturers have perpetuated this error. Note: whatever possible misuse of such terms may exist, many sites do make such ''reinitialization'' utilities available (possibly as bootable floppy diskette or CD image files), to both overwrite every byte ''and'' check for damaged sectors on the hard disk.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)