Operating System - HP-UX
1833755 Members
2399 Online
110063 Solutions
New Discussion

Re: Extending root fileystem

 
Kavita Poonia
Regular Advisor

Extending root fileystem

Hello folks,

I need to extend / filesystem by 100 MB on one of our HP-UX server having version 11.00.

The logical volume for it is /dev/vg00/lvol3 and it is mirrored. I have 1 GB free space in vg00.

I need proper commands to be executed for this as / filesystem is contiguous so we cannot just run lvextend and fsadm.

Thanks a lot for the help!
5 REPLIES 5
Steven E. Protter
Exalted Contributor

Re: Extending root fileystem

Shalom,

You can't extend root per say because it must be contiguous.

What you can do is one of the following:
relocate the logical volume next to root on the disk (see pvdisplay) and then attempt to extend. I don't recall if this is supported, but it would be hard in any event.

Or:
Make a make_tape_recovery or make_net_recovery with ignite, restore the system but intervene to change the filesystem size on root to a larger number.

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
Bill Hassell
Honored Contributor

Re: Extending root fileystem

And the third choice is not to extend the / filesystem at all. The / filesystem should never grow since it really only contains /etc and /sbin. Root's home is also there and this often leads to a lot of junk files that need removing. /dev is also part of / but it is very small. Run this command:

# du -kx / | sort -rn | head

/etc and /sbin should be about 30MB. And /dev should be a few KB:

# du -kx /dev | sort -rn | head

Now if /dev is several MB, there is a bad file or files in /dev. Find them with:

find /dev -type f -exec ll {} \;

Then remove them -- no regular files in /dev.

Now the one exception for /etc staying about 30MB is for systems that have very large disk farms and lots of lvols and volume groups. The /etc/lvmconf could be very large and justify expanding / by using Ignite/UX.


Bill Hassell, sysadmin
Rasheed Tamton
Honored Contributor

Re: Extending root fileystem

Ignite would be the easiest way. But needs downtime. Create the tape with interactive mode, shutdown, boot from the tape, from the menu which you get after the booting, you can easily modify the root partition.

If you have a test sytem, do it on it and once you satisfied with the result you can go for the production one.

For immediate solution, just follow Bill's suggestion to save the space.

You can also check whether you have any core files on the / file system.

find / -xdev -type f -name core

Regards.
Srimalik
Valued Contributor

Re: Extending root fileystem

Kavita Ji

I tried to do the same thing some days back but failed, see:

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1239422

So ignite is the way to go, do not use lvextend/pvmove and fsadm(I am still not sure what went wrong in my case)

-Sri
abandon all hope, ye who enter here..
Steven E. Protter
Exalted Contributor

Re: Extending root fileystem

Shalom again,

Actually Bill's way is the best way.

It should be remembered there is absolutely no reason to store files in the root filesystem. Thats not what its meant for.

I've gotten into the habit of having at least a CD-ROM worth of free space on root because people have a habit of dumping them on the root fs and killing the system. Thats actually a waste of disk space. The HP-UX install program, Ignite provides more than enough space to operate an HP-UX system with patches and updates and such for many years without extending root.

The best path is to clean up root and look for the old "hidden file" trick where files are hidden in the folders that file systems mount on and taking up space but are invisible due to the file system sitting on top of the location.

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