Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

partitions on loopdev

0 views
Skip to first unread message

Enrico Weigelt

unread,
Jul 29, 2000, 3:00:00 AM7/29/00
to
hi,

i need to mount partitions in an hdimage file (DOS disklabel).
is there any chance to do this ? perhaps with the loopdev (define the
mapping region) ?
but how to find out where the partitions start and end in a portable way
?

is it possible to use the code, which manages the partitions on ide and
scsi device
on loop devices ?

bye,
ew.

PS: please anwer me direct.

--

----------------
telnet rulez.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/


Andries Brouwer

unread,
Jul 29, 2000, 3:00:00 AM7/29/00
to
On Sat, Jul 29, 2000 at 05:28:39AM +0200, Enrico Weigelt wrote:

> i need to mount partitions in an hdimage file (DOS disklabel).
> is there any chance to do this ? perhaps with the loopdev (define the
> mapping region) ?
> but how to find out where the partitions start and end in a portable way
> ?

Look at the subdirectory partx of a recent util-linux release
such as 2.10m. There are ioctls to tell the kernel where on some
block device the partitions live, so the kernel partition parsing
code is superfluous in principle and can be moved to user space.

(So far this has only a small handful of users that I know of,
and the support is just enough for what is actually used.
If you need more, complain, and things will improve a bit again.)

Andries

Andrzej Krzysztofowicz

unread,
Jul 29, 2000, 3:00:00 AM7/29/00
to

> i need to mount partitions in an hdimage file (DOS disklabel).
> is there any chance to do this ? perhaps with the loopdev (define the
> mapping region) ?

Yes.

> but how to find out where the partitions start and end in a portable way
> ?

Use fdisk on a partitioned device and display in block units instead of
cylinders ?

> is it possible to use the code, which manages the partitions on ide and
> scsi device
> on loop devices ?

No. Because of minor number assigment differences beetween disk and loop
devices. Maybe in future, when devfs will be a standard. Far future.

--
=======================================================================
Andrzej M. Krzysztofowicz an...@mif.pg.gda.pl
phone (48)(58) 347 14 61
Faculty of Applied Phys. & Math., Technical University of Gdansk

Rogier Wolff

unread,
Jul 29, 2000, 3:00:00 AM7/29/00
to
Andries Brouwer wrote:
> On Sat, Jul 29, 2000 at 05:28:39AM +0200, Enrico Weigelt wrote:
>
> > i need to mount partitions in an hdimage file (DOS disklabel).
> > is there any chance to do this ? perhaps with the loopdev (define the
> > mapping region) ?
> > but how to find out where the partitions start and end in a portable way
> > ?
>
> Look at the subdirectory partx of a recent util-linux release
> such as 2.10m. There are ioctls to tell the kernel where on some
> block device the partitions live, so the kernel partition parsing
> code is superfluous in principle and can be moved to user space.

Whatever support there now is, i've been able to do this without
that stuff so far.

Just mounting /tmp/disk.img4 doesnt' work: you have to setup
the loopdev yourself.

I do:

losetup -o 32256 /dev/loop0 /tmp/disk.img
mount /dev/loop0 /mnt/d1

to mount the first partition on a full-disk image that has been
formatted with Microsoft tools. (I'm afraid you'll have to parse the
partition table and do the math to find the offset in bytes yourself.)

Roger.

--
** R.E....@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2137555 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
* Common sense is the collection of *
****** prejudices acquired by age eighteen. -- Albert Einstein ********

0 new messages