LVM and VxVM

Reduce /var /opt /usr without online JFS

 
SOLVED
Go to solution
mrmo07
Regular Advisor

Reduce /var /opt /usr without online JFS

Hi,

want to reduce /var, /opt, /usr . i don't have online JFS. how should i proceed. please advice.

Regards,
Morshed.
9 REPLIES 9
Ranveer
Advisor

Re: Reduce /var /opt /usr without online JFS

I will follow "ignite" procedures, other options will not be supported
I am an HPE employee

Accept or Kudo

Manix
Honored Contributor
Solution

Re: Reduce /var /opt /usr without online JFS

Yes Ignite could be a option.

But if you really want to do this then probably you need to enter si ( single user mode ) as you may not be able to umount "usr"
& then do follows.

1) Backup /usr & others fs
2) fsadm -F vxfs -D -E -d -e /usr

This will defrag the filesystem and thus incrases the chances of being able to reduce the filesystem size.

3) fsadm -F vxfs -b m /usr
4) lvreduce -L XXX /dev/vg00/lvolX
5) bdf and confirm
HP-UX been always lovable - Mani Kalra
mrmo07
Regular Advisor

Re: Reduce /var /opt /usr without online JFS

Hi Manix,

is the steps with single use user mode?

1) fsadm -F vxfs -D -E -d -e /usr
3) fsadm -F vxfs -b m /usr
4) lvreduce -L XXX /dev/vg00/lvolX
5) bdf and confirm

any options without fsadm?

Regards,
Morshed.
James R. Ferguson
Acclaimed Contributor

Re: Reduce /var /opt /usr without online JFS

Hi:

Without OnlineJFS you can't use 'fsadm' to resize your filesystem downward unless you backup it's data; unmount the filesystem; use 'newfs' to create one of a smaller size; re-mount the filesystem; and finally restore your data.

You don't say why you want to reduce the size of your filesystems, but if you believe that you need to do so, I would take an Ignite backup of your 'vg00' and use it to rebuild vg00. Given the filesystems in question this would probably be easiest and fastest.

If you don't want to use Ignite, *boot* into single user mode and use the commands in '/sbin' for perform your maintenance. Then when, done, reboot normally. This will be easier than making sure no files are open in '/var', '/opt' and '/usr' that prevent unmounting these filesystems in order to resize them.

Regards!

...JRF...
Manix
Honored Contributor

Re: Reduce /var /opt /usr without online JFS

Option 1: With Online JFS

fsadm -F vxfs -n newsize /dev/vgXX/lvolYY
lvreduce -L newsize /mountpoint

Option 2: Without online JFS

You have to unmount file system before you run above command.

I think you have JFS not the online version of JFS so "fsadm" should do after umounting the fs.

other wise try extendfs -s

-s size

Specifies the number of DEV_BSIZE blocks to be added to the file system. If size is not specified, the maximum possible size is used.

extendfs -F vxfs -s /dev/vgxx/rlvolx

Do let me know if it works for you.
HP-UX been always lovable - Mani Kalra
Manix
Honored Contributor

Re: Reduce /var /opt /usr without online JFS

As James said ..ignite would be the best solution.
HP-UX been always lovable - Mani Kalra
Emil Velez
Honored Contributor

Re: Reduce /var /opt /usr without online JFS

1. ignite

2. After creating a ignite image you could try the following.

A. boot up in single user mode
B. /var /opt /usr will not be mounted

C. Create a new logical volume for /var
mount it at /newvar
D. mount /var
E. find /var | cpio -pudmvl /newvar
F. umount /var
G. umount /newvar
H edit /etc/fstab to replace the /var entry with the new logical volume.
I. lvremove the old volume from /var

REpeat steps C to I for /opt and /usr

Do this only after a good backup and ignite image. Should work but if you are not good with LVM you could cause a problem.

3. Convince the boss to get you onlinejfs for this reason.

mrmo07
Regular Advisor

Re: Reduce /var /opt /usr without online JFS

Hi manix,

u r ri8.

single user mode:
1) fsadm -F vxfs -D -E -d -e /usr
3) fsadm -F vxfs -b m /usr
4) lvreduce -L XXX /dev/vg00/lvolX
5) bdf and confirm

i have tested on rx2660 with hpux 11iv3.

thanks.

Manix
Honored Contributor

Re: Reduce /var /opt /usr without online JFS

So this worked for u !! right

Thanks & Regards
Manix
HP-UX been always lovable - Mani Kalra