4

I want to securely erase my SSD(on Ubuntu 18.04)

I do

sudo time hdparm --user-master u --security-erase mypassword /dev/sda

I get this error-message

/dev/sda:
 Issuing SECURITY_ERASE command, password="mypassword", user=user
SG_IO: bad/missing sense data, sb[]:  70 00 05 00 00 00 00 0a 04 51 40 00 21 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
SG_IO: bad/missing sense data, sb[]:  70 00 05 00 00 00 00 0a 04 51 40 01 21 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0.00user 0.00system 0:00.07elapsed 1%CPU (0avgtext+0avgdata 1892maxresident)k
0inputs+0outputs (0major+77minor)pagefaults 0swaps

Output of lsblk

sda      8:0    0 111,8G  0 disk 
├─sda1   8:1    0   512M  0 part /boot/efi
├─sda2   8:2    0 103,4G  0 part /
└─sda3   8:3    0     8G  0 part [SWAP]
sdb      8:16   0 931,5G  0 disk 
sr0     11:0    1  1024M  0 rom

What is wrongL, How do I fix it?

ctrl-alt-delor
  • 27,473
  • 9
  • 58
  • 102
MikiBelavista
  • 1,473
  • 8
  • 28
  • 38
  • Does the drive support that oepration? `hdparm -I /dev/sda |grep -A 8 Security` ... and it might be good to list the model and firmware in the question... `hdparm -I /dev/sda |grep -E "Model|Firmware"` – RubberStamp Feb 24 '19 at 12:41

1 Answers1

6

Are you booting from a Live CD/USB-Stick?

You can only use ATA Secure Erase when the drives are unmounted.

But this SG_IO error usually appears when the drive is in the frozen security state.

Check with "sudo hdparm -I /dev/sdX" (use correct letter for X).

It must say "not frozen", if it says "frozen" then just suspend your PC with this command:

"sudo systemctl suspend", your PC will turn off, wake it up again with pressing the space key, if that doesn't work press the power button once.

Now the SSD shouldn't be frozen anymore.

Lomotex
  • 76
  • 1
  • That is a creative and handy way to get the drive to reset state. It's worth noting that some of the hdparm inspection commands seem to have the effect of freezing Samsung drives. – breakpoint Aug 21 '20 at 00:36