Operating System - HP-UX
1838219 Members
3344 Online
110125 Solutions
New Discussion

trying to extend logical drive onto a new disk.. for /tmp and /usr

 
Dale Sullens
Occasional Contributor

trying to extend logical drive onto a new disk.. for /tmp and /usr

Here is the error I get using sam:
"Logical volume is currently in use and could not be unmounted. The LV cannot be extended until the file system is able to be unmounted."

What do I need to do in order to "unmount" these 2 mount points so I can increase the size? I am totally New to the Unix world..Please be explicit in any advice, (ie Unix for dummies)Thanks. This message board is great!
11 REPLIES 11
Ken Hubnik_2
Honored Contributor

Re: trying to extend logical drive onto a new disk.. for /tmp and /usr

If you do not have onlineJFS than you have to boot to single user mode HPUX -is.
Robert-Jan Goossens
Honored Contributor

Re: trying to extend logical drive onto a new disk.. for /tmp and /usr

Hi,

You have to go to single user mode or maintenace mode

Since /var, /usr, /tmp (and sometimes /opt) are always in use by the operating system, they cannot be unmounted with the umount command. In order to extend these filesystems, the system must be in single user mode.

RESOLUTION
This example will show how to extend /usr to 400MB without Online JFS


Backup the filesystem before extending


Display disk information on the logical volume

lvdisplay -v /dev/vg00/lvol4 | more


Make sure this is enough Free PE's to increase this filesystem.
Make sure that allocation is NOT strict/contiguous.


Reboot the machine

shutdown -r now


When prompted, press "ESC" to interrupt the boot.


Boot from the primary device and invoke ISL interaction.

bo pri isl

NOTE: If prompted to interact with ISL, respond "y"


Boot into single user mode

hpux -is

NOTE:Nothing will be mounted.


Extend the logical volume that holds the filesystem.

/sbin/lvextend -L 400 /dev/vg00/lvol4


Extend the file system.

/sbin/extendfs -F hfs /dev/vg00/rlvol4

NOTE: The use of the character device.


Ensure the filesystem now reports to be the new size

bdf


Reboot the system to its normal running state.

shutdown -r now


Robert-Jan.
Ian Dennison_1
Honored Contributor

Re: trying to extend logical drive onto a new disk.. for /tmp and /usr

O, both /usr and /tmp are used by the programs in the Operating System when it runs

eg. /usr/sbin contains a lot of "extrinsic" (not built into the shell) commands that you need

/tmp is where a lot of temporary files are created while programs work

eg. unzip or uncompress.

What you will need to do is either

a) Use online JFS to extend these (and I am not sure that it will work for /usr)

b) Reboot into single user mode, and extend the file systems at that level. This can be dangerous if you do not know what you are doing, you have total control of the system and can do a lot of damage.

Shall we post some links for instructions for single user mode?

Share and Enjoy! Ian
Building a dumber user
Steven E. Protter
Exalted Contributor

Re: trying to extend logical drive onto a new disk.. for /tmp and /usr

lvdisplay /dev/vg00/lvol6 this is usually /tmp run bdf to confirm.

You will notice a line about allocation:strict

You can not have /tmp span multiple disks. It needs to be on one disk.

In your current situation, there is another answer.

make_tape_recovery

Just vg00, make a nice tape. Make two for safety.

Boot the box

interupt at the 10 second prompt.

sea

You will see a sequential(tape device)

bo p3

N Do not interact with the isl

Watch carefully.

There will be a prompt after the kernel loads for manual intervention. Hit a key at the console to go for it.

You will then be in a screen that looks like the standard intall screen.

From there you can within limits rebuild your system filesystem sizes right there.

This is not fun and it takes a few hours, so get it right. Give /tmp some breathing room, make /var much bigger than you need so you never have to do this again.

I've done it on my rp5450 server and it worked out rather well.

If you need some support during the process that can be arranged.

Good Luck.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
A. Clay Stephenson
Acclaimed Contributor

Re: trying to extend logical drive onto a new disk.. for /tmp and /usr

You really should post this to your other thread> If appears that you do not have OnlineJFS (and didn't bother to respond to that question):

Shutdown and boot the machine. Interrupt the boot by pressing return when you see the console messages.

BOOT PRI
Interact with ISL? (or IPL?) Y
hpux -is

This will bring you up in single user mode with only / mounted. All the commands you need will be in /sbin.

If it ain't broke, I can fix that.
Michael Elleby III_1
Trusted Contributor

Re: trying to extend logical drive onto a new disk.. for /tmp and /usr

The reason why you are having these issues, is because you have a specific user (root) with files open on these filesystems.

Execute this command and you'll see:

1. fuser -u /usr
2. fuser -u /tmp

The user using files will be in parentheses (root).

The best thing to do in your case (since you are a newbie) is to execute these commands logged in as root to bring down the server to single user mode:

1. shutdown -r -y 0
2. You'll need to watch the console, and when the machine gives you the message to interrupt the boot process, press the space bar
3. At the menu, type 'bo pri' and press ENTER
4. You'll receive a question about interacting with ISL, type in a Y and press ENTER
5. When you get to the # prompt, execute your lvextend and extendfs commands to extend your filesystems
6. When you are done, reboot the machine and when it comes up, you should be all done.

Mike-
Knowledge Is Power
Kenneth_19
Trusted Contributor

Re: trying to extend logical drive onto a new disk.. for /tmp and /usr

OnlineJFS is an option utility on HP-UX which needs a seperate license. To see if you have OnlineJFS installed, run:

# swlist | grep OnlineJFS

If you have OnlineJFS installed, you can resize the LV with:

# lvextend -L

Then you can extend the filesystem with:

# fsadm -b

Kenneth
Always take care of your dearest before it is too late
Enrico P.
Honored Contributor

Re: trying to extend logical drive onto a new disk.. for /tmp and /usr

Hi,
if you have OnlineJFS installed:
check with bdf command the lvol associate to file system.

lvextend -L /dev/vg00/lvolX

fsadm -Fvxfs -b /usr

Enrico.
twang
Honored Contributor

Re: trying to extend logical drive onto a new disk.. for /tmp and /usr

if you have online jfs you can online extend /usr and /tmp size. otherwise, you need to boot to single user mode, and add new disk to vg, then extend lv (/tmp, /usr):
1. boot to a single user mode
ISL > hpux -is

2. create new pv and add it to vg:
# pvcreate -B /dev/rdsk/c2t2d0
# vgextend /dev/vg00 /dev/dsk/c2t2d0

3. change the size of the logical volume of /tmp and /usr.
# lvextend -L /dev/vg00/lvol4
4. extend the file system with extendfs
# extendfs /dev/vg00/rlvol4
# mount /dev/vg00/lvol4 /tmp
5. boot the system.
Tim Sanko
Trusted Contributor

Re: trying to extend logical drive onto a new disk.. for /tmp and /usr

First of all We all are "Dummies". Just some of us less than others...

To prevent permanent damage get Ignite from software.hp.com. Ignite your box.

Since you are a real beginner, get Ignite/UX from hp.software.com and if you have a tape drive you are 75% of the way home.

make an Ignite tape.
"make_recovery -Av" is the best way for you.

Then after shutting down safely you can reboot, and with that ignite tape re-configure HP/UX.when the boot sequence gets to the hit a key to interrupt the automatic boot process hit a key.

type in the command SEA.

You will then get to see a list that looks something like this
P0 sequential media
P1 random access (this means disk)
P2 sdafasdfsadfsdaf

You will then hit a key to break out of the search and look for a non-random device, or a sequential device. (that should be your tape drive.)

boot P0

The sequence will ask you about interracting with the IPL choose no or ignore it.

Wait for the WINSTALL message. That tells you you got the right device.

Later there is an option to automatically install hit a key to interrupt it here.

When is queries if you really want to do this respond Yes.

You will then have a group of options:

Pick Install HP/UX.

Then pick the advanced and modify the file systems. You can adjust filesystems and then
navigate through the product. Here is a big hint select the filesystem to enlarge, change the size, and then tab to the modify button.
It is the way it works. You can also add drives to vg00 etc.

The real reason is this is not necessary, but it is the SAFEST way. You can really mess up the root drive and just boot from the tape and you are back where you started when you made the tape. Get in a habit of doing this before you make system changes and you'll end up with a lot less grey hair than I have.

Happy Igniting.

Tim


S.K. Chan
Honored Contributor

Re: trying to extend logical drive onto a new disk.. for /tmp and /usr

I'm assuming you do not have ONlineJFS. You have to do this in single-user mode. First of all extend your vg00 (ie adding the new disk to it). Say your new disk is c1t1d0.
# pvcreate /dev/rdsk/c1t1d0
==> You may need "-f" option if c1t1d0 has been previous used.
# vgextend vg00 /dev/dsk/c1t1d0
# vgdisplay -v vg00
==> Check to make sure it's in.
Next you need to check the lvols for /tmp (say lvol3) and /usr (say lvol4) are setup as strict/contiguous or not. If they are you need to change that to just strict. If you don't do this you can't extend your LV. Do this ..
# lvdisplay /dev/vg00/lvol3|grep Allocation
==> Repeat for lvol4. If they shows "strict" you don;t have to do anything. If they show "strict/contigous" you have to run this ..
# lvchange -C n /dev/vg00/lvol3
==> Repeat for lvol4. This will set them to "non-contigous".
Now shutdown your system and on its way up interrupt the bootup and boot in LVM maintenance mode.
Main Menu: Enter Command > bo pri isl
Enter "y" to interact with IPL.

ISL> hpux -lm (;0)/stand/vmunix

You'll eventually get the # prompt and in LVM maintenance mode.
# /sbin/vgchange -a y vg00
==> Activate vg00.
# /sbin/lvextend -L 2000 /dev/vg00/lvol3
==> Extending (/tmp - lvol3) to 2GB.
# /sbin/lvextend -L 2400 /dev/vg00/lvol4
==> Extending (/usr - lvol4) to 2.4GB
# /sbin/extendfs -F vxfs /dev/vg00/rlvol3
==> Repeat for lvol4.
# /sbin/mount -a
# bdf
==> Check to see if FS size have been increased.
Finally just reboot the machine.