Jump to content
Read the Funtoo Newsletter: Summer 2023 ×

dracwyrm

Members
  • Posts

    0
  • Joined

  • Last visited

Community Answers

  1. dracwyrm's post in Software for make "low level format" for an HDD was marked as the answer   
    For some reason my old account is gone, well any ways, here's a solution for you. Sorry. Not around much.
     
    System Rescue CD has a program called hdparm. You can use the drives built in secure erase to essentially reset the drive. It will hit all the sectors that the OS can't access. Drives keep some sectors hidden for the case or re-allocating bad sectors so the drive still appears the same size to the OS.
     
    Some bios, however, lock out the drives. There are various methods of bypassing that. To check if your drive is frozen by the bios, run the following command:
     
    hdparm -I /dev/X Where X is your drive number.
    Sample output:
    Security: Master password revision code = 65534 supported not enabled not locked not frozen not expired: security count supported: enhanced erase 2min for SECURITY ERASE UNIT. 2min for ENHANCED SECURITY ERASE UNIT. However, if there is no "not" in front of frozen for you, then you need to try several methods.
    One is to put the computer to sleep and then resume:
    echo -n mem > /sys/power/state Another with IDE drives is to plug the IDE cable into the CD Rom drive first and then swap IDE cables. NOTE: Power must must still be applied to both CD Rom and Hard Drive on boot up. The IDE cable is just not plugged into the HD. Though, sometimes you can get away with plugging in the drive after the immediate post of the bios. Some computers can boot to a boot select device screen which should be past the initial lock out of the hard drive.
     
    SATA Drives support hot plugging, but sometimes that needs to be enabled in the bios. This can be done after the OS has loaded.
     
    Once the drive is not frozen, set a user password. The password can be a single letter for this as it's not permanent after the reboot.
    hdparm --user-master u --security-set-pass A /dev/X Now make sure the drive is enabled:
    hdparm -I /dev/X Sample output. The Enabled line is the one that's important here as there is no longer a "not" in front of Enabled.
    Security: Master password revision code = 65534 supported enabled not locked not frozen not expired: security count supported: enhanced erase Security level high 2min for SECURITY ERASE UNIT. 2min for ENHANCED SECURITY ERASE UNIT. Now enter the secure erase command:
    hdparm --user-master u --security-erase A /dev/X The prompt will not return until the operation is finished. If you want to do more shell commands while this is going on, you will need a new terminal. On older drives it can take up to 2 hours. Also, since this is a in-built drive command, there is no traffic over the IDE/SATA bus at all. This means that you can set several drives to wipe at the same time, but must use different terminals, and it will not affect the speed of erase. I did this for three 2TB drives once.
     
    After the erase has happened, the security will be disabled automatically:
    # hdparm -I /dev/X Security: Master password revision code = 65534 supported not enabled not locked not frozen not expired: security count supported: enhanced erase 2min for SECURITY ERASE UNIT. 2min for ENHANCED SECURITY ERASE UNIT. Hope you are successful.
     
    -Jon
×
×
  • Create New...