Operating System - HP-UX
1754283 Members
3206 Online
108813 Solutions
New Discussion юеВ

Help with reducing a logical volume

 
SOLVED
Go to solution
David Islas Gonz├бlez_1
Frequent Advisor

Help with reducing a logical volume

I need to reassign a physical volume from vg01 volume group to vg02, by mistake I first reduce the filesystem and then defragment :S

/production/system/data1 size 60gb

#fsadm -F vxfs -b 40000m /production/system/data1
#fsadm -F vxfs -d -D -e -E /production/system/data1

I think nothing is corrupted, I can see all the files

When I try to make lvreduce I have the next message:
# lvreduce -L 40000 /dev/vg01/lvol9
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/vg01/lvol9" is not reduced.
Volume Group configuration for /dev/vg01 has been saved in /etc/lvmconf/vg01.conf

Can I reduce this logical volume without the lose of data, I can not umount the filesystem!!


THIS IS URGENT!!
I appreciate any suggestion :S
4 REPLIES 4
James R. Ferguson
Acclaimed Contributor

Re: Help with reducing a logical volume

Hi:

> Can I reduce this logical volume without the lose of data, I can not umount the filesystem!!

No, generally not. A logical volume is a container for a filesystem. If you think of it that way, shrinking (reducing the size) of the container cuts off part of the filesystem contained therein.

If you have enlarged a logical volume, but not correspondingly increased the size of the filesystem within, then you can safely reduce the logical volume to its original size.

Furthermore, a physical disk that belongs to one volume group cannot be moved to another volume group. Thus, by extension, a logical volume belonging to one volume group cannot be moved to another volume group. Backup or copy the filesystem data from one logical group to another.

Regards!

...JRF...
VK2COT
Honored Contributor

Re: Help with reducing a logical volume

Hello,

Even with OnlineJFS, it is always prudent
to reduce the file system by saving
the original data on tape or somewhere else.

The fsadm(1) command can corrupt the file
system unless newer version of Online JFS
(higher than 3.1) is used AND VxFS version
is 4 or higher.

I am not sure if you are up-to-date with OnlineJFS, VxFS versions and patches.
Check your file system version with the
fstyp(1) command:

fstyp -v /dev/vg01/rlvol9

lvreduce(1) by itself will destroy a file system on the LV.

Since you ran the "fsadm -D -e..." as second
command, there is a good possibility
that things can go wrong with lvreduce(1).
The golden rule is to defragment the file system firstly but it is too late for you
now.

If all your files are still intact, I
suggest urgent backups!

Cheers,

VK2COT
VK2COT - Dusan Baljevic
timber
Occasional Advisor
Solution

Re: Help with reducing a logical volume

to be sure that "u have reduced the filesystem" by bdf 's show
if the filesystem has reduced succ you can choice " y" when lvreduce
of course a valid backup is prerequisite!
May Force be with you !
David Islas Gonz├бlez_1
Frequent Advisor

Re: Help with reducing a logical volume

I waited for the backup to be made and then I lvreduce ONLINE, everything is working fine !!

lvreduce really works with onlineJFS.

Thanks to everybody.
Regards