This page looks plain and unstyled because you're using a non-standard compliant browser. To see it in its best form, please upgrade to a browser that supports web standards. It's free and painless.

修性不修命,萬劫陰靈難入聖; 修命不修性,猶有家財無主柄
Album | Blog | Comment | Profile | Control Panel
aquatower | 4 August,2009 0:05
Bookmark: HemiDemi MyShare Baidu Google Bookmarks Yahoo! My Web Del.icio.us Digg technorati furl Bookmark to:YouPush Bookmark to:你推我報

(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


Comment

Trackback

Comment Permissions: Only members may comment. If you are not a PIXNET member, click here to sign up.