내용으로 건너뛰기
adminschool.net wiki
사용자 도구
로그인
사이트 도구
검색
도구
문서 보기
이전 판
역링크
최근 바뀜
미디어 관리자
사이트맵
로그인
>
최근 바뀜
미디어 관리자
사이트맵
추적:
•
msoffice
•
cygwin
os:debian:lvm:sample2
이 문서는 읽기 전용입니다. 원본을 볼 수는 있지만 바꿀 수는 없습니다. 문제가 있다고 생각하면 관리자에게 문의하세요.
====== LVM 설정예제 2 ====== ===== Demonstration ===== - Start by looking at our existing disks <code> cat /proc/scsi/ dmesg |grep sd </code> - Next, partition the new disks using fdisk <code> fdisk /dev/sdb </code> - p to Print the existing table (should be blank) - n to create a new partition - t to change partition system ID to 8e (Linux LVM) - w to write new table to disk - Repeat for /dev/sdc - Create the physical volumes <code> pvcreate /dev/sdb1 pvcreate /dev/sdc1 </code> - NOTE: You can create multiple PVs on a single disk, but it is not recommended. Show existing Physical Volumes <code> pvscan </code> - Show Volume Groups <code> vgscan (should return nothing) </code> - Create a Volume Group from the Physical Volumes <code> vgcreate opt_vg /dev/sdb1 /dev/sdc1 </code> - NOTE: You can specify PE size in vgcreate. Default is 4M. You'd use larger PE sizes for LVs greater than 256G. 65K PEs per LV. - Show Volume Groups <code> vgscan (now shows the VG we created) </code> - Display information about the VG <code> vgdisplay </code> - Create a Logical Volume within the VG <code> lvcreate -l num_of_extents -n opt_lv opt_vg lvcreate -L 100M -n opt_lv opt_vg lvcreate -L 100M -n opt_lv -i num_stripes opt_vg lvcreate -L 100M -n opt_lv opt_vg [PhysicalVolumePath] </code> - Display information about the LV <code> lvdisplay lvdisplay -m (Show maps. Compare striped vs un-striped) </code> - Create a mount point <code> mkdir /opt/foo1 mkdir /opt/striped </code> - Create a filesystem <code> mkfs.ext3 /dev/opt_vg/opt_lv mkfs.ext3 /dev/opt_vg/striped_lv </code> - Mount the filesystems <code> mount /dev/opt_vg/opt_lv df -h </code> ===== Growing a Filesystem ===== ==== Grow an EXT2/3 filesystem (with unmount) ==== - Unmount the FS <code> umount /mnt/lvm_filesystem </code> - Extend the LV <code> lvresize -l +50 /dev/opt_vg/opt_lv lvresize -L +200M /dev/opt_vg/opt_lv fsck the filesystem e2fsck -f /dev/opt_vg/opt_lv </code> - Resize the filesystem <code> resize2fs /dev/opt_vg/opt_lv </code> - Remount the filesystem <code> mount -t ext3 /dev/opt_vg/opt_lv /mnt/lvm_filesystem </code> ==== Grow an EXT2/3 filesystem (without unmount) ==== - Extend the LV <code> lvresize -l +50 /dev/opt_vg/opt_lv lvresize -L +200M /dev/opt_vg/opt_lv </code> - Grow the filesystem <code> ext2online /mnt/lvm_filesystem (using mount path) ext2online /dev/opt_vg/opt_lv (using device) </code> ==== Grow a ReiserFS filesystem ==== - Create a ReiserFS on /dev/opt_vg/striped_lv <code> mkreiserfs /dev/opt_vg/striped_lv </code> - Mount the FS <code> df -h lvresize -L +50M /dev/opt_vg/striped_lv resize_reiserfs -f /dev/opt_vg/striped_lv df -h </code> - Add a Physical Volume to a VG <code> vgextend vgname /path/to/PV </code>
os/debian/lvm/sample2.txt
· 마지막으로 수정됨: 2007/10/05 02:20 저자
starlits
문서 도구
문서 보기
이전 판
역링크
맨 위로