* [linux-lvm] pvcreate on a loopback device - error: (newbie)
@ 2006-09-20 11:27 John Que
2006-09-20 12:24 ` Markus Laire
0 siblings, 1 reply; 2+ messages in thread
From: John Que @ 2006-09-20 11:27 UTC (permalink / raw)
To: linux-lvm
Hello,
I had tried to do some test with LVM on a loopback device
follwing some tutorials on the web.
I get errors.
what I do is this:
dd if=/dev/zero of=/work/tmp/disk-image count=10240
mke2fs /work/tmp/disk-image
mount -o loop /work/tmp/disk-image /work/loop/ 78 14:23
pvcreate /dev/loop1
error:
Failed to wipe new metadata area
/dev/loop1: Format-specific setup of physical volume failed. Failed
to setup physical volume "/dev/loop1"
what did I do wrong ?
Regards,
John
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [linux-lvm] pvcreate on a loopback device - error: (newbie)
2006-09-20 11:27 [linux-lvm] pvcreate on a loopback device - error: (newbie) John Que
@ 2006-09-20 12:24 ` Markus Laire
0 siblings, 0 replies; 2+ messages in thread
From: Markus Laire @ 2006-09-20 12:24 UTC (permalink / raw)
To: LVM general discussion and development
On 9/20/06, John Que <qwejohn@gmail.com> wrote:
> Hello,
>
> I had tried to do some test with LVM on a loopback device
> follwing some tutorials on the web.
>
> I get errors.
> what I do is this:
>
> dd if=/dev/zero of=/work/tmp/disk-image count=10240
> mke2fs /work/tmp/disk-image
> mount -o loop /work/tmp/disk-image /work/loop/ 78 14:23
>
> pvcreate /dev/loop1
>
> error:
> Failed to wipe new metadata area
> /dev/loop1: Format-specific setup of physical volume failed. Failed
> to setup physical volume "/dev/loop1"
>
>
> what did I do wrong ?
If you want to use LVM on a loopback device, you don't create a
filesystem on it first.
You need to do something like
# Create new empty disk-image
dd if=/dev/zero of=disk-image count=10240
# set up a loop-device for it
losetup /dev/loop2 disk-image
# initialize that loop-device for LVM
pvcreate /dev/loop2
# Create a VG on it
vgcreate Test /dev/loop2
Now you can create Logical Volumes on that VG, e.g.:
# Create a logical volume
lvcreate --size 4M --name MyLV Test
# Create a filesystem on it
mke2fs /dev/Test/MyLV
# mount the filesystem
mkdir MyLV
mount /dev/Test/MyLV MyLV
And if you want to remove everything...
umount MyLV
rmdir MyLV
lvremove /dev/Test/MyLV
vgremove Test
losetup -d /dev/loop2
rm disk-image
--
Markus Laire
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-09-20 12:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-20 11:27 [linux-lvm] pvcreate on a loopback device - error: (newbie) John Que
2006-09-20 12:24 ` Markus Laire
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).