Operating System - HP-UX
1834869 Members
2533 Online
110070 Solutions
New Discussion

Re: extend /tmp without console and without online jfs..

 
someone_4
Honored Contributor

extend /tmp without console and without online jfs..

Hello
I was reading the forum and all of the posts to extend tmp say I have to go into single usermode wich I cant since this site is in LA and I dont have a lan console set up yet. And I do not have online jfs. I dont have either. But I was wondering if this would work.
fuser -cu /tmp
fuser -ck /tmp
umount /tmp
lvextend -L /dev/vg00/lvol5
extendfs /dev/vg00/rlvol5
mount /tmp
and I was thinking of rebooting the box just for good measure.

Thanks
Richard

9 REPLIES 9
Stefan Farrelly
Honored Contributor

Re: extend /tmp without console and without online jfs..

You cant modify /tmp while the system is up. Something will always be using it.

The easiest way to do it is;

1. create a new lvol to the size you need.
2. modify /etc/fstab to change /tmp from vg00/lvolX to the new lvol
3. reboot

Now /tmp is on your new larger lvol. Simple.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Ravi_8
Honored Contributor

Re: extend /tmp without console and without online jfs..

Hi Richard

you can modify /tmp and /home online, no need to get into single user mode.

#umount /tmp
#lvextend -L /dev/vg00/lvol4
#extendfs /dev/vg00/rlvol4
#mount /dev/vg00/lvol4 /tmp

should do
never give up
S.K. Chan
Honored Contributor

Re: extend /tmp without console and without online jfs..

That would work if you can umount /tmp in multi user mode. But this is rarely possible if you got users and processes running on it. The fuser command may not be able to list everything for you. If the above does not work ..try to reboot the server first and when it comes up log in directly as root and try to umount /tmp. You may get lucky. Otherwise you can go with Stefan's suggestion or another way is to write a startup script to extend lvol5 while the system is on it's way up after a reboot.
Steven E. Protter
Exalted Contributor

Re: extend /tmp without console and without online jfs..

I think the problem is when running in full network mode, there are processes latching on to the /tmp filesystem, making the umount hard to accomplish.

Two partially tested ideas for you.

init 2

Maybe then you'll be able to umount the thing so you can run extendfs

If / is big enough, with enough free space, you could try commenting the automatic mount of the fs out of /etc/fstab, booting the box, running extendfs and then manually mounting the /tmp filesystem once its extended.

These ideas have the risk of only being tried once by me last Friday(the first one).

They do however not require a console.

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
twang
Honored Contributor

Re: extend /tmp without console and without online jfs..

if you have online jfs you can online change /tmp size. if not you need to
1. boot to a single user mode
2. mount /usr ( for commands )
and change the size of the logical volume
of tmp.
3. extend the file system with extendfs

4. go up with init 4 or boot the system.

Jose Mosquera
Honored Contributor

Re: extend /tmp without console and without online jfs..

Hi,

Be careful with th processes that are using /tmp directory!

1.- fuser -ku /dev/vg00/lvol5;umount /tmp
2.- umount /tmp
3.- To extend the logical volume lvol5 to 4000 megabytes from its current size:
lvextend -L 4000 /dev/vg00/lvol5
4.- Determine your File System type with the following command:
fstyp /dev/vg00/lvol5
5.- Use the extendfs(1M) command to increase the filesystem capacity in proportion to the increase in the logical volume. Note that extendfs(1M) requires the use of the character device file.
For an HFS File System, use the command:
extendfs -F hfs /dev/vg00/rlvol5
For a VXFS File System, use the command:
extendfs -F vxfs /dev/vg00/rlvol5
6.- mount /dev/vg00/lvol5 /tmp


Rgds.
Bill Hassell
Honored Contributor

Re: extend /tmp without console and without online jfs..

It's really important to note that /tmp is a system, not user directory. /var/tmp is for users (and root droppings too). /tmp can have some pretty important processes using space (like vi) so you never want to kill processes automatically. Poorly written processes may also use /tmp (perhaps the reason you need to increase it?) and arbitrairly killing any process with file(s) open on /tmp is not healthy.

Creating another /tmp volume is a good choice. You create it and populate the new lvol with the old /tmp files, then umount the new /tmp. Now edit /etc/fstab and change the source device file for /tmp to the new /tmp and then reboot.


Bill Hassell, sysadmin
malay boy
Trusted Contributor

Re: extend /tmp without console and without online jfs..

Well,the site is far?.You can use a terminal server and install at the remote site.We have terminal server install in our remote site.Very helpful especially if you want to go to single user mode.

cost money but more control.

my 2 cents.

regards
mB

There are three person in my team-Me ,myself and I.
V.Tamilvanan
Honored Contributor

Re: extend /tmp without console and without online jfs..

Hi,
I got an idea to accomplish your requirement.
1.Comment the /tmp mount point in /etc/fstab of your system.
2. Add the following 2 lines at the end of start option on /sbin/init.d/localmount
rm -R /tmp
ln -s / /tmp
3. Reboot your server as usual. Now /tmp is not /dev/vg00/lvol5, this is a symbolic link to a free FS. Now u do #lvextend -L /dev/vg00/lvol5
#extendfs -F /dev/vg00/rlvol5

4. Uncomment the /tmp mount point in /etc/fstab.
5. Remove the already added 2 lines and Add the following 2 lines at the end of start option on /sbin/init.d/localmount
rm -R /tmp
mkdir /tmp

6.Reboot your server as usual. Now /tmp is actual /dev/vg00/lvol5 FS.
7. remove the 2 lines what u have added to /sbin/init.d/localmount.

--------
It is an idea . may be you can check it .
HTH