[aklug] Re: loop devices with partitions...?

From: Arthur Corliss <acorliss@nevaeh-linux.org>
Date: Wed Sep 08 2010 - 21:34:41 AKDT

On Wed, 8 Sep 2010, Christopher Howard wrote:

> Hey, I recently learned you could represent an image file with a loop
> device, which is pretty cool. So, you can create, say, /dev/loop0, and
> then turn it into a file system with mkfs.xfs /dev/loop0 (or whatever
> happens to be your poison).
>
> I noticed I can, instead of turning it into just a file system, run
> fdisk on it to turn it into a disk image with several partitions.
> However, what I'm not sure about yet is, if /dev/loop0 represents the
> disk.img file with several partitions on it, how do "bring out" each of
> those partitions to be its own loop file? (Like, /dev/loop0-part1 or
> something...?)

   kpartx -v -a /dev/loop0

This will create some new devices (like /dev/mapper/loop0p1) for you to
perform regular operations on.

         --Arthur Corliss
           Live Free or Die
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Wed Sep 8 21:34:49 2010

This archive was generated by hypermail 2.1.8 : Wed Sep 08 2010 - 21:34:49 AKDT