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博客 ” ,链接:http://blog.itpub.net/271063/viewspace-1058002/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/271063/viewspace-1058002/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值