1847076 Members
5556 Online
110262 Solutions
New Discussion

Recreate /tmp

 
SOLVED
Go to solution
Patrick Chim
Trusted Contributor

Recreate /tmp

Hi all,

My server running HP-UX 11.0 with 2 internal disks for vg00. The former system admin has created the /tmp over the 2 disk (104 PE on 1 disk and 21 PE on the other) and now I decide to recreate it in a single LV and have 1 mirror copy on the other disk. Is it true that I can only do this in single user mode ? If so, can I still call the lvcreate command as it is located in /usr/sbin ? Does /usr mount on single user mode then ?


Regards,
Patrick
8 REPLIES 8
Santosh Nair_1
Honored Contributor
Solution

Re: Recreate /tmp

Patrick,

If you have enough space on the first disk, you can try doing a pvmove to move all the extents to one disk and lvextend -m 1 to mirror it to the other disk. (Just curious why you'd want to mirror /tmp though since its usually not considered a critical filesystem).

If this approach doesn't work then yes, you'd have to do this in single user mode as far too many program have a dependancy on /tmp and it would be impossible to umount /tmp while in multiuser. Also, all the lv/vg/pv commands are in /sbin in addition to /usr/sbin (the one in /sbin being statically linked and therefore not dependant on libc.sl).

-Santosh
Life is what's happening while you're busy making other plans
Robin Wakefield
Honored Contributor

Re: Recreate /tmp

Hi Patrick,

I'd check to see what IS using /tmp by running:

fuser -c /tmp

and check what these processes are. If they can be killed without disruption to running applications, you should be able to unmount /tmp. As long as you have enough space in your root filesystem (where /tmp will now be written to, once unmounted), you should be able to re-create your filesystems as necessary and then remount /tmp at the end. Remember to fix /etc/fstab if required. It really all depends on how /tmp is being used by your apps.

Rgds, Robin.
Animesh Chakraborty
Honored Contributor

Re: Recreate /tmp

Hi,
It depends on how you want to go to in single user mode.
ISL> hpux -lm (booting with no LVM)
ISL> hpux -is (single user)
# init s
then mount /usr if required manually

Thanks
Animesh


Did you take a backup?
Robin Wakefield
Honored Contributor

Re: Recreate /tmp

Hi Patrick,

You can also check out the following thread:

http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0x1896663ce855d511abcd0090277a778c,00.html

Rgds, Robin.
Santosh Nair_1
Honored Contributor

Re: Recreate /tmp

Have to be careful about relying solely on fuser. For example, I just a fuser -cu /tmp and it returned nothing. But I wasn't able to umount /tmp because it says Device busy.

The reason it says this is because there are sockets in /tmp created by some daemon. fuser does NOT pick up on sockets...had to use lsof to figure this out.

Just an FYI.

-Santosh
Life is what's happening while you're busy making other plans
Patrick Chim
Trusted Contributor

Re: Recreate /tmp

Hi,

There are 2 lvcreate in the system. One in /usr/sbin and the other one in /sbin. They have different sizes also. What is the difference between them ?

Patrick
Santosh Nair_1
Honored Contributor

Re: Recreate /tmp

As i mentioned in my previous posting, the executables in /sbin are statically linked so they have not dependancy on /usr/lib/libc.sl. Whereas the ones in /usr/sbin are dynamically linked against /usr/lib/libc.sl.

You would need to use the static binaries in single user mode as /usr is not mounted and so /usr/lib and /usr/lib/libc.sl is not available.

-Santosh
Life is what's happening while you're busy making other plans
Robin Wakefield
Honored Contributor

Re: Recreate /tmp

Hi Patrick,

Santosh is correct. You could also look for sockets explictly with

find /tmp -type s

or non-files/dirs/links with:

find /tmp ! -type f ! -type d ! -type l

For instance, sockets of the form:

/tmp/.AgentSockets/*

are created by snmpdm. If this were the only socket found, you could stop with:

/sbin/init.d/SnmpMaster stop

then umount /tmp. Of course, this may not apply in your case.

Rgds, Robin.