linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Union mount of block devices?
@ 2009-11-13 13:28 Andrea Gelmini
  2009-11-16 21:16 ` Valerie Aurora
  0 siblings, 1 reply; 2+ messages in thread
From: Andrea Gelmini @ 2009-11-13 13:28 UTC (permalink / raw)
  To: linux-fsdevel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Union mount of block devices?
  2009-11-13 13:28 Union mount of block devices? Andrea Gelmini
@ 2009-11-16 21:16 ` Valerie Aurora
  0 siblings, 0 replies; 2+ messages in thread
From: Valerie Aurora @ 2009-11-16 21:16 UTC (permalink / raw)
  To: Andrea Gelmini; +Cc: linux-fsdevel

On Fri, Nov 13, 2009 at 02:28:42PM +0100, Andrea Gelmini wrote:
> 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).

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-11-16 21:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-13 13:28 Union mount of block devices? Andrea Gelmini
2009-11-16 21:16 ` Valerie Aurora

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).