Operating System - HP-UX
1831618 Members
2063 Online
110027 Solutions
New Discussion

Re: extending /var and /opt file system

 
SOLVED
Go to solution
Vivek Shrivastava_1
Frequent Advisor

extending /var and /opt file system

Please find below few lines from my /etc/fstab files

/dev/vg00/lvol6 /opt vxfs delaylog 0 2
/dev/vg00/lvol7 /tmp vxfs delaylog 0 2
/dev/vg00/lvol8 /usr vxfs delaylog 0 2
/dev/vg00/lvol9 /var vxfs delaylog 0 2

I ma extending the the size of /var and /opt.

I know I have to do this in single user mode.

What would be the command to extend the logical volume and file system?

Or please verify the commands below are correct.

#shutdown

#umount /opt

#lvextend â L 1024 /dev/vg00/lvol6

#extendfx â F vxfs /dev/vg00/rlvol6

#mount /opt

#bdf

#restart

Please help me quickly.

T
18 REPLIES 18
Sridhar Bhaskarla
Honored Contributor

Re: extending /var and /opt file system

Hi,

1. Reboot the system and then get into single user mode. Interact with ISL at the boot admin prompt.

ISL>hpux -is

2. Once you are in single user mode use the commands

#mount /usr
#lvextend -L 2048 /dev/vg00/lvol6
#extendfs /dev/vg00/lvol6
#mount /opt
#bdf /opt

Repeat the above steps for /var. Once you are done,

#init 3

But if you have online JFS, you don't need to reboot the system. You can simply do

#lvextend -L 2048 /dev/vg00/lvol6
#fsadm -b 2048m /opt
#bdf /opt

The size you specify with lvextend is the total size of the logical volume you intend to see after the change.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
John Kittel
Trusted Contributor

Re: extending /var and /opt file system

... and to see if you have Online JFS

# swlist -l product |grep OnlineJFS
Joseph Loo
Honored Contributor

Re: extending /var and /opt file system

hi,

Follow what Sridhar has given u. He did not earn Olympian for nothing.

if u have online JFS, there will be no need to re-boot to single user mode.

i see that u have not assign any points before. so here is the pointer:

http://forums1.itrc.hp.com/service/forums/helptips.do?#28

therefore, please also assign points quickly....

regards.
what you do not see does not mean you should not believe
Vivek Shrivastava_1
Frequent Advisor

Re: extending /var and /opt file system

Sridhar,

i really appreciate your help.

i am little concerned about "extendfs" command.

if i don't use "-F" option then it take the default filesystem type from /etc/default/fs. please find below output of cat command on /etc/default/fs

# cat /etc/default/fs
LOCAL=hfs

so the type of the file system it is going to use is "hfs" but in /etc/fstab file it is specified as "vxfs" tye of file system.

what should i used?

one more quesion why i should not use "shutdown" command to go in single use mode?

please answer as soon as possible.

thanks

Vivek Shrivastava_1
Frequent Advisor

Re: extending /var and /opt file system

Loo,

i will assign the point for sure.

please help me

thanks
Mel Burslan
Honored Contributor

Re: extending /var and /opt file system

you can safely change /etc/default file from hfs to vxfs if most of your volumes are in vxfs. It is there as a guideline nothing written in stone.
If your filesystem is vxfs and you do not want to modify your defaults file, you must specify the -F vxfs option in your extendfs command.
________________________________
UNIX because I majored in cryptology...
Joseph Loo
Honored Contributor

Re: extending /var and /opt file system

okay.

here goes:

u may do a shutdown but most importantly, u must break the 10 seconds before u can proceed to single user mode via:

after breaking to PDC Menu --> bo pri

ISL> hpux -is

# mount /usr
# /usr/sbin/lvextend -L 1024 /dev/vg00/lvol6
# /usr/sbin/extendfs -F vxfs /dev/vg00/rlvol6
since the /etc/default/fs is hfs, unless u want to amend the file to vxfs
# lvdisplay /dev/vg00/lvol6
# mount /opt
# bdf
to check if the size is correct and do likewise for /var

regards.
what you do not see does not mean you should not believe
Vivek Shrivastava_1
Frequent Advisor

Re: extending /var and /opt file system

I am saying that my file system is of type "vxfs" only because the /etc/fsatb files says so.

is there any other way i can find out what is the type of filesystem?

I DON"T HAVE ONLINE JFS FOR SURE.

please help me.

thanks
Vivek Shrivastava_1
Frequent Advisor

Re: extending /var and /opt file system

Loo,

What do u mean by following?

"u must break the 10 seconds before u can proceed to single user mode via:"

i am confuse because if i run the command "shutdown" what it does it brings the system into single user mode unless i am wrong.

why can't i just run "shutdown" command to bring it to single user mode and use "resart" command to go back in multi-user mode?

please answer!

thanks


Mel Burslan
Honored Contributor

Re: extending /var and /opt file system

run command
fsadm /var
(keep your defaults file as hfs)

if the filesystem type is not hfs (which it is not according to the fstab) it will come back complaining that it is not hfs filesystem

run command

fsadm -F vxfs /var

and you will get an output like :

nolargefiles

which tells you it is a vxfs filesystem.
________________________________
UNIX because I majored in cryptology...
Mel Burslan
Honored Contributor

Re: extending /var and /opt file system

to bring a system to single user, you can issue the command

init 0

but some not so well behaving applications do not stop and you can not really have a system in single use mode in the full sense.

to guarantee a REAL single user boot is to issue :

shutdown -ry 0

and wait for the system to reboot and when you see that hit any key in 10 seconds notice hitting something and preventing the system from autobooting to full OS. Then you need to follow the instructions above to extend your FSs
________________________________
UNIX because I majored in cryptology...
Joseph Loo
Honored Contributor

Re: extending /var and /opt file system

sorry, was busy answering other posts and the wireless network at my office is really slow.

Mel is right and his explanation is also correct.

so, have u done what u need to do to increase /var and /opt?

regards.
what you do not see does not mean you should not believe
Vivek Shrivastava_1
Frequent Advisor

Re: extending /var and /opt file system

Loo,

Please help me with instruction to go into single user mode properly. Or please verify the steps to go into single user mode belo



shutdown -ry 0

Hit the . key to beark into
T
PDC Menu --> bo pri

ISL> hpux â is


How would I go into multi user mode then?

What are yo trying to suggest by saying following

â so, have u done what u need to do to increase /var and /opt?â

please help
Joseph Loo
Honored Contributor
Solution

Re: extending /var and /opt file system

okay. u r still at the booting stage.

PDC Menu -> bo pri
Interact with ISL -> Choose Y

ISL> hpux -is
will boot u up to single user mode.

afterwhich do the lvextend steps.

# init 3
to boot to multi-user mode.

OR
# shutdown -ry 0
to force reboot and do not interrupt booting process this time. it will then proceed to multi-user mode.

regards.
what you do not see does not mean you should not believe
Joseph Loo
Honored Contributor

Re: extending /var and /opt file system

sorry, i just came back from breakfast. i had tosai and prata.

regards.
what you do not see does not mean you should not believe
Sridhar Bhaskarla
Honored Contributor

Re: extending /var and /opt file system

Vivek,

//i am little concerned about "extendfs" command.

if i don't use "-F" option then it take the default filesystem type from /etc/default/fs. please find below output of cat command on /etc/default/fs
//

I intentionally vomitted -F option because extendfs will determine what type of filesystem it was. This is already a vxfs filesystem and you are only extending it.

What you said is correct when you are "creating" the filesystem.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Mohanasundaram_1
Honored Contributor

Re: extending /var and /opt file system

Hi Folks,

Am I missing something here?

The extendfs man page says:

The command-line parameter special specifies the device special file
of either a logical volume or a disk partition. The special must be
un-mounted before extendfs can be run (see mount(1M)).

Whereas, Sridhar and others are suggesting to mount the filesystem before lvextend and extendfs. Is this correct?

I always umount filesystems and lvextend+extendfs and then mount them again.

Correct me if I am wrong.

Cheers,
Mohan.

(Joseph hope you enjoyed your Dosai and parata:))
Attitude, Not aptitude, determines your altitude
KapilRaj
Honored Contributor

Re: extending /var and /opt file system

they are not mounting /opt but /usr to get the lvm commands.

Kaps
Nothing is impossible