Skip to content

[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.

1 points8 comments
Open on Reddit
About this post
Posted
Archived
Edited
Score
1 · 100% up
Kind
Text
ID
e2e4ey

Author

14
posts
184
comments
0
media
View profile

8 comments

Do not use redirection with sudo. Try switching to root terminal instead:

sudo -i
dd bs=512 if=/dev/sdb | pigz > data.img.gz

Also you should check other compressing tools. That might be pigz bug.

2 points

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.

1 points

pigz and gzip use the same compression algorithm and file format. I would check at least 1 completely different tool. For example:

dd bs=512 if=/dev/sdb | zstd -T4 > data.img.zst
2 points

I'm getting an I/O error (at 9.5GB readed)

Every time or just this once? If every time, sounds like a broken drive.

I hope you have backups?

1 points

Every time or just this once? If every time, sounds like a broken drive.

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 hope you have backups?

I don't have backup because I don't have bigger drives to store the data

1 points

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?

1 points

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).

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.