well i issued the following command: shred -v /dev/sdb.
However I wanted to shred /dev/sda. I realized my mistake after about 2gb had been shredded (out of 2.7tb raid volume). what is the recommended action to recover these files?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communitywell i issued the following command: shred -v /dev/sdb.
However I wanted to shred /dev/sda. I realized my mistake after about 2gb had been shredded (out of 2.7tb raid volume). what is the recommended action to recover these files?
Depends what was on it.
If it was LUKS encrypted, the LUKS header is gone and so is your data (unless it is still in luksOpened state in which case you should grab the output of dmsetup table --showkeys
).
Unencrypted, photorec
might carve some things for you. It finds unfragmented files of known types, not just photos.
If there were partitions that started beyond the dead zone, testdisk
might find them for you.
If the filesystem you used has backup metadata beyond the dead zone, and you remember the exact starting offset of your partition (or maybe you used GPT which has a backup of the partitions at the end of the disk so you did not lose the starting offset in the first place).
Create an overlay as described here:
Then experiment with the overlay, for example utilizing fsck
and mount
options using backup superblocks (-o sb=n
or whatever). You will have to google how to do these things specifically for the filesystem you used.
Since you mention raid, if the disk was part of a RAID array with redundancy on other disks (e.g. a RAID5 of /dev/sdbY
, /dev/sdcY
, /dev/sddY
), you should simply fail it and have the data restored by redundancy information.
mdadm /dev/mdX --fail /dev/sdbY
mdadm /dev/mdX --remove /dev/sdbY
parted /dev/sdb
mdadm /dev/mdX --add /dev/sdbY