SOLVED problems with ATA secure erase

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post please read how to get help
Post Reply
Level 1
Level 1
Posts: 1
Joined: Sun Jun 17, 2018 10:51 am

SOLVED problems with ATA secure erase

Post by Babiz » Sun Jun 17, 2018 11:59 am

Hi folks, Today I'm getting same thing , When doing ATA SECURE ERASE trought GNOME-DISKS utility, power loss happen to hdd drive , resulting Hdd locked permanently.

After some googling , I found the trick to restore and unlock manually with hdparm. I get back to work.
Ho yes, let me explain how to;
gnome-disks when selecting "ATA SECURE ERASE" under "Formatting" tab, will call "udiskd" service daemon for this job. You can see under /var/log/daemon.log (and system.log) this log entry when you start to format hdd with "ATA SECURE ERASE"
17/06/18 16:23 M51Se udisksd[1206] Commencing ATA enhanced secure erase of /dev/sdb (your hdd model ID). This operation is expected to take at least 96 minutes to complete
Well unfortunatley no logs entry say kind of password used to do it. :D
Looking logfile is useless? Not really, so when you know the "udisksd" make this job, you can search under source code of udisksd any hardcoded PASSWORD entry! LOL.

Another folks write about this password is hardcoded into udisksd as "xxxx", , I see this when deep digging on google for a solution. But if you get source code of udisksd and search "user password" into its "udiskslinuxdriveata.c" code, then you can see "xxxx". Nice shot!

Now finally if you get stuck on hdd locking by gnome-disks tool because of somethings get bad and udisksd daemon cannot "auto remove" password set on hdd for ATA SECURE ERASE subroutine, you can simply do this hdparm command :

Code: Select all

sudo hdparm --security-disable xxxx /dev/sd?
when "sd?" is Your drive to unlock
Other info about ATA SECURE ERASE and hdparm command line tool, is foundable here:

Well, hope this is useful for some other folks need to get out of this specific trouble, for me is markable SOLVED!

Level 1
Level 1
Posts: 1
Joined: Mon Dec 24, 2018 12:18 pm

Re: SOLVED problems with ATA secure erase

Post by forregistryonly » Mon Dec 24, 2018 1:46 pm

it certainly helped me!

it is odd, that gnome-disks doesn't show the password in big red letters during operation, because that what gui is for, or even better—asks for user input before…

obviously, when one uses hdparm directly he sets the password and knows how to remove it if the operation was to terminate for some reason (I just pulled the plug because time to complete was stated 1 month and 15 days)

thank you for sharing your experience

Post Reply

Return to “Other topics”