首页 > 应用开发 > IT综合 > extend root dir
how to extend root directory
红帽5 如何扩展根目录
[@more@]
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
5.8G 2.2G 3.4G 39% /
/dev/sda1 99M 11M 83M 12% /boot
tmpfs 474M 0 474M 0% /dev/shm
/dev/sdb1 7.9G 3.5G 4.1G 46% /u01
add a disk to linux as /dev/sdc, size 2g
# parted /dev/sdc
mklabel gpt
mkpart primary 1 2048
quit
# pvcreate /dev/sdc1
# pvscan
# vgscan
# vgextend VolGroup00 /dev/sdc1
# lvextend -L +1910M /dev/VolGroup00/LogVol00
Rounding up size to full physical extent 1.88 GB
Extending logical volume LogVol00 to 7.81 GB
Logical volume LogVol00 successfully resized
# lvdisplay /dev/VolGroup00/LogVol00
--- Logical volume ---
LV Name /dev/VolGroup00/LogVol00
VG Name VolGroup00
LV UUID I9g1hs-gfe4-6TEq-qkSq-BUeM-lCf9-GWR7zP
LV Write Access read/write
LV Status available
# open 1
LV Size 7.81 GB
Current LE 250
Segments 2
Allocation inherit
Read ahead sectors 0
Block device 253:0
# resize2fs /dev/mapper/VolGroup00-LogVol00 7810M
resize2fs 1.39 (29-May-2006)
Filesystem at /dev/mapper/VolGroup00-LogVol00 is mounted on /; on-line resizing required
Performing an on-line resize of /dev/mapper/VolGroup00-LogVol00 to 1999360 (4k) blocks.
The filesystem on /dev/mapper/VolGroup00-LogVol00 is now 1999360 blocks long.
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
7.4G 2.2G 5.0G 30% /
/dev/sda1 99M 11M 83M 12% /boot
tmpfs 474M 0 474M 0% /dev/shm
/dev/sdb1 7.9G 3.5G 4.1G 46% /u01
#
# uname -a
Linux node1 2.6.18-8.el5 #1 SMP Fri Jan 26 14:15:21 EST 2007 i686 i686 i386 GNU/Linux
# resize2fs /dev/mapper/VolGroup00-LogVol00 5800M
resize2fs 1.39 (29-May-2006)
Filesystem at /dev/mapper/VolGroup00-LogVol00 is mounted on /; on-line resizing required
On-line shrinking from 1998848 to 1484800 not supported.
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/271063/viewspace-1058002/ ,如需转载,请注明出处,否则将追究法律责任。