Operating System - HP-UX
1830039 Members
1738 Online
109998 Solutions
New Discussion

reducing /opt file system

 
Dianne Johnson
Advisor

reducing /opt file system

I'm 2GB short for app conversion temp space in /dev/vg01/lvol13. (HPUX newbie here, sorry.) I have unused space in /opt. After a full backup, may I move the /opt files, lvreduce /dev/vg01/lvol2, and move the files back without damaging the other 18 lvols and filesystems that start with /opt? (/opt/myapps, /opt/12 db filesystems, etc)
Need to be in single user mode? Need to lvremove/lvcreate? This is a 10.20 system using the hfs filesystem.

p.s. I miss MPE/ix on a daily basis.
5 REPLIES 5
James R. Ferguson
Acclaimed Contributor

Re: reducing /opt file system

Hi Dianne:

OK, your're dealing with an hfs filesystem so your options are much more limited than with a vxfs one.

Backup the data contained in the logical volume you want to reduce. You cannot assume that an 'lvreduce' will not destroy extents containing useful data. You will need to reload the filesystem (mountpoint) after its reduction.

You will either want to do this in single user mode (with the filesystem unmounted) or use 'fuser' (see man pages) to find and kill all users and processes using the filesystem to be reduced.

If I understand your whole question correctly; if you have logical volumes, as for instance:

/opt/apps mounted on /dev/vg01/lvol
/opt/dbfiles mounted on /dev/vg01/lvol2

...and you merely want to reduce the size of lvol2, then you would only need to backup and restore /opt/dbfiles.

As an aside, it might be very worthwhile converting your filesystems from hfs to vxfs (aka "JFS") ones. With vxfs file systems you can dynamically reduce sizes without backup and restorarion of the data.

Regards!

...JRF...
Patrick Wallek
Honored Contributor

Re: reducing /opt file system

To add to James' comments. I, too, would recommend converting your HFS filesystem to JFS (vxfs) if possible. I would also look at purchasing the Advanced JFS (Online JFS) product from HP. That is the product that allows you to do online resizing of LVs without having to unmount the LV.
Dianne Johnson
Advisor

Re: reducing /opt file system

If I understand this, I may:
lvreduce /opt mounted on /dev/vg01/lvolx, and it won't disturb my other /opt mountpoints, like /opt/apps mounted on /dev/vg01/lvol2 or
/opt/dbfiles mounted on /dev/vg01/lvol3
A. Clay Stephenson
Acclaimed Contributor

Re: reducing /opt file system

Hi Dianne,

To answer your last question, those filesystems will essentially be unaffecred.

You need to unmount those mounted below /opt/first. Then do your rebuild on the /opt filesystem. Next mount /opt. Then mkdir /opt/apps and mkdir /opt/dbfiles.
If you restore /opt from backup then the mountpoints will be created for you. If you must recreate the mountpoint dirs, make sure
that the mountpoint permissions are not too restrictive (e.g. 700 and owned by root). You probably want 755 or 750.

You can then mount /opt/apps and /opt/dbfiles and you're back.

Clay
If it ain't broke, I can fix that.
Wieslaw Krajewski
Honored Contributor

Re: reducing /opt file system

Hi,

I must recall that reducing HFS file system requires
recreating it. So, the whole procedure should be as follows.

1. Go into single user run level,

2. Do backup of /opt file system,

3. umount /opt in the case it would be still mounted (very likely) - of course if a directory within /opt file system is
the mount point fot another file system, it must be umounted first,

4 lvreduce -L size_in_MBs /dev/vg00/lvol#
(# means a proper value)

5 newfs -F FS_type /dev/vg00/rlvol#

6. mount /dev/vg00/lvol# /opt

7. recover /opt file system from backup,

8. reboot

Pretty easy.

Asconcerns the FS_type in the step 6, follow advices given in the previous answers, if possible.

Rgds.




Permanent training makes master