I lost access to my encrypted Debian USB HDD

I installed Debian 13 on an USB portable drive because I like the portability of these devices, it’s a portable HDD.

I installed Debian 13 following the wizard setup and selected full disk encryption.

I have been working just fine for this month on a document and im panicking at the thought of having to start from scratch because I don’t have it backed up elsewhere.

What happens is, I enter the password, the password is correct, but then I see a bunch of errors that said [FAILED] in red letters. Eventually it just freezes and I had to press the reebot button.

I have tried the recovery mode thing on the GRUB menu (I selected the oldest version in there, there are a couple version to choose from), entered the password and it says this:

Code:

Please unlock disk sd5_crypt:
cryptsetup: sdb5_crypt: set up successfully
done.
Begin: Running /scripts/local-premount ... done.
PM: Image not found (code -22)
Begin: Will now check root file system ... fsck from util-linux 2.41
[sbin/fsck.ext4 (1) -- /dev/mapper/debian--vg-root] fsck.ext4 -a -C0 /dev/mapper/debian--vg-root
/dev/mapper/debian--vg-root: recovering journal
Inode (some number here) extent tree (at level 1) could be shorter. IGNORED
Inode (some number here) seems to contain garbage.

/dev/mapper/debian--vg-root: UNEXPECTED INCONSISTENCY: RUN Fsck MANUALLY
            (i.e., without -a or -p options)
fsck exited with status code 4
done.
Failure: File system check of the root filesystem failed
The root filesystem on /dev/mapper/debian--vg-root requires a manuacl fsck



BusyBox v1.37.0 Debian (some numbers here) built-in shell (ash)
Enter 'help' for a list of built-in commands.


(initramfs) _ and it lets me type here

Im on a laptop and typing this as I see it on the desktop screen btw not copy pasted.

If I just use the normal GRUB option to boot, I cannot see it because it goes too fast but like I said, tons of [FAILED] errors during boot. At the begining something about mounting exfb4 with errors or something.

I have tried booting on Tails and see if I can open it from here, it opens and I see all the files, however, none of the files work. I cannot copy them out of the drive or open them.

Is the drive dead? what the hell happened between yesterday and today?

Man this is devastating, a month of work wasted.

Im not going to be using these portable drives again, im going to make backups on all SATA HDDs I can find now. But please let me know if I can somehow recover the files. All I need is a small document file, the rest I have backed up, I just need that one file. This is mental.

The only hope I have is that I see the files and recognizes the password. However im not sure if the drive is busted and has I/O errors. Please let me know ASAP. I just need to recover a small file. Hopefully there is a way.

This does not sound too fun.
Here is what I can suggest:

1. Borderline foolproof method - Clone the corrupted USB to an image and store it on a system you can trust. This is easy, you can even mount it in a vm or dd/some other USB image burning tool it to another equal size USB and go at it until it works without risking damage to the original data. Presuming you have an actual system that you can store this image (The image will be allocated to the full size of the USB) so… a 16GB USB that your only using 3.6GB of = 16GB image

I would than even further reccomend making a backup of that image to play around with just because. (Cool! You now have 2 Backups!)

1A. Mount the image in a functioning Linux and see if you can access anything after decrypting with the master password. If you can see the files and they are listed as 0b, this can signify fs corruption that potentially enters a whole another dimension of data rescue. If you can see the files are present, but can’t access them, check and modify permissions first. (If this works, you will have your file)

2. Try to fix the corrupted fs map (might resolve issue); Try on backup image first either in VM or after properly flashing the backup to another USB

On the initramfs prompt, run this:

fsck.ext4 /dev/mapper/debian–vg-root

This should be able to fix the corrupted fs map. (Look up fsck.ext4 usage and options for more info)

If FSCK is successful, than you should be able to obtain your file, there definately are other methods that I am not currently aware of so if my suggestions dont work, there is usually always a way.

Something worthy of pointing out->When using a bootable Linux USB, running in persistance mode frequently is bound to wear it out and can lead to issues like this down the line depending on the age and usage of the USB pre and post flash, on top of the quality of the USB itself.

If I got anything Incorrect here I apologise in advance.

1 Like