下面的操作只是一个测试,用来使用lvm扩展我 rx8640 服务器上的 /usr空间:
1、用bdf查看/usr的空间使用情况及挂载情况:
[root@hpux01 ~]# bdf
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 1048576 163704 878016 16% /
/dev/vg00/lvol1 1835008 158384 1663632 9% /stand
/dev/vg00/lvol8 39714816 10439976 29046208 26% /var
/dev/vg00/lvol7 3997696 1573688 2405136 40% /usr
/dev/vg00/lvol4 524288 21208 499152 4% /tmp
/dev/vg00/lvol6 3670016 1660760 1993584 45% /opt
/dev/vg00/lvol5 131072 5880 124216 5% /home
2、因为没有安装onlineJFS包(这个包是收费的),所以只能进单用户来umount旧/usr分区来做扩展操作了。
[root@hpux01 /]# swlist -l product | grep -i OnlineJFS
3、查看/usr的挂载的逻辑卷lvol7的信息:
[root@hpux01 /]# lvdisplay /dev/vg00/lvol7
— Logical volumes —
LV Name /dev/vg00/lvol7
VG Name /dev/vg00
LV Permission read/write
LV Status available/syncd
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 3904
Current LE 61
Allocated PE 122
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation strict
IO Timeout (Seconds) default
61个LE,122个PE,我做了LVM镜像。
4、重启服务器
[root@hpux01 /]# shutdown -ry 0
5、在MP中进入单用户模式:
在系统启动时,在等待10秒时,按空格,中断EFI 的autoboot.选择EFI shell,输入fs0: (看磁盘情况)–输入 hpux – 按空格中断hpux的自动引导 – 输入 boot -is vmunix (另:在进入单用户模式所,mount -a一下,就可以用passwd命令改root密码了 :)
6、用mount命令查看分区挂载情况,只有/分区挂在上面了。
mount
/ on /dev/vg00/lvol3 ioerror=nodisable,log,dev=40000003 on Fri Dec 31 14:56:06 2010
/stand on /dev/vg00/lvol1 ioerror=mwdisable,log,nodatainlog,tranflush,dev=40000001 on Fri Dec 31 14:56:08 2010
7、用lvextend命令扩展/usr的逻辑卷lvol7
lvextend -L 8000 /dev/vg00/lvol7
8、用lvdisplay查看扩展是否成功
lvdisplay -v /dev/vg00/lvol7
— Logical volumes —
LV Name /dev/vg00/lvol7
VG Name /dev/vg00
LV Permission read/write
LV Status available/syncd
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 8000
Current LE 125
Allocated PE 250
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation strict
IO Timeout (Seconds) default
— Distribution of logical volume —
PV Name LE on PV PE on PV
/dev/disk/disk3_p2 125 125
/dev/disk/disk5_p2 125 125
扩展后,125个LE,250个PE
9、用extendfs扩展文件系统
extendfs /dev/vg00/rlvol7
10、重启系统,用bdf查看文件系统挂载后是否成功
[root@hpux01 ~]# bdf
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 1048576 163688 878032 16% /
/dev/vg00/lvol1 1835008 158384 1663632 9% /stand
/dev/vg00/lvol8 39714816 10440168 29046016 26% /var
/dev/vg00/lvol7 8192000 1573824 6566536 19% /usr
/dev/vg00/lvol4 524288 21208 499152 4% /tmp
/dev/vg00/lvol6 3670016 1660760 1993584 45% /opt
/dev/vg00/lvol5 131072 5880 124216 5% /home
成功 :)