확장
# lvextend -L +100M /dev/vg_data/lv_data ( 볼륨을 확장할 device 이름)
# resize2fs /dev/vg_data/lv_data ( 온라인 상태에서 확장할 수 있는 명령어, RHEL 5 에서 사용가능)
# df -h 명령어로 확인해 보면 mount 된 볼륨이 확장된걸 확인할 수 있다.
2GB LV를 500MB 로 만드는 축소 LVM 예제
* 파일시스템 UMOUNT (필수)
[root@gfs1 ~]# e2fsck -f /dev/mapper/vggfs-lv_02
e2fsck 1.39 (29-May-2006)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/mapper/vggfs-lv_02: 11/262144 files (9.1% non-contiguous), 25406/524288 blocks
[root@gfs1 ~]#
[root@gfs1 ~]# resize2fs /dev/mapper/vggfs-lv_02 500M
resize2fs 1.39 (29-May-2006)
Resizing the filesystem on /dev/mapper/vggfs-lv_02 to 128000 (4k) blocks.
The filesystem on /dev/mapper/vggfs-lv_02 is now 128000 blocks long.
[root@gfs1 ~]# lvs
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
LogVol00 VolGroup00 -wi-ao 6.09G
LogVol01 VolGroup00 -wi-ao 5.97G
LogVol00 vg_gfstest -wi-a- 97.66G
lv_01 vggfs -wi-ao 724.00M
lv_02 vggfs -wi-a- 2.00G
e2fsck 1.39 (29-May-2006)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/mapper/vggfs-lv_02: 11/262144 files (9.1% non-contiguous), 25406/524288 blocks
[root@gfs1 ~]#
[root@gfs1 ~]# resize2fs /dev/mapper/vggfs-lv_02 500M
resize2fs 1.39 (29-May-2006)
Resizing the filesystem on /dev/mapper/vggfs-lv_02 to 128000 (4k) blocks.
The filesystem on /dev/mapper/vggfs-lv_02 is now 128000 blocks long.
[root@gfs1 ~]# lvs
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
LogVol00 VolGroup00 -wi-ao 6.09G
LogVol01 VolGroup00 -wi-ao 5.97G
LogVol00 vg_gfstest -wi-a- 97.66G
lv_01 vggfs -wi-ao 724.00M
lv_02 vggfs -wi-a- 2.00G
[root@gfs1 ~]# lvreduce -L -1.5G /dev/mapper/vggfs-lv_02
WARNING: Reducing active logical volume to 512.00 MB
THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce lv_02? [y/n]: y
Reducing logical volume lv_02 to 512.00 MB
Logical volume lv_02 successfully resized
[root@gfs1 ~]# mount /dev/mapper/vggfs-lv_02 /mnt
[root@gfs1 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
6.0G 3.2G 2.5G 58% /
/dev/sda5 99M 13M 81M 14% /boot
tmpfs 18G 0 18G 0% /dev/shm
/dev/mapper/vggfs-lv_01
492M 66M 402M 15% /mnt
/dev/mapper/vggfs-lv_02
492M 66M 402M 15% /mnt
[root@gfs1 ~]#
'[IT] Linux > Volume' 카테고리의 다른 글
LVM PV, VG, LV 생성 (0) | 2015.05.07 |
---|---|
super block (0) | 2015.05.07 |
LVM Stripe LV 생성 (0) | 2015.05.03 |