80GB Intel X25-M G2 SSD and Secure Erase

For whatever reason after updating my Intel X25-M G2 SSD to latest firmware (dated 2011) option to do secure erase disappeared. Yes, I know all about tricks of hot plugging disks etc. Secure erasing another identical X25-M G2 on same PC visible as /dev/sdb works fine. One with latest firmware simply no longer supports it which is also confirmed by hdparm -I.



I found following bash oneliner on Interwebs which seemed promising.

# Get number of sectors, 156301488 in this case
fdisk -lu /dev/sda
# Mark all sectors trimmed
i=0; while [ $i -lt 156301488 ]; do echo $i:40000; i=$(((i+40000))); done | hdparm --trim-sector-ranges-stdin --please-destroy-my-drive /dev/sda

This appears to work. However, it DOES NOT. Checking content of /dev/sda with "hexdump -C /dev/sda" reveals that there are few sectors left with data that weren't cleared for some reason. Therefore I decided to do "dd if=/dev/zero of=/dev/sda bs=16M" and after that repeat hparm trim command. Now it's empty and ready for reuse in another PC. Go figure.



Comments