1826400 Members
4054 Online
109692 Solutions
New Discussion

Re: Lvreduce command

 
Sylvie Vezina
Occasional Advisor

Lvreduce command

Hi,
I tested lvreduce cmd on test machine before to perform it on production machine....I don't need rush response but I will appreciate your help

I have online JFS, and I performed lvreduce, I received msg that's everything was ok. When I checked in SAM, I saw the new size, but when I did bdf, I saw an old size...
I did these steps:
umount file system
lvreduce
mount file system

Could you tell me what's wrong.

Thank you
The best day is today
5 REPLIES 5
Rajeev  Shukla
Honored Contributor

Re: Lvreduce command

Hi,
You have reduced the logical volume but not the filesystem yet. i.e. you have to use "fsadm" to resize the filesystem after you have done lvreduce.
Do
fsadm -b newsize /mountpoint

I recomend you go through this document which will help you know the process more better.
http://www2.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000063231654

Let me know if you can access this.

Cheers
Rajeev
Sridhar Bhaskarla
Honored Contributor

Re: Lvreduce command

Hi,

You need to take backup of your filesystem before you attempt to reduce even with onlinejfs.

If you have onlineJFS, you wouldn't need to unmount and lvreduce. Your steps would be the
following. Let us say you had 1000MB and you want to reduce it by 500MB. So, the new size is 500MB.
Size_in_blocks = 500*1024= 512000

1. fsadm -b 512000 /mount_point

If the above is successful, then

2. lvreduce -L 500 /dev/vg01/your_lv

If you do a bdf /mount_point, you should see
only 500MB.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
A. Clay Stephenson
Acclaimed Contributor

Re: Lvreduce command

You have done a bad thing!!!

The correct order was
1) fsadm -F vxfs -b newsize
2) lvreduce

You didn't need to unmount with OnlineJFS.

The problem is that LV commands have nothing to do with the filesystems. You now have a filesystem that is bigger than its LVOL. I would immediately do an lvextend to at least the previous size. If you have already allocated other LVOL's then it's probably too late.
If it ain't broke, I can fix that.
Ian Kidd_1
Trusted Contributor

Re: Lvreduce command

you've changed the logical volume size with lvreduce but not the file system size. this type of situation can lead to loss of data/corruption.

you want to:
(1) do a backup
(2) fsadm -b
(3) lvreduce newsize /mountpoint

Keep in mind that you can still have data loss, so you may also want to restore the data as a possible step 4.

I'm glad you mentioned that this is a test box!

Check out this thread:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x312c8ffa98a2d5118ff10090279cd0f9,00.html

If at first you don't succeed, go to the ITRC
Ian Kidd_1
Trusted Contributor

Re: Lvreduce command

oops should be :

(1) do a backup
(2) fsadm -b newsize /mountpoint
(3) lvreduce

copy/paste error on my part

(no points for this second entry please!)
If at first you don't succeed, go to the ITRC