How do I fix my failed attempt at encrypting an external usb hdd

Hi,

Hoping someone may guide me through resolving the issue of my HDD no longer working by something going wrong with encryption failure.

Steps I took after plugging in my 1TB Seagate portable HDD and the error afterwards, always as the messages error in Dolphin file manager:

df -hl
umount /dev/sda1
sudo wipefs -a /dev/sda1

Then when I got to cryptsetup using:

sudo cryptsetup luksFormat /dev/sda1

Typed in YES during prompt if I am sure I that I want to continue with overwriting data.

Got asked to enter new password, then to verify it. Well, the confirmed by pressed enter on keyboard after the second passphrase this is the error message I recieved:

WARNING: Locking directory /run/cryptsetup is missing!

And in Dolphin file manager, this is what the error message was:

An error occurred while accessing '931.5 GiB Encrypted Drive', the system responded: An unspecified error has occurred: No such interface “org.freedesktop.UDisks2.Filesystem” on object at path /org/freedesktop/UDisks2/block_devices/dm_2d2

Now I cant seem to do anything with the hdd including to reformat it.
May someone help please.

I use zulucrypt 5.7.1 on my usb and external ssd hard drive, and it works great! It is available via AUR. You may want to try that.

I’ll take a peak at it in depth tomorrow morning, thanks for the in suggestion. I love what I see so far.

An encrypted HD or partition of it is not something you can “mount” and “unmount”.
You can only “open” or “close” the container.
So if you had /dev/sda1 already encrypted and opened and want to start over you need to “close” it before using wipefs on the partition.
If you want to create/wipe/mount etc the filesystem inside the container you should be using the device mapper name you used while opening the container…
The name will be under /dev/mapper/ with the same name you used “luksOpen” with.

That said:
By doing sudo wipefs -a /dev/sda1 you actually messed your encrypted container itself.

Oh geez, I feel silly now.

Thank you, seriously… for taking the time to actually explain what’s happened there.

Appreciate it.

Old and barely used HDD, bought purposely for backing up Photos from and even oldwindows 7 machine machine.

Not sure even what the format would be for that, n
But I think I maybe enough to go on now in my quest to fix it.

In my defence though, I did look here first for answers, took a few peaks around else were, that looked super easy to do fast, and that’s where they always get ya where it hurts most…

How do I got about starting over, how do I just format the whole thing and have a hard drive that’s usable. May someone please help me with this.

BTW, I came across this [HowTo] erase an external disk (USB, SD-Card, …) EASILY (through a GUI) by @Fabby , and thought that it resolve my problem, however this is the error message I get it when using KDE Partition Manager, after pressing Apply on step 9 (apply new partition table)

Create a new partition table (type: gpt) on ‘/dev/sda’
Job: Create new partition table on device ‘/dev/sda’
Command: sfdisk /dev/sda
Create new partition table on device ‘/dev/sda’: Error
Create a new partition table (type: gpt) on ‘/dev/sda’: Errorstrong text

UPDATE:
I found this [root tip] Repartition and format your USB stick tutorial by @linux-aarhus
I have followed the instructions on from his tutorial with the script provided. I has not worked on the 1TB external USB HDD.
However, it worked great on a 8GB USB stick I test it on.

SOLVED:
Turned on Windows 10 in Virtualbox, right clicked on drive in My Computer, then format, a few seconds later. Format complete. Shutdown Virtualbox. Took all of about 90 seconds. Hard drive works perfect now on Linux.

Would love to understand more how this all works on Linux and how something is so quickly and effortlessly is done on a Windows system, yet so complex and hard to do on Linux (for me anyways in regards to formatting a hdd when it was my own fault for following the wrong instructions trying to encrypt it. I didnt do my due diligence in the first place…lesson learnt there.)

It’s actually a lot easier in Linux, you just need to do it via a terminal instead of a GUI…
It might be due to the fact that you needed to created a new partition table which was failing when using a GUI…

1 Like

Did you follow the tutorial exactly? (E.G. no peeking at the disk?) Because this sounds like the partition was mounted.

:thinking:

1 Like

Yes I did need a new partition table. Sorry I haven’t checked forums in a long time. Was trying different distros and always come back to manjaro.

It worked out when I tried it again and followed the tutorial exactly… Sorry haven’t answered sooner, was trying out different distro’s.
Its amazing - how different (more helpful, more info, more friendly, more better on all aspects IMHO) manjaro/arch community is in comparison to other distro communities.

2 Likes

No worries.

Therefore, I’ve marked this answer as the solution to your question as it is by far the best answer you’ll get.

However, if you disagree with my choice, please feel free to take any other answer as the solution to your question or even remove the solution altogether: You are in control! (If you disagree with my choice, just send me a personal message and explain why I shouldn’t have done this or :heart: or :+1: if you agree)

:innocent:
P.S. In the future, please don’t forget to come back and click the 3 dots below the answer to mark a solution like this below the answer that helped you most:
Solution
so that the next person that has the exact same problem you just had will benefit from your post as well as your question will now be in the “solved” status.

Will do. Thanks for that.

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.