Operating System - HP-UX
1836551 Members
2046 Online
110102 Solutions
New Discussion

Trying to extend HFS / file system

 
carl_46
Advisor

Trying to extend HFS / file system

I am trying to extend a root file system but I am getting this error message.

# lvextend -L 150 /dev/vg00/lvol3
Warning: rounding up logical volume size to extent boundary at size "152" MB.
lvextend: Not enough free physical extents available.
Logical volume "/dev/vg00/lvol3" could not be extended.
Failure possibly caused by contiguous allocation policy.
Failure possibly caused by strict allocation policy

What can I do to resolve this problem. Also, How can I do an extendfs when I can't unmount the root file system?

Regards
6 REPLIES 6
Andy Monks
Honored Contributor

Re: Trying to extend HFS / file system

Seb,

you can't extend the root filesystem, so don't try it.

the lvm messages are most likely because the lvol is set to be contigous (lvdisplay /dev/vg00/lvol3 will show you). however, don't change it on the root lvol.
Bill Hassell
Honored Contributor

Re: Trying to extend HFS / file system

Extending the root filesystem is not normally required as it is defined as a static filesystem. Various application programs and installer programs violate this rule and add non-system files/data to the / directory. They must be moved. For 10.20, typical root filesystem is 100 megs with about 50 in use. For 11.0, root filesystem should be about 200 megs.

Be carefull in arbitrarily moving /wrong_place to some other location. Many applications are hardcoded to run in the named directory, while well-behaved applications will be configurable and actually ask the sysadmin where they should go. Generally, applications belogn in /opt and to a lesser extent, /usr/contrib and /usr/local. However, /usr/local has bad permissions by default so be sure to fix these first as in:

find /usr/local -type d -print -exec chmod 755 {} ;

Here are the *only* filesystems that should reside in /:

/dev
/etc
/sbin
(and perhaps /root for the better location of root's $HOME)

That's all. Everything else belongs in a separate lvol mountpoint. To remove the offending directories and files, find what space is needed for each filesystem:

du -kxs /wrong_place1
du -kxs /wrong_place2

The above -k option us undocumented in 10.20 but works OK to report disk space in Kbytes). The reports will tell you how much space you'll need. These can be separately mounted filesystems or a large 'collector' volume with several small directories. Assuming the new lvol is called /extra:

mkdir /extra/wrong_place1
cd /wrong_place1
find . | cpio -pudlmv /extra/wrong_place1
cd
rm -rf /wrong_place1
ln -s /extra/wrong_place1 /wrong/place1

Now the old directory name points automatically to the new lvol. Repeat as needed. Be careful to spell directory names carefully.


Bill Hassell, sysadmin
surendhar prakash.J
Frequent Advisor

Re: Trying to extend HFS / file system

You can extend the root volume group by following steps;

for example you have logical volume lvol3 ( this is mounted as a /var or /usr ).

1) you can not umount the the particular file system because it will used for some process when system is in normal mode ( init 3 or 4)

2) Interrupt the boot process by pressing any key and then type as follows..

main menu or enter command>hpux -lm boot

This will boot your system as a logical maintenance mode

3)#lvextend -L XXXX /dev/vg00/lvol3 ( XXXX- MB size and should be more than your exiting logical volume size)

4) extendfs /dev/vg00/rlvol3 ( this will extend your file system )

5) fsck -y /dev/vg00/lvol3

6) reboot your system by typing #reboot -n

You are getting error not enough free extend size in your physical volume


This is indicating you don't have free space in your Hard Disk.

you can see Hard Disk free space by typing #vgdisplay -v /dev/vg00 (In this you wil get free physical entend size and extend size of your volume group.
By default extend size is 4 MB, Whenever you give logical volume size it should be multiplied by 4.

you can see man page for lvextend "#man lvextend" you will get more helps.

Best of luck

Suren.J
Rick Garland
Honored Contributor

Re: Trying to extend HFS / file system

The root needs to be contigious. Extending the root lvol will defeat this.
Dave Wherry
Esteemed Contributor

Re: Trying to extend HFS / file system

As Rick said root needs to be contiguous. You can't just extend it. Use make_recovery to back up the root volume group and then you can rebuild it and resize any of the logical volumes you want to. It works very well.
Download and install the latest version on Ignite.
Do a make_recovery -AvC
This will backup everything in vg00 to the default tape drive, /dev/rmt/0m.
Then reboot, interupt the boot and boot from the tape. Just like an install you can go in and resize your logical volumes. Then it will recover everything and you'll be set.
On my K boxes it take about 3 hours to do this.
Antoanetta Naghiu
Esteemed Contributor

Re: Trying to extend HFS / file system

You can extend / file system even HP does not support it.
As it already told, you need to boot in lvm maintenance mode, and you need to have / contiguous.
So, check with lvdisplay lvol3 and lvol4. If the first physical extend of lvol4 is just the next one after the last one from lvol3 (e.g. last PE in lvol3 is 0599 and the first in lvol4 is 0600) that means you need to free up contiguous space.
Usually, lvol4 is /home, so you have to create a new fs for /home, move the stuff from /home in the new file system, create a new mount point in the /etc/fstab and destroy the old lvol4.
Make a copy of /etc/fstab (e.g. cp /etc/fstab /etc/fstab.good), vi /etc/fstab and delete the line that contains the mount point for /.
Boot in maintenance mode, lvextend lvol3, extendfs.
Have ready a few superblock numbers (pickup a few prior to start from /etc/sbtab) just in case you need to run fsck -b superblock number.
After you check with fsck that your fs is ok, remove the current copy of /etc/fstab and rename the fstab.good to fstab. To do that you may need to boot from the support cdrom, load rm and mv command to be able to get your correct copy of fstab in place.
If you are using mirroring, of course, first you have to split the mirror.
It is working!
Good luck!!!