Re: Partitioned loop device..

From: Herbert Pötzl (herbert@13thfloor.at)
Date: Tue Jul 15 2003 - 11:05:58 EST


On Tue, Jul 15, 2003 at 11:53:17AM -0400, Josh Litherland wrote:
> In article <200307151001.44218.kevcorry@us.ibm.com> you wrote:
>
> > so there's not much of a reason to add partitioning support to the loop
> > driver itself.
>
> Working with sector images of hard drives? I use Linux for data
> recovery jobs and it would be very helpful to me to be able to look at
> DOS partitions inside a loopback device. As it is I must chunk it up
> into seperate files by hand.

you could also setup more than one loopback
device with different offsets into the partitions ...

for my purposes, I use the folowing script (part)

YMMV,
Herbert

---------------------

losetup /dev/loop/0 $file
sfdisk --dump /dev/loop/0 | gawk '
        /^\/dev\/loop/ {
                          if ($6+0 > 0) {
                                part=substr($1,13)+0;
                                dev=sprintf("/dev/loop/%d", part);
                                printf "losetup %s -o %d /dev/loop/0\n", dev, $4*512;
                                printf "fsck -p -f %s\n", dev;
                                printf "mkdir -p /mnt/disk/part%d\n", part;
                                printf "mount %s /mnt/disk/part%d\n", dev, part;
                          }
                        }
        ' | sh

>
> --
> Josh Litherland (josh@emperorlinux.com)
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Jul 15 2003 - 22:00:58 EST