linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: "Markus Laire" <malaire@gmail.com>
To: LVM general discussion and development <linux-lvm@redhat.com>
Subject: Re: [linux-lvm] lvm partition on lv
Date: Tue, 8 Aug 2006 13:40:24 +0300	[thread overview]
Message-ID: <67d53e40608080340y484e4674j8937f47877cda2f4@mail.gmail.com> (raw)
In-Reply-To: <67d53e40608080334l7445e32fga32f7381ed49dc65@mail.gmail.com>

On 8/8/06, Markus Laire <malaire@gmail.com> wrote:
> On 8/8/06, Randall Smith <randall@tnr.cc> wrote:
> > Let's say on /dev/vg1/test I had one LVM partition and one ext3
> > partition.  How can I access those separate partitions since it's only
> > one device (/dev/vg1/test)?  Normally, a partitioned block device
> > (/dev/hda) would show up like /dev/hda1, dev/hda2, etc.
>
> With loop-device, you can use only part of the block-device as new
> block-device (See options -o and -s in man:losetup)
>
> So if you know the positions where the partitions start, and their
> lengths (both in bytes), you could do something like this: (I havn't
> tested this, so there might be some errors in these commands. But the
> basic idea should work)
>
> # make LVM partition available at /dev/loop1
> losetup -o $lvm_start -s $lvm_size /dev/loop1 /dev/vg1/test
> mkdir /mnt/test
> # Mount ext3-partition at /mnt/test using loop-device
> mount -t ext3 -o offset=$ext3_start,sizelimit=$ext3_length
> /dev/vg1/test /mnt/test

Well, last command is missing at least "loop" option - i.e. it should be

mount -t ext3 -o loop,offset=$ext3_start,sizelimit=$ext3_length
/dev/vg1/test /mnt/test

or you could use these instead
losetup -o $ext3_start -s $ext3_length /dev/loop2 /dev/vg1/test
mount -t ext3 /dev/loop2 /mnt/test

I hope I didn't make other mistakes...

($lvm_size and $ext3_length both means the size of the partition in
bytes - I should've used 'size' or 'length' for both for consistency)

-- 
Markus Laire

  reply	other threads:[~2006-08-08 10:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-08  1:17 [linux-lvm] lvm partition on lv Randall Smith
2006-08-08 10:34 ` Markus Laire
2006-08-08 10:40   ` Markus Laire [this message]
2006-08-08 14:27     ` [linux-lvm] " Randall Smith
2006-08-14  4:42 ` Randall Smith

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=67d53e40608080340y484e4674j8937f47877cda2f4@mail.gmail.com \
    --to=malaire@gmail.com \
    --cc=linux-lvm@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).