The LVM by-product devices are not for general consumption, which leaves
dm-22 as the likely candidate for being the snapshot. (Which is also
supported by the udevmonitor output log -- attached.)
# mount /dev/dm-23 /mnt/test
mount: /dev/dm-23 already mounted or /mnt/test busy
# mount /dev/dm-24 /mnt/test
mount: /dev/dm-24 already mounted or /mnt/test busy
Just to be sure, change the "what-am-i.txt" file:
# mount /dev/dm-22 /mnt/test
# cat /mnt/test/what-am-i.txt
original
# echo "duplicate?" > /mnt/test/what-am-i.txt
# umount /mnt/test
Drop the "duplicate" snapshot:
# lvremove /dev/systemvg/duplicate
Do you really want to remove active logical volume "duplicate"? [y/n]: y
Logical volume "duplicate" successfully removed
Strangely, the source symlinks have returned:
# ls -la /dev/mapper | grep original
lrwxrwxrwx 1 root root 8 2007-05-27 10:07 systemvg-original -> ../dm-21
We verify that the original LV is unchanged:
# mount /dev/systemvg/original /mnt/test
# cat /mnt/test/what-am-i.txt
original
# umount /mnt/test
So, after "lvcreate -s" finishes, the problems are:
1) the source LV symlink has vanished
("systemvg-original" should still exist)
2) the target LV symlink isn't there
("systemvg-duplicate" should exist)
First, create a test LV to serve as the "original" LV
# lvcreate -L1G -n original systemvg original original -> /dev/mapper/ systemvg- original systemvg- original systemvg- original -> ../dm-21 original original /mnt/test what-am- i.txt
Logical volume "original" created
# ls -la /dev/systemvg/
lrwxrwxrwx 1 root root 29 2007-05-27 09:59 /dev/systemvg/
# ls -la /dev/mapper/
lrwxrwxrwx 1 root root 8 2007-05-27 09:59 /dev/mapper/
# mkfs.ext3 /dev/systemvg/
# mount /dev/systemvg/
# echo "original" > /mnt/test/
# umount /mnt/test
Now, create a snapshot named "duplicate" from the "original" LV
# lvcreate -s -L1G -n duplicate /dev/systemvg/ original duplicate duplicate -> /dev/mapper/ systemvg- duplicate duplicate- cow -> ../dm-24 original- real -> ../dm-23
Logical volume "duplicate" created
# ls -la /dev/systemvg/
lrwxrwxrwx 1 root root 30 2007-05-27 10:01 /dev/systemvg/
# ls -la /dev/mapper | grep duplicate
lrwxrwxrwx 1 root root 8 2007-05-27 10:01 systemvg-
# ls -la /dev/mapper | grep original
lrwxrwxrwx 1 root root 8 2007-05-27 10:01 systemvg-
At this point, things are very strange: neither the source nor the target
symlinks exist in /dev/mapper.
Checking on the newly create dm-* devices, we find:
# vol_id /dev/dm-21 | grep UUID= 341cab43- 9dc2-4c45- 97fd-5b9df09dd7 48 341cab43- 9dc2-4c45- 97fd-5b9df09dd7 48 341cab43- 9dc2-4c45- 97fd-5b9df09dd7 48
ID_FS_UUID=
# vol_id /dev/dm-22 | grep UUID=
ID_FS_UUID=
# vol_id /dev/dm-23 | grep UUID=
ID_FS_UUID=
# vol_id /dev/dm-24
/dev/dm-24: unknown volume type
So, as I understand it, the mapping is:
dm-21 -> systemvg-original duplicate" ) original- real (an LVM by-product) duplicate- cow (an LVM by-product)
dm-22 -> ??? (should be "systemvg-
dm-23 -> systemvg-
dm-24 -> systemvg-
The LVM by-product devices are not for general consumption, which leaves
dm-22 as the likely candidate for being the snapshot. (Which is also
supported by the udevmonitor output log -- attached.)
# mount /dev/dm-23 /mnt/test
mount: /dev/dm-23 already mounted or /mnt/test busy
# mount /dev/dm-24 /mnt/test
mount: /dev/dm-24 already mounted or /mnt/test busy
Just to be sure, change the "what-am-i.txt" file:
# mount /dev/dm-22 /mnt/test what-am- i.txt what-am- i.txt
# cat /mnt/test/
original
# echo "duplicate?" > /mnt/test/
# umount /mnt/test
Drop the "duplicate" snapshot:
# lvremove /dev/systemvg/ duplicate
Do you really want to remove active logical volume "duplicate"? [y/n]: y
Logical volume "duplicate" successfully removed
Strangely, the source symlinks have returned:
# ls -la /dev/mapper | grep original
lrwxrwxrwx 1 root root 8 2007-05-27 10:07 systemvg-original -> ../dm-21
We verify that the original LV is unchanged:
# mount /dev/systemvg/ original /mnt/test what-am- i.txt
# cat /mnt/test/
original
# umount /mnt/test
So, after "lvcreate -s" finishes, the problems are:
1) the source LV symlink has vanished original" should still exist) duplicate" should exist)
("systemvg-
2) the target LV symlink isn't there
("systemvg-