close
(2) Creating Logical Volumes

1. fdisk /dev/sdb (Partition Type: 8e)
2. pvcreate /dev/sdb2
3. vgcreate vg0 /dev/sdb2
4. lvcreate -L 100M -n data vg0
5. mkfs.ext3 /dev/vg0/data

%check
#pvs
report information about physical volumes
#vgs
report information about volume groups
#lvs
report information about logical volumes

%Resizing Logical Volumes

#lvextend -L +50M /dev/vg0/data
#resize2fs -p /dev/vg0/data

%Reduce size (危險, 記得先備份資料)
#umount /data
#e2fsck -f /dev/vg0/data
#resize2fs /dev/vg0/data 80M
#lvreduce -L 80M /dev/vg0/data
#mount /dev/vg0/data /data

%remove
#pvremove
remove a physical volume
#vgremove
remove a volume group
#lvremove
remove a logical volume

(3)Using LVM snapshots

1.create snapshot of existing logical volume
#lvcreate -l 64 -s -n datasnap /dev/vg0/data
-l: extend
64: 64*4MB
-s: snapshots

2.mount snapshot
#mkdir -p /mnt/datasnap
#mount -o ro /dev/vg0/datasnap /mnt/datasnap

3.remove snapshot
#umount /mnt/datasnap
#lvremove /dev/vg0/datasnap
arrow
arrow
    全站熱搜

    aquatower 發表在 痞客邦 留言(0) 人氣()