[Help] Accidentally formatted my encrypted data disk
Yesterday I get the device wrong and make a MBR partition table with a FAT32 partition on my data disk. If I remember correctly, the disk contained GPT partition table with a single LUKS partition formatted with EXT4. I have a LUKS header backup that I can try to restore manually. But first of all, I want to do a backup image and I'm getting an I/O error (at 9.5GB readed) with this command:
sudo dd bs=512 if=/dev/sdb | pigz > data.img.gz
Any idea? Anyone knows how to use ddrescue in the same way to compress the image?
P.S.: I don't have a bigger disk than this, this is why I don't have a backaup and why I need to compress the image.
Edited 27 Nov 2019. We only hold this version.
About this post
- Posted
- Archived
- Edited
- Score
- 1 · 100% up
- Kind
- Text
- ID
- e2e4ey
8 comments
Do not use redirection with sudo. Try switching to root terminal instead:
Also you should check other compressing tools. That might be pigz bug.
The error happens also with gzip, so I'm starting to consider that is a disk failure. I'll try to find a way of using ddrescue and compressing the image.
pigz and gzip use the same compression algorithm and file format. I would check at least 1 completely different tool. For example:
Every time or just this once? If every time, sounds like a broken drive.
I hope you have backups?
I don't think so, it's quite new, SMART tests are fine and until yesterday it was working perfectly. Could it be a bad sector?
I don't have backup because I don't have bigger drives to store the data
Is sdb all taken and full or is it partially full. Boot, unencrypt, make the partition smaller (as possible), and backup the specific partition, not the whole disk.
If 8GiBs are used then your compressed image would like 2.5GiBs. Is the target large enough, or is the procedure running out of space in the target side?
The target is large enough, sdb is not mounted and I can't backup the old partition because it does not exist. I'm making the backup of the whole disk before trying to restore the luks header manually (if header restore fails, I will have an img before the restoration).
Ah yes the mistake everyone makes only once.