Skip to content

Latest commit

 

History

History
116 lines (100 loc) · 2.44 KB

02.md

File metadata and controls

116 lines (100 loc) · 2.44 KB

2 EXERCISE

26.9.2017

Disks (physical volumes | volume groups | logical volumes | thin volumes)

fallocate - preallocate space to a file

losetup   - set up and control loop devices

pvs       - Display information about physical volumes
pvcreate  - Initialize physical volume(s) for use by LVM
pvremove  - Remove LVM label(s) from physical volume(s)

vgs       - Display information about volume groups
vgcreate  - Create a volume group
vgremove  - Remove volume group(s)
vgextend  - Add physical volumes to a volume group

lvs       - Display information about logical volumes
lvcreate  - Create a logical volume
lvremove  - Remove logical volume(s) from the system

exercise #1

  1. Create a loopback device with 100MiB
fallocate -l 100MiB filename
losetup -f filename
  1. Create GPT on that device with 5 small partitions
$
  1. Copy MBR partition table (*)

    partitions 1,3,5 from GPT version should be visible MBR/GPT have to be supported mostly on dual/triple boot systems - it is not a preferred setup

$

exercise #2

  1. Create a physical volume on loopback device
fallocate -l 100M filename0
losetup -f filename0
pvcreate /dev/loop0
  1. Create a filesystem which fill 100% of LV
vgcreate vgA /dev/loop0
lvcreate --name lvA -l 100%FREE vgA
mkfs.ext4 /dev/vgA/lvA
  1. Do not unmount filesystem in next steps

  2. Create new physical volume

fallocate -l 100M filename1
losetup -f filename1
pvcreate /dev/loop1
  1. Extend volume group to use also this free space
vgextend vgA /dev/loop1
  1. Remove the first loopback device from systems
# CHECK IT ! Propably not correct.
losetup -d /dev/loop0

exercise #3

  1. Create 200MB thin pool
fallocate -l 250MiB filename0
losetup -f filename0
pvcreate /dev/loop0 
vgcreate vgA /dev/loop0
lvcreate -l 200MiB --thinpool tpA vgA
  1. How large filesystem it can handle?
Thin pool volume with chunk size 64.00 KiB can address at most 15.81 TiB of data.
  1. Remove all thin volumes
# ???
  1. Create 2x thin volumes per 100MB
lvcreate -L 100MB --thinpool tpA1 vgA
lvcreate -L 100MB --thinpool tpA2 vgA
  1. Create a snapshot of thin volume
#ERROR (
#	Using default stripesize 64.00 KiB.
#  	Please specify either size or extents with snapshots.
# )
lvcreate --name snapA1 --snapshot vgA/tpA1
  1. Create a snapshot of the snapshot
$
  1. Merge snapshot of snapshot to original thin volume
$