From: "Stuart D. Gathman" <stuart@bmsi.com>
To: LVM general discussion and development <linux-lvm@redhat.com>
Subject: Re: [linux-lvm] mounting a filesystem on LVM2
Date: Tue, 5 Oct 2010 10:25:12 -0400 (EDT) [thread overview]
Message-ID: <Pine.LNX.4.64.1010051017001.29065@bmsred.bmsi.com> (raw)
In-Reply-To: <AANLkTi=5CZ+Z1vJv3qfdy0RMNiE0js-amQ9V7+d3iAff@mail.gmail.com>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 3991 bytes --]
On Tue, 5 Oct 2010, Tapas Mishra wrote:
> On Tue, Oct 5, 2010 at 11:54 AM, Stuart D. Gathman <stuart@bmsi.com> wrote:
> > 3) an "LV" is a Logical Volume. �An advanced user might want to use an
> > � LV to simulate a disk, putting a partitional table on it. �Usually
> > � this is done by using the LV as a virtual disk for a Virtual Machine,
> > � which then partitions and uses the virtual disk as it pleases.
> > � You could also use fdisk/parted to partition an LV, and kparted to
> > � make the partitions available as separate block devices.
>
> This is exactly what I am looking at.
> A tool virt-manager (from Red Hat does that)
> how does it do ?
> While installing a guest OS in an LVM I do not have to create a swap I
> just point to the ISO on my server
> and rest is done.
> How is that part taken care of does virt-manager do it or the OS which
> is being installed some thing from that makes sure that when you are
> installing a guest OS in a virtualization environment then in an LVM
> it will do.
> Because I never needed to create partitions within LVM until I am
> doing this setup to clone the LVM on the server to a
> USB backup drive.
1) man kpartx
2) "partitions within LVM" doesn't make sense. LVM is a software package,
not a storage device, and it doesn't do partitions.
You probably mean "partitions within an LV".
Here is an example of using kpartx:
# lvcreate -L1G -n test vg_sdg
# fdisk /dev/vg_sdg/test
...
# sfdisk -l /dev/vg_sdg/test
Disk /dev/vg_sdg/test: 130 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End #cyls #blocks Id System
/dev/vg_sdg/test1 0+ 99 100- 803218+ 83 Linux
/dev/vg_sdg/test2 100 129 30 240975 82 Linux swap / Solaris
/dev/vg_sdg/test3 0 - 0 0 0 Empty
/dev/vg_sdg/test4 0 - 0 0 0 Empty
# kpartx -l /dev/vg_sdg/test
vg_sdg-test1 : 0 1606437 /dev/vg_sdg/test 63
vg_sdg-test2 : 0 481950 /dev/vg_sdg/test 1606500
# kpartx -av /dev/vg_sdg/test
add map vg_sdg-test1 (253:6): 0 1606437 linear /dev/vg_sdg/test 63
add map vg_sdg-test2 (253:7): 0 481950 linear /dev/vg_sdg/test 1606500
# mke2fs /dev/mapper/vg_sdg-test1
mke2fs 1.41.9 (22-Aug-2009)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
50288 inodes, 200804 blocks
10040 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=209715200
7 block groups
32768 blocks per group, 32768 fragments per group
7184 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 29 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
# mount /dev/mapper/vg_sdg-test1 /mnt/tmp
# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/dm-1 15481840 12143008 2552400 83% /
tmpfs 512672 404 512268 1% /dev/shm
/dev/sda1 295561 95222 185079 34% /boot
/dev/dm-0 36124288 31419784 2869688 92% /home
/dev/dm-3 10321208 5969640 3827324 61% /video
/dev/sr1 6828 6828 0 100% /media/U3 System
/dev/sdb1 7837760 2046560 5791200 27% /media/Cruzer
/dev/mapper/vg_sdg-test1
790556 808 749588 1% /mnt/tmp
--
Stuart D. Gathman <stuart@bmsi.com>
Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154
"Confutatis maledictis, flammis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.
next prev parent reply other threads:[~2010-10-05 14:25 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-04 8:02 [linux-lvm] mounting a filesystem on LVM2 Tapas Mishra
2010-10-04 14:46 ` Phillip Susi
2010-10-04 15:06 ` Tapas Mishra
2010-10-04 15:32 ` Tapas Mishra
2010-10-04 15:37 ` Ray Morris
2010-10-04 16:37 ` Alexander Skwar
2010-10-04 17:33 ` Tapas Mishra
2010-10-04 18:30 ` Alexander Skwar
2010-10-04 19:08 ` Tapas Mishra
2010-10-04 19:10 ` Tapas Mishra
2010-10-04 19:20 ` Tapas Mishra
2010-10-04 19:57 ` Alexander Skwar
2010-10-05 2:40 ` Tapas Mishra
2010-10-05 3:31 ` Ray Morris
2010-10-05 5:33 ` Tapas Mishra
2010-10-05 6:32 ` Alexander Skwar
2010-10-05 15:41 ` K. Richard Pixley
2010-10-05 15:55 ` Tapas Mishra
2010-10-05 15:56 ` Tapas Mishra
2010-10-05 14:40 ` Stuart D. Gathman
2010-10-05 6:24 ` Stuart D. Gathman
2010-10-05 7:30 ` Tapas Mishra
2010-10-05 14:25 ` Stuart D. Gathman [this message]
2010-10-05 15:53 ` Tapas Mishra
2010-10-05 6:33 ` Stuart D. Gathman
2010-10-04 20:03 ` Phillip Susi
2010-10-05 2:30 ` Tapas Mishra
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=Pine.LNX.4.64.1010051017001.29065@bmsred.bmsi.com \
--to=stuart@bmsi.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).