dd if=/dev/zero of=vdisk1 bs=1m count=1000
losetup -f vdisk1
root@simey:~/vdisks# losetup /dev/loop0 /dev/loop0: [1601]:8388744 (vdisk1) root@simey:~/vdisks# dd if=/dev/loop0 of=/dev/null bs=512 count=1 1+0 records in 1+0 records out 512 bytes (512 B) copied, 0.016822 seconds, 30.4 kB/s
lvm vgcreate VG_YOYO /dev/loop0 /dev/loop2
root@simey:~/vdisks# lvm vgscan Reading all physical volumes. This may take a while... Found volume group "VG_YOYO" using metadata type lvm2
root@simey:~/vdisks# lvm lvcreate -L 200M -n lv_kosmo VG_YOYO Logical volume "lv_kosmo" created root@simey:~/vdisks# lvm lvcreate -L 200M -n lv_kramer VG_YOYO Logical volume "lv_kramer" created
root@simey:~/vdisks# lvm lvscan ACTIVE '/dev/VG_YOYO/lv_kosmo' [200.00 MB] inherit ACTIVE '/dev/VG_YOYO/lv_kramer' [200.00 MB] inherit
root@simey:~/vdisks# mkfs.reiserfs /dev/VG_YOYO/lv_kosmo mkfs.reiserfs 3.6.19 (2003 www.namesys.com) [...delete...] root@simey:~/vdisks# mkdir /mnt/lv_kosmo root@simey:~/vdisks# mount /dev/VG_YOYO/lv_kosmo /mnt/lv_kosmo root@simey:~/vdisks# df /mnt/lv_kosmo Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/VG_YOYO-lv_kosmo 204788 32840 171948 17% /mnt/lv_kosmo
root@simey:~/vdisks# lvm lvextend -L +100M /dev/VG_YOYO/lv_kosmo Extending logical volume lv_kosmo to 300.00 MB Logical volume lv_kosmo successfully resized root@simey:~/vdisks# resize_reiserfs /dev/VG_YOYO/lv_kosmo resize_reiserfs 3.6.19 (2003 www.namesys.com) resize_reiserfs: On-line resizing finished successfully. root@simey:~/vdisks# df /mnt/lv_kosmo Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/VG_YOYO-lv_kosmo 307184 32840 274344 11% /mnt/lv_kosmo
root@simey:~/vdisks# lvm lvcreate -s -n lv_kosmo_old -L 100M /dev/VG_YOYO/lv_kosmo Logical volume "lv_kosmo_old" created root@simey:~/vdisks# lvm lvscan ACTIVE Original '/dev/VG_YOYO/lv_kosmo' [300.00 MB] inherit ACTIVE '/dev/VG_YOYO/lv_kramer' [200.00 MB] inherit ACTIVE Snapshot '/dev/VG_YOYO/lv_kosmo_old' [100.00 MB] inherit root@simey:~/vdisks# touch /mnt/lv_kosmo/empty1 root@simey:~/vdisks# ls /mnt/lv_kosmo* /mnt/lv_kosmo: empty1 junk1 junk2 /mnt/lv_kosmo_old: junk1 junk2
Sending I/O to a device for which we have a snapshot: