How to erase the whole disk ?

Help
Katrien
2008-07-16
2013-04-27
  • Katrien
    Katrien
    2008-07-16

    Hi all,

    Since quite a while I want to erase my harddisk on the secure erase method. hdparm supports
    this, but I always get the same error 5.

    I use version 6.9

    root@Knoppix:/media/hda1# hdparm -V
    hdparm v6.9

    The first thing I do is ask some info about the disk:

    root@Knoppix:/media/hda1# hdparm -I /dev/hda

    /dev/hda:

    ATA device, with non-removable media
            Model Number:       SAMSUNG SP0411N
            Serial Number:      S01JJ50X351236
            Firmware Revision:  TW100-11
    Standards:
            Used: ATA/ATAPI-7 T13 1532D revision 0
            Supported: 7 6 5 4
    Configuration:
            Logical         max     current
            cylinders       16383   16383
            heads           16      16
            sectors/track   63      63
            --
            CHS current addressable sectors:   16514064
            LBA    user addressable sectors:   78165360
            device size with M = 1024*1024:       38166 MBytes
            device size with M = 1000*1000:       40020 MBytes (40 GB)
    Capabilities:
            LBA, IORDY(can be disabled)
            Standby timer values: spec'd by Standard, no device specific minimum
            R/W multiple sector transfer: Max = 16  Current = 16
            DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 *udma5
                 Cycle time: min=120ns recommended=120ns
            PIO: pio0 pio1 pio2 pio3 pio4
                 Cycle time: no flow control=120ns  IORDY flow control=120ns
    Commands/features:
            Enabled Supported:
               *    SMART feature set
               *    Power Management feature set
               *    Write cache
               *    Look-ahead
               *    WRITE_BUFFER command
               *    READ_BUFFER command
               *    DOWNLOAD_MICROCODE
               *    Device Configuration Overlay feature set
               *    Mandatory FLUSH_CACHE
               *    SMART error logging
               *    SMART self-test
    Security:
            Master password revision code = 65534
            16min for SECURITY ERASE UNIT. 16min for ENHANCED SECURITY ERASE UNIT.
    HW reset results:
            CBLID- above Vih
            Device num = 0 determined by CSEL
    Checksum: correct

    It looks that my disk supports enhanced security erase. Now I set the password, but
    this already fail:

    root@Knoppix:/media/hda1# hdparm --security-set-pass test /dev/hda

    /dev/hda:
    Issuing SECURITY_SET_PASS command, password="test", user=master, mode=high
    Problem issuing security command: Input/output error
    Error: 5

    Then I tried to unlock, but because the password setting failed, this doesn't work either.

    root@Knoppix:/media/hda1# hdparm --security-unlock test /dev/hda

    /dev/hda:
    Issuing SECURITY_UNLOCK command, password="test", user=master
    Problem issuing security command: Input/output error
    Error: 5

    And the erase also give an error:

    root@Knoppix:/media/hda1# hdparm --security-erase test /dev/hda

    /dev/hda:
    Issuing SECURITY_ERASE command, password="test", user=master
    HDIO_DRIVE_CMD(erase prepare) failed: Input/output error

    Can somebody help me to work this out ?

    Thanks a lot,

    Lotje

     
    • dpstrand
      dpstrand
      2008-12-18

      I had this issue recently. If you use a newer hdparm it will show the security settings:

      # hdparm -V
      hdparm v8.6

      # hdparm -I /dev/sdb
      ......
      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.

      When I kept getting Input/output error it turned out my disk was set to frozen (the not in front of frozen was missing). I power cycled the disk, and then issued the commands in this order:

      hdparm --security-set-pass masterpwd /dev/sdb
      hdparm --user-master u --security-set-pass userpwd /dev/sdb
      hdparm --user-master u --security-erase-enhanced userpwd /dev/sdb

      That worked for me. Good luck.

       
    • dpstrand
      dpstrand
      2008-12-19

      Oh one thing to be very careful of. Make sure you check the device! It is not forgiving.

      Make sure you don't wipe the wrong device. My example used /dev/sdb whereas your example used /dev/hda.