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 read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Babiz

SOLVED problems with ATA secure erase

Post by Babiz »

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:
https://ata.wiki.kernel.org/index.php/ATA_Secure_Erase

Well, hope this is useful for some other folks need to get out of this specific trouble, for me is markable SOLVED!
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
forregistryonly

Re: SOLVED problems with ATA secure erase

Post by forregistryonly »

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
Locked

Return to “Other topics”