Low level format of hard drive
Solution 1:
Edit: This answer is about ATA Secure Erase. llformat
is just a (misleading) password.
None of these answers is correct. A Low Level Format (LLF) is an instruction sent to the disk. To find out how to do this on Linux, read this hdparm
tutorial on unix.stackexchange.com,
- How do I perform a low level format of a Sandforce solid state disk?
This is a copy of the answer, current as of July 16, 2014 as provided by no.human.being et al,
Under unixoid systems you can do it with "hdparm". You need to get "root" first, then do the following. This is assuming that the drive you want to low-level format is "/dev/sda" and that you have "hdparm" installed.
hdparm -I /dev/sda
The parameter is a capital "i", not a lowercase "l", just in case the font is ambiguous. If the drive shows "frozen" you must first "un-freeze" it. What you need to do to "un-freeze" it depends on the device. Most devices will "un-freeze" if you put the system to "suspend to RAM" mode, then wake it up again. If the device shows "not frozen", you can proceed.
hdparm --user-master u --security-set-pass llformat /dev/sda
Then show the device info again with the capital "i" as parameter.
hdparm -I /dev/sda
It should now display "enabled" under "Security:". This is quite a critical step. The device is now secured. If you power it down, it will lock and might become inaccessible. When you perform the low-level format NOW, security will be disabled again and you can continue using the device.
hdparm --user-master u --security-erase llformat /dev/sda
The device should now be physically wiped.
hdparm -I /dev/sda
Once more with the capital "i". Confirm that security has returned to "not enabled". You can now partition and format the device.
Solution 2:
Please note that Low-Level formatting a hard drive refers to something completely different and should never be done by an end user. Also note that the notion of formatting a drive comes from the old DOS days. In Unix/Linux creating file systems and partition tables is more common and precise.
Rewriting the MBR doesn't require any formatting. If you just want to wipe the MBR (making that drive unbootable, and all data on all partitions on that disk unrecoverable), you can run this command:
dd if=/dev/zero of=/dev/XXXXXX bs=512 count=1
replace xxxxxx with the actual device name of the device you want to lose all data on.
Supplemental: There is also the possibility of keeping the partition table and just erasing the boot loader code in the MBR, but you should make a backup first and then try zeroing the boot loader code:
dd if=/dev/XXXXXX of=mbr-backup.img bs=512 count=1
dd if=/dev/zero of=/dev/XXXXXX bs=446 count=1
Note that some boot loaders utilize the space between the MBR and the first partition to safe additional data. This is likely not to cause issues in this case, but if you want to do a complete boot loader backup, you should be aware of this.
Solution 3:
Step 1:
Boot from a live USB
Step 2:
Using fdisk -l
, find out which drive you want to wipe. I shall assume that you want to wipe /dev/sda
Now, run
dd if=/dev/zero of=/dev/sda
That will wipe the hard drive.
If you want to wipe just the MBR (which has a blocksize of around 446), use
dd if=/dev/zero of=/dev/sda bs=446 count=1
To remove the partition table as well, use
dd if=/dev/zero of=/dev/sda bs=512 count=1
Source for sizes of MBR/MBR+partition table
Solution 4:
In Disks (find this application, it's installed by default), formerly known as Disk Utility, you can perform the same format as I explained using GParted.