Operating System - HP-UX
1849261 Members
5903 Online
104042 Solutions
New Discussion

Re: Extending File Systems

 
SOLVED
Go to solution
Chris Hinnen
Frequent Advisor

Extending File Systems

I am running HP 11.0 and I left some disk space unpartitioned when I installed HP-UX so that I could extend a file system when I needed more space. I can't figure out how to extend a file system. Can someone help me out extending one of the file systems on a disk?

Chris Hinnen
20 REPLIES 20
James R. Ferguson
Acclaimed Contributor

Re: Extending File Systems

Chris:

If you have OnlineJFS you can do this "on-the-fly". This is a "chargeable" product feature but well worth the cost. You can use SAM to guide you throught the resize, or you can do this yourself. For example, do:

# lvextend -L n /dev/vgxx/lvolx
# fsadm -b 1024n /var

where n is the NEW SIZE of the logical volume in megabytes, not the increment in size;

and, 1024n is the product of 1024 and the number of megabytes you want to filesystem to ultimately be.

If the filesystem is HFS or you do not have online JFS, then you will need to be able to unmount the filesystem before you can extend it.

These procedures are described in the HP-UX System Administration Tasks manual:

http://docs.hp.com/hpux/onlinedocs/B2355-90672/B2355-90672.html

...JRF...
John Palmer
Honored Contributor

Re: Extending File Systems

Hi Chris,

First you have to extend the logical volume with the 'lvextend' command.

Then you have to extend the filesystem. This depends on a) which filesystem and b) whether you have purchased Online JFS.

If you have Online JFS then you can extend 'on the fly' with the fsadm command. Otherwise you have to unmount the filesystem (single user mode may be required) and extend it with the extend_fs command.

There are lots of previous threads on this issue. I suggest that you do a Forums Search (SEARCH button at top left of screen, tick Community Forums and Boolean options and search for 'extending and filesystem').

Regards,
John
Andreas Voss
Honored Contributor

Re: Extending File Systems

Hi,

do a bdf and notice the first columns device path ie: /dev/vg01/lvol1
ie you want 500MB do:
lvextend -L 500 /dev/vg01/lvol1
After this you have to unmount the filesystem:
umount /
You have to determine which fs you have with:
fstyp /dev/vg01/lvol1
Now extend the filesystem:
extendfs -F [vxfs|hfs] /dev/vg01/lvol1
Then mount the fs:
mount /

If you have OnlineJFS you can extend fs without umounting - do a search in the forums with 'fsadm'

Regards
Rick Garland
Honored Contributor

Re: Extending File Systems

Depending on the FS you want extended, a couple of them need to remain contingous.

SAM can help.

From the command line, umount the partition, do lvextend -l X /dev/vgYY/lvZZ - X is the total number of extents, YY is the VGNAME and ZZ is the LVNAME. Once complete, do the extendfs command.

SAM will do all of the above steps for you - if the FS dos not need to contingous. If you do not have OnLine JFS, you will need to umount the partition.

Also do a SEARCH for previous posts related to this subject.
John Palmer
Honored Contributor

Re: Extending File Systems

Chris,

extend_fs was a type, the command is extendfs.

I always mix that up with the required man page - man extendfs_vxfs or man extendfs_hfs.

Regards,
John
Chris Hinnen
Frequent Advisor

Re: Extending File Systems

How can I determine how much unused space I have to extend these file systems.

Chris
James R. Ferguson
Acclaimed Contributor

Re: Extending File Systems

Chris:

To find how much unused space you have:

# vgdisplay /dev/vgXX

Look for the free PE (physical extents). One PE=1024 KB

...JRF...
James R. Ferguson
Acclaimed Contributor

Re: Extending File Systems

Chris:

Sorry, wrong thought: one PE=4MB as vgdisplay will show!!!

To find how much unused space you have:

# vgdisplay /dev/vgXX

Look for the free PE (physical extents). One PE=4 MB

...JRF...
John Palmer
Honored Contributor

Re: Extending File Systems

Chris,

vgdisplay -v vg?? gives you details per disk in the volume group.

To study a particular disk, use pvdisplay.

See the relevant man pages for full details.

Regards,
John
Chris Hinnen
Frequent Advisor

Re: Extending File Systems

OK I go to Volume Groups in SAM and choose Extend on the Volume Group I want to extend. The Volume Group I want to extend says it has 3152 MB available. So I select it and choose Extend. I went to Extend Existing Logical Volumes and changed the size of the ones that I want to increase and hit OK. I can't choose OK on the Extend Existing Volume Group screen until I choose a disk. But when I hit the button to Select Disk it gives me an error saying no unused disks are found. What do I do?

Chris
Rick Garland
Honored Contributor

Re: Extending File Systems

Sounds like you are extending onto a disk that is already in the LVM and there are no more 'free' disks. If correct and you want extend a FS on a disk that is in use, choose the VG/LV that is going to be extended. The follow the prompts through to completion.

The find disks option lets you select disks that are not in use with the LVM and will let you setup LVM on the disk(s).
CHRIS_ANORUO
Honored Contributor

Re: Extending File Systems

Hi Chris,

SAM is the best option for you.
When We Seek To Discover The Best In Others, We Somehow Bring Out The Best In Ourselves.
Chris Hinnen
Frequent Advisor

Re: Extending File Systems

I am using SAM. I don't understand what you said in your last post Rick about choosing a disk that is in use. I did this command from the command line and got this error:

/usr/sbin/lvextend -L 152 /dev/vg00/lvol1
lvextend: Not enough free physical extents available.
Logical volume "/dev/vg00/lvol1" could not be extended.
Failure possibly caused by contiguous allocation policy.
Failure possibly caused by strict allocation policy

I know I have enought physical extents available, it said I have 788 Free PE.

chris
Alan Riggs
Honored Contributor

Re: Extending File Systems

Chris,
vg00/lvol1 is the boot volume of your root VG (/stand). It MUST be contiguous and have bad block relocation turned off. It is not possible to increase the size of this filesystem after initial creation without either physically moving extents allocated to the other lvols or rebuilding the VG. Both operations are probably more complex than you require.

Why do you need to extend /stand? It is proobably more desirable to clean out old/unneccessary kernel/system files. Alternativey, if a subdirectory is large (should not be, but IF) then you might want to create a separate filesystem for that subdirectory.

Again, cleaning out the FS is probably your best choice. If you really have a need for a larger /stand, then I suggest rebuilding the root VG with a make_recovery tape.
Chris Hinnen
Frequent Advisor

Re: Extending File Systems

I am trying to install the latest General Release Patches for HP-UX 11.0 and it said i did not have enough free space on /stand. So I guess I need to clean it out. I don't really know what to delete out of there and don't want to mess anything up inside it.

Chris
Alan Riggs
Honored Contributor

Re: Extending File Systems

Chris -- look for a build directory. Anything in there can be removed. Look for vmunix.* files. These can be moved elsewhere for the patch install. The patching will create a copy of your current vmunix file before compiling the new kernel, anyway. It should not be necessary to restore to a previous version, so rm them if you are confident in your current kernel, move them aside otherwise.

That shoud be enough. If not, post an ll of /stand and we can take a look.
Rick Garland
Honored Contributor

Re: Extending File Systems

First start, what FS are you tring to extend. Be aware that the root a swap need to be continuous and that however the other FSs are setup, thet may be contigous as well. (They don't need to be but that is how they were setup.)

From SAM, choose the 'Disks and File Systems' option, then choose the Logical Volume option
This could take a little time (couple of minutes as it scans the HW). Within this option, highlight the LV you wish to expand and then on the menu bar is Actions. Bring down the menu and there is a selection for 'Increase Size'.

Again be aware, if a contiguous FS, there will be additional steps involved.
Chris Hinnen
Frequent Advisor

Re: Extending File Systems

Here is my ll of the stand directory.

-rw-r--r-- 1 root sys 19 Jul 27 11:23 bootconf
drwxr-xr-x 4 root sys 2048 Oct 11 13:11 build
drwxr-xr-x 5 root sys 1024 Aug 7 10:41 dlkm
drwxr-xr-x 5 root sys 1024 Aug 4 11:51 dlkm.vmunix.prev
-rw-r--r-- 1 root sys 1932 Jul 27 11:47 ioconfig
-r--r--r-- 1 root sys 82 Jul 27 11:47 kernrel
drwxr-xr-x 2 root root 8192 Jul 27 11:23 lost+found
-rw------- 1 root root 12 Oct 11 11:04 rootconf
-r--r--r-- 1 root sys 690 Oct 11 13:11 system
-r--r--r-- 1 root sys 690 Oct 11 13:06 system.prev
-rwxr-xr-x 1 root sys 12908808 Aug 7 10:28 vmunix
-rwxr-xr-x 1 root sys 12908808 Jul 27 11:42 vmunix.prev
Alan Riggs
Honored Contributor
Solution

Re: Extending File Systems

Okay -- see my last message. mv or rm vmunix.prev. Remove files under /stand/build. I will be very surprised if that does not clear enough space.
Chris Hinnen
Frequent Advisor

Re: Extending File Systems

Yes that freed up enough space. Thanks alot.

Chris