Union mount of block devices?
Hi all,
sorry to bother the ml but I'm not able to find the answer via Google. Quick answer: is it possibile to stack block devices as union
mount? Something like /dev/sdb1 (ro) below /dev/sdc1 (rw)?
Long story...
I've got a partition with the begin of the journal over a few bad
blocks (by the way, it's NTFS but it doesn't matter), so it is not
possible to fix/replay journal, and so on.
I can dd/dd_rescue the partition to file/partition and fix/recover
all, but I just need to suck some files, so it would be a lot easier/quicker
to stack a good partition (rw) over the bad one (ro).
Thanks a lot for your time,
Andrea
Quoted 5 lines · Andrea Gelmini
Hi all,
sorry to bother the ml but I'm not able to find the answer via Google. Quick answer: is it possibile to stack block devices as union
mount? Something like/dev/sdb1(ro) below/dev/sdc1(rw)?
Quoted 8 lines
Long story...
I've got a partition with the begin of the journal over a few bad
blocks (by the way, it's NTFS but it doesn't matter), so it is not
possible to fix/replay journal, and so on.
I can dd/dd_rescue the partition to file/partition and fix/recover
all, but I just need to suck some files, so it would be a lot easier/quicker
to stack a good partition (rw) over the bad one (ro).
The phrase "union mount" caught my eye, but it's not what you want. :) Union mounts merge file systems at the namespace level, not the block or byte level of individual files.
You can try something like this to get what you describe above:
* Create a file big enough to cover the bad blocks
* Turn it into a loop device
* Create a loop device out of the good portion of your original block device using the "-o <offset>" argument to losetup
* Use md or whatever to concatenate the two together
There will be annoying issues with headers and alignment. If you can find a userspace recovery tool, you'll probably be a lot better off.
-VAL