Operating System - HP-UX
1834087 Members
2142 Online
110063 Solutions
New Discussion

Re: Reduction of LV without data loss

 
SOLVED
Go to solution
Ralph Grothe
Honored Contributor

Reduction of LV without data loss

Hi,

from our DBA I got a false request for increase of a filesystem (i.e. she gave me the wrong mountpoint).
On the box we have installed OnlineJFS.
So I easily increased the filesystem to the requested new size.
Now she wants the space that was allocated to the wrong filesystem back for the filesystem she originally meant.
Easy stuff,
I reduced the filesystem, that undeservedly had been increased by me before, to the old size (I saved a dump of bdf, and lvdisplay before increasing, 13 GB was the old size).
I issued:

# fsadm -b $((13000*1024)) /oracle/Z01/sapdata1
fsadm: /etc/default/fs is used for determining the file system type
fsadm: /dev/vgz01/rlvol12 is currently 23552000 sectors - size will be reduced

When I now try to reduce the LV back to the 13 GB in order to get the PEs back for the other LV that really needed to be increased, I get this warning about possible data loss which really upsets me:

# lvreduce -L 13000 /dev/vgz01/lvol12
When a logical volume is reduced useful data might get lost;
do you really want the command to proceed (y/n) : n
Logical volume "/dev/vgz01/lvol12" is not reduced.
Volume Group configuration for /dev/vgz01 has been saved in /etc/lvmconf/vgz01.c
onf

As I already reduced the filesystem to those 13 GB is it save to continue and ignore the warning?



Madness, thy name is system administration
3 REPLIES 3
Tom Geudens
Honored Contributor
Solution

Re: Reduction of LV without data loss

Hi,
Yes, this should be OK. If there were any blocks present in the area above 13Gb, the fsadm-command would have complained. The warning from lvreduce is "default".

Regards,
Tom
A life ? Cool ! Where can I download one of those from ?
Vincent Farrugia
Honored Contributor

Re: Reduction of LV without data loss

Hello,

Since you've just increased the file system, you won't get any data loss. But, if you have been using this size for a long time, you MIGHT have data loss.

It is recommended when reducing online that you defragment your filesystem first. Since you've just increased it, data is not present in the upper part where you want reduced so you can safely reduce it without data loss.

HTH,
Vince
Tape Drives RULE!!!
Stefan Farrelly
Honored Contributor

Re: Reduction of LV without data loss


Tom is dead right - fsadm would fail first if there was data on the area being reduced.

If you have JFS version 3.3 (on 11.0 or its the default on 11i) it automaticall moves data on the area being reduced (if any in use) out of the way when you do the fasdm command so its safe as, but you still get the warning message from lvreduce afterwards! (nothing to worry about)
Im from Palmerston North, New Zealand, but somehow ended up in London...