在安裝系統(tǒng)時(shí)LVM的大小沒(méi)有設(shè)定好,還好可以在線收縮和擴(kuò)展。 1,看下各邏輯卷大小 [root@bogon ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00 39G 461M 37G 2% / /dev/mapper/VolGroup00-LogVol03 64G 222M 61G 1% /var /dev/mapper/VolGroup00-LogVol02 49G 2.0G 45G 5% /usr /dev/mapper/VolGroup00-LogVol01 39G 177M 37G 1% /home /dev/sda1 99M 13M 82M 14% /boot tmpfs 1005M 0 1005M 0% /dev/shm /dev/hdc 3.5G 3.5G 0 100% /media 2,看到home下有l(wèi)ost+found可見home分區(qū)單獨(dú)掛載在一個(gè)分區(qū)下 [root@bogon ~]# ls /home/ innofidei lost+found 3,卸載并驗(yàn)證 [root@bogon ~]# umount /dev/mapper/VolGroup00-LogVol01 [root@bogon ~]# ls /home/ 4,resize2fs 卷組先 [root@bogon ~]# resize2fs /dev/mapper/VolGroup00-LogVol01 20G resize2fs 1.39 (29-May-2006) Resizing the filesystem on /dev/mapper/VolGroup00-LogVol01 to 5242880 (4k) blocks. The filesystem on /dev/mapper/VolGroup00-LogVol01 is now 5242880 blocks long.
注意這里會(huì)提醒你e2fsck的 所以resize2fs之前要這樣做: e2fsck -f /dev/mapper/VolGroup-logVol01
5,減小lvm [root@bogon ~]# lvreduce -L 20G /dev/mapper/VolGroup00-LogVol01 /dev/hdc: open failed: Read-only file system WARNING: Reducing active logical volume to 20.00 GB THIS MAY DESTROY YOUR DATA (filesystem etc.) Do you really want to reduce LogVol01? [y/n]: y Reducing logical volume LogVol01 to 20.00 GB Logical volume LogVol01 successfully resized 6,重新掛載并驗(yàn)證 [root@bogon ~]# mount -a [root@bogon ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00 39G 461M 37G 2% / /dev/mapper/VolGroup00-LogVol03 64G 222M 61G 1% /var /dev/mapper/VolGroup00-LogVol02 49G 2.0G 45G 5% /usr /dev/sda1 99M 13M 82M 14% /boot tmpfs 1005M 0 1005M 0% /dev/shm /dev/hdc 3.5G 3.5G 0 100% /media /dev/mapper/VolGroup00-LogVol01 20G 173M 19G 1% /home [root@bogon ~]# ls /home/ innofidei lost+found 7,擴(kuò)展另一lvm [root@bogon ~]# lvextend -L +20G /dev/mapper/VolGroup00-LogVol02 /dev/hdc: open failed: Read-only file system Extending logical volume LogVol02 to 70.00 GB Logical volume LogVol02 successfully resized [root@bogon ~]# resize2fs /dev/mapper/VolGroup00-LogVol02 resize2fs 1.39 (29-May-2006) Filesystem at /dev/mapper/VolGroup00-LogVol02 is mounted on /usr; on-line resizing required Performing an on-line resize of /dev/mapper/VolGroup00-LogVol02 to 18350080 (4k) blocks. The filesystem on /dev/mapper/VolGroup00-LogVol02 is now 18350080 blocks long. 8,再驗(yàn)證 [root@bogon ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00 39G 461M 37G 2% / /dev/mapper/VolGroup00-LogVol03 64G 222M 61G 1% /var /dev/mapper/VolGroup00-LogVol02 68G 2.0G 63G 4% /usr /dev/sda1 99M 13M 82M 14% /boot tmpfs 1005M 0 1005M 0% /dev/shm /dev/hdc 3.5G 3.5G 0 100% /media /dev/mapper/VolGroup00-LogVol01 20G 173M 19G 1% /home
聯(lián)系客服