Is the ATA Secure Erase command working right now? (hdparm command)

Discussion in 'all things UNIX' started by dialxdrop, Oct 19, 2010.

Thread Status:
Not open for further replies.
  1. dialxdrop
    Offline

    dialxdrop Registered Member

    I first tried to use UBCD HDDErase although it won't detect my seagate 1000 GB Sata HD (This worked for my other computer/HD). So I loaded up a OpenSUSE live cd rescue terminal to enter the command (of course after setting a password and making sure HD is not frozen):

    time hdparm --user-master u --security-erase uber /dev/sda

    The following line appears:

    "Issuing SECURITY_ERASE Command, password="uber", user=user

    That's all it says and there is no % completed or anything. (as it appears on the wiki)
    https://ata.wiki.kernel.org/index.php/ATA_Secure_Erase

    Also I can still type but theres no command or console or anything it just is blank if I hit enter.


    Is my HD being wiped right now? or is it not working?
  2. dialxdrop
    Offline

    dialxdrop Registered Member

    Updates:
    3 hours passed and then it appears to have worked?

    Here is the final display message:
    Issuing SECURITY_ERASE command, password="uber", user=user
    0.00user 0.00system 2:00:24elapsed 0%CPU (0avgtext+0avgdata 1984maxresident)k
    0inputs+0outputs (0major+167minor)pagefaults 0swaps

    My master password is still enabled after the wipe? It shouldn't be:
    After a successful wipe operation, the drive security should automatically be set to disabled although my security still displays "Master password.... enabled" vs not enabled.

    Does anyone know if this operation worked? And if so, how do I change the password back to null?
  3. GlobalForce
    Offline

    GlobalForce Regular Poster

    And step two confirmed enabled? Compile it yourself or try another distro. Make sure you're dealing w/a compatible controller.
    Last edited: Oct 19, 2010
  4. Searching_ _ _
    Offline

    Searching_ _ _ Registered Member

    Code:
    time hdparm --user-master u --security-erase uber /dev/sda
    If you have used the "time" option, it will report after the operation has completed how long it took.
    Once issuing "--security-erase" I watch for the HDD activity light or touch the drive to feel if it is doing work. Not as reasuring as a Windows progress indicator, but hey, it's Linux. :D

    As for output, you have recieved more output than I am used to seeing when I run Secure Erase with the "time" option using hdparm from a Linux Live CD.

    Why the S.E command after completing doesn't change the enable status for the password sounds strange.

    If you turn off the computer and reboot into the Live CD, then issue the hdparm -I /dev/(your drive) command, what is the report?

    You can confirm the quality of the wipe using a PE disk and a hex editor; Winhex, HxD, Tiny Hexor.
    You can use Sea Tools 1.04 on the UBCD to verify native max size, the quantity of sectors, and the presence of partitions to determine success.
  5. katio
    Online

    katio Guest

    If you are already in Linux just use
    # hexedit /dev/sda
    for partitions, sectors...
    #fdisk -l /dev/sda
    ;)
  6. dialxdrop
    Offline

    dialxdrop Registered Member

    Katio, thank you for the suggestion.




    Searching, sorry for the late response but your advise was very helpful. I tried the hdparm command on another hard drive and the same output displayed. This time the security password resetted back to "not enabled."

    I then used Winhex to verify what appears to be an almost 100% complete wipe job as I saw pretty much nothing, except for 1 or 2 lines with a symbol or two..... (This was actually a really fun and exciting thing to do, just doing a successful hdparm command and verifying the results)

    I also used the Linux command Katio suggested and was able to capture all the hard drive information which appears legitimate. The first hard drive probably didn't reset back because I had done 2-3 hdparms before I had let it finish on the last attempt.

    Now since learning the Secure ATA command, I wanted to wipe out all my hard drives and now my laptop seems to be freezing the hard drive so I am wondering....

    So for other storage devices where ATA secure erase wouldn't work (External usb, laptop hard drives, etc) are there any other wipe methods that are equally effective as the ATA secure erase? (HDDerase and HDparm)

    I think I recall a thread in which BCwipe was the only other product/method that had equivalent wiping capabilities (bad sectors, re-allocated sectors).
    Last edited: Oct 26, 2010
  7. dialxdrop
    Offline

    dialxdrop Registered Member

  8. KnifeWrench
    Offline

    KnifeWrench Registered Member

    I had a similar problem with hdparm about six months or so ago when I tried to secure erase a couple of 1 TB drives. Both drives showed as being completed in exactly, or very close to, your times. Two hours and twenty some odd seconds just sounded a bit too contrived for my liking. I recall secure erasing 160 GB drives and those took about an hour and fifteen minutes, no way a 1 TB drive can be done is just a little over two hours. I then looked at the source code and I found the reason.
    const int timeout_2hrs = (2 * 60 * 60);​
    The secure erase command times out at two hours, regardless of the size of the drive. The solution, increase the timeout to read something like
    const int timeout_6hrs = (6 * 60 * 60);​
    I made the change and recompiled hdparm and it worked fine. It took more than three hours or so to actually erase the 1 TB drive. In the end the security password was reset to null as it should be. The newer versions of hdparm have addressed this timeout issue and now use the estimated time reported by the drive plus five minutes.
  9. Searching_ _ _
    Offline

    Searching_ _ _ Registered Member

    Overcoming the frozen drive:

    Boot into Linux Live CD
    in terminal
    hdparm -I /dev/(your drive)
    If the result is "frozen"
    Unplug the drive and then plug it back in, called "hot swapping".
    Then hdparm again,
    "not frozen" should be the result.

    I just tried to share what's available in my goings.
    Developers of Secure Erase are the ones who deserve the credit.
    They built an amazing tool into every hard drive.

    It was nice of you to use my password "uber" dialxdrop, but you can make it any letters you like. Doesn't have to be too many letters 3-4-5, password is temporary for the wipe. [​IMG]
    Last edited: Oct 27, 2010
Thread Status:
Not open for further replies.