I can create a lvm volume group with a loop device. But if I use dmsetup to map the loop device into several devices, then I can't create a lvm group with /dev/dm-. Why is it not possible to create group with dm-?
-
It's possible, even normal (LUKS encrypted devices are dm- as well, and LVM on LUKS is entirely ordinary). You should state in your question which commands you were using and which errors you were getting.frostschutz– frostschutz2013-07-28 10:17:29 +00:00Commented Jul 28, 2013 at 10:17
Add a comment
|
1 Answer
Works for me:
# truncate -s10G a
# losetup /dev/loop1 ./a
# echo 0 $(blockdev --getsize /dev/loop1) linear /dev/loop1 0 | dmsetup create test
# pvcreate /dev/mapper/test
Writing physical volume data to disk "/dev/mapper/test"
Physical volume "/dev/mapper/test" successfully created
# vgcreate test /dev/mapper/test
Volume group "test" successfully created
# lvcreate -n test -L1G test
Logical volume "test" created
# dmsetup table test test-test
test: 0 20971520 linear 7:32 0
test-test: 0 2097152 linear 253:21 2048
# ls -l /dev/mapper/test /dev/mapper/test-test
lrwxrwxrwx 1 root root 8 Jul 24 14:05 /dev/mapper/test -> ../dm-21
lrwxrwxrwx 1 root root 8 Jul 24 14:05 /dev/mapper/test-test -> ../dm-22