1837395 Members
3383 Online
110116 Solutions
New Discussion

Re: extending /usr

 
GREGORY JONES_3
Occasional Advisor

extending /usr

/usr is 99% i need to add space
i am running 11.00
i have hp online jfs :
B3928AA_APZ B.10.20 HP OnLineJFS (Advanced VxFS)

sam won't let me extend /usr says i must unmount it first. i tried fsadm but /usr is hfs and fsadm does not accept -b option with hfs filesystem.

i guess i need to update online jfs and/or boot to single user to add space.
8 REPLIES 8
Robert-Jan Goossens
Honored Contributor

Re: extending /usr

Hi Gregory,

Yes if your /usr filesystem is HFS your only option is to boot into single user mode and lvextend/extendfs /usr filesystem.

Best regards,
Robert-Jan
Sanjay Kumar Suri
Honored Contributor

Re: extending /usr

Yes, you have to umount the file system before carrying out extendfs followed by mount.

sks
A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
Nguyen Anh Tien
Honored Contributor

Re: extending /usr

There is only one way, You can extend in single mode.
Check these posts:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=619838

best regard,
tienna
HP is simple
Florian Heigl (new acc)
Honored Contributor

Re: extending /usr

I'll try to write down a efficient way for doing this.

# this approach needs enough free PE in vg00
lvreduce /usr to the original size
create a new lvol for /usr
lvcreate -l 1 /dev/vg00
lvextend -m 1 /dev/vg00/new_lv
lvextend -L new_size /dev/vg00/new_lv
newfs -Fvxfs /dev/vg00/rnew_lw
mkdir /mnt/usr
mkdir /mnt/old_usr
# You could go to init 1 now, but /usr is quite static
mount /dev/vg00/new_lv /mnt/usr || exit 1
cd /usr
find . -depth | cpio -pdm /mnt/usr
touch /mnt/usr/this_is_new
cp -p /etc/fstab /etc/fstab.before_usr
#prepare new fstab in vi, change /usr to new lv, and add entry for /mnt/old_usr
# shutdown -r +0
# interrupt boot process and boot to maintaince mode (this is not *neccessary* but healthy, You could also simply fstabs and reboot, but You'll lose time if something goes wrong, also one could boot to init S saving one reboot, but the same applies...)
hpux -lm #(that's "L")
# switch the fstab files
vgchange -a y vg00
mount /usr
#check if /usr/this_is_new exists ;)
umount /usr
reboot


#done
yesterday I stood at the edge. Today I'm one step ahead.
HGN
Honored Contributor

Re: extending /usr

Hi

To do this you need to go to single user mode and use the lvextend and then extenfs.Once you have done this you can boot in multiuser

Rgds

HGN
Ralf Seefeldt
Valued Contributor

Re: extending /usr

Hello Gregory,

having onlineJFS you should be able tu extend without unmounting. I do not rely on SAM, because I want to know, what is done. Are you sure, you use a vxfs and not hfs filesysten. I dom't know whether onlineJFS works with hfs. Be sure, there is enough space left in the vg and the lvol does not exceed any limit for size oe ohysical extends (PE).
Here are my notes for extending a lvol for HP-UX 10 and 11 and for installations, that are unpatched for at least 4 years:

lvol=???
vg=???
#get all PV name's like /dev/dsk/c0t0d0 #check if mirrord or striped:
lvdisplay -v /dev/${vg}/${lvol} | head -n 30
#if vgextend is necessary and it is a #clustersystem, it is a bit more complicated
#than below described

#get Free PE and PE Size (Mbytes):
pvdisplay /dev/dsk/c0t0d0
lvextend -l /dev/${vg}/${lvol}
fstyp /dev/${vg}/r${lvol}
#or
grep ${lvol} /etc/fstab
#If it is a clustersystem:
cmhaltpkg
vgchange -a e ${vg}
#with online_JFS Check for Patches #PHKL_18913.vxfs_s700 or #PHKL_18914.vxfs_s800 from AD 2001
#(HP-UX 10.x)
fsadm -F vxfs -b $NEWKB $MOUNTPOINT

#From here, it should be not relevant for you

#without online_JFS:
umount /${lvol}
#if umount fails, try the following:
#deactivate the cluster in
#/etc/rc.config.c/cmcluster, on all
#clustermembers if necessarry
cmhaltpkg dbpkg
reboot -q
vgchange -S n -c n ${vg}
vgchange -a y ${vg}
fsck -F vxfs -o full /dev/${vg}/r${lvol}
extendfs -F vxfs /dev/${vg}/r${lvol}
cmruncl
vgchange -S y -c y ${vg}
extendfs -F \
/dev ${vg}/r${lvol}

#If it is a clustersystem:
vgchange -a n ${vg}
#If it is a clustersystem:
cmrunkg -n
mount /${lvol}

Regards
Ralf
#Don't forget to extend the offline
#backupdisk's lvol too if there are some
Isralyn Manalac_1
Regular Advisor

Re: extending /usr

Hi Gregory,

You need to boot to single-user mode to extend /usr.

Regards,

Isralyn
Rory R Hammond
Trusted Contributor

Re: extending /usr

You don't have to do this in single user mode!
but you do need to reboot.

Create another logical Volume the size you want and mount it as /usr1
cd /usr;find . -print |cpio -pdmu /usr1;
vi /etc/fstab
change /usr -> /usr1 and /usr1->/usr
reboot;
You can then remove /usr1

Rory
This is faster requires less down time.
/
There are a 100 ways to do things and 97 of them are right