ext3 online resizing: use different name for VG + LV
authorMichael Prokop <mika@grml.org>
Thu, 27 Mar 2014 11:02:58 +0000 (12:02 +0100)
committerMichael Prokop <mika@grml.org>
Thu, 27 Mar 2014 11:03:09 +0000 (12:03 +0100)
Using "resize-me" for VG *and* LV at the same time is confusing
when reading the command line, make it more explicit which one
corresponds to what by using different names.

grml_tips

index 25d448c..5fa27d1 100644 (file)
--- a/grml_tips
+++ b/grml_tips
@@ -1900,13 +1900,13 @@ Demo:
 
 cfdisk /dev/hda                           # create a partition with type 8e (lvm)
 pvcreate /dev/hda2                        # create a physical volume
-vgcreate resize_me /dev/hda2              # create volume group
-lvcreate -n resize_me -L100 resize_me     # create a logical volume
-mkfs.ext3 /dev/resize_me/resize_me        # now create a new filesystem
-mount /dev/resize_me/resize_me /mnt/test  # mount the new fs for demonstrating online resizing
+vgcreate vg0 /dev/hda2                    # create volume group
+lvcreate -n resize_me -L1G vg0            # create a logical volume
+mkfs.ext3 /dev/mapper/vg0-resize_me       # now create a new filesystem
+mount /dev/mapper/vg0-resize_me /mnt/test # mount the new fs for demonstrating online resizing
 df -h                                     # check the size of the partition
-lvextend -L+100M /dev/resize_me/resize_me # let's extend the logical volume
-resize2fs /dev/resize_me/resize_me        # and finally resize the filesystem
+lvextend -L+2G /dev/mapper/vg0-resize_me  # let's extend the logical volume
+resize2fs -p /dev/mapper/vg0-resize_me    # and finally resize the filesystem
 df -h                                     # recheck the size of the partition
 
 This also works for Software-RAID. Demo: