Operating System - HP-UX
1836890 Members
2100 Online
110111 Solutions
New Discussion

Re: How do I reduce a logical volume online ?

 
SOLVED
Go to solution
Tom De Reuse_1
Occasional Contributor

How do I reduce a logical volume online ?

I reduced the filesystem in /usr with fsadm (online)from 4GB to 3GB. Now, I want to reduce the size of the logical volume of /usr? Can this be done online?
( online JFS is installed )
8 REPLIES 8
Mark Grant
Honored Contributor

Re: How do I reduce a logical volume online ?

No problem

Just "lvreduce -L 3072 /dev/vg00/lvolXX"
Never preceed any demonstration with anything more predictive than "watch this"
Todd McDaniel_1
Honored Contributor

Re: How do I reduce a logical volume online ?

Did you defrag before you reduced? I hope you backed up /usr or have an ignite tape before you did this...

Which I am sure you did!!

Of course, /usr is a fairly static FS solong as you defraged it should be okay.

Just remember UNIX will let you do nearly anything whether or not it is good for your box...of course HPUX has safeguards with LVM.
Unix, the other white meat.
Geoff Wild
Honored Contributor

Re: How do I reduce a logical volume online ?

As mark said:

lvreduce -L 3072 /dev/vg00/lvolXX

Make sure you have a backup/make_tape_recovery though....

If the fsadm resize went fine, then the lvreduce should work...

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
SS_6
Valued Contributor
Solution

Re: How do I reduce a logical volume online ?

Standard Steps: I assume you did few steps already.
Take backup of file system.
Defrag first
#fsadm -F vxfs -DEde /usr

Reduce to new size e.g 3000MB
#fsadm -F vxfs -b 3000M /usr
#lvreduce -L 3000 /dev/vg00/lvxxx
Note:Use the logical volume mounted on /usr
To see do bdf /usr
By providing solutions I am helping myself
Tim D Fulford
Honored Contributor

Re: How do I reduce a logical volume online ?

A the risk of being contary to the above.. I did not think it was possible to reduce a fs....? (Ive grown them but never shrunk them). Did the fsadm do the trick or not?

Regards

Tim
-
Todd McDaniel_1
Honored Contributor

Re: How do I reduce a logical volume online ?

Yes it is possible (shudders) but is not recommended by anyone I know...

Best practice IMHO, is to backup FS, lvremove Lvol and lvcreate again... but in this case that would involve reloading the OS.

I think he found that it was worth the risk in this case to try it. Not my favorite thing though.
Unix, the other white meat.
Tom De Reuse_1
Occasional Contributor

Re: How do I reduce a logical volume online ?

First some answers to your questions/remarks, guys :
Yes, I do have a backup of /usr and I defragemented before reducing the filesystem, which worked fine by the way. (I followed exactly the steps "SS" proposes to do)
I was a bit afraid of doing the lvreduce, because I wasn't sure, if onlineJFS is installed, you should use that same command for reducing the logical volume.
Anyway, it worked. THX a lot!
Mark Grant
Honored Contributor

Re: How do I reduce a logical volume online ?

Tom, you don't even need OnlineJFS to reduce a logical volume. It will do it anyway. However, you can't reduce the filesystem afterwards so it is of limited use.
Never preceed any demonstration with anything more predictive than "watch this"