Operating System - HP-UX
1837239 Members
2844 Online
110115 Solutions
New Discussion

Re: Reducing file system on vxfs

 
SOLVED
Go to solution
Stuart Powell
Super Advisor

Reducing file system on vxfs

I increased the size of the wrong logical volume. Went to single user mode.
lvextend -L 500 /dev/vg00/lvol8
extendfs -F vxfs -b 614400 /dev/vg00/rlvol8
reboot.

Now I need to reduce the file system. I ran lvreduce -L 200 /dev/vg00/lvol8 and lvdisplay reflects that change, but a bdf shows the same size file systems. What did I do wrong? Any ideas on how to correct the problem? The good thing is that this is a development station, so reboots are not an issue.
Sometimes the best answer is another question
8 REPLIES 8
Peter Kloetgen
Esteemed Contributor

Re: Reducing file system on vxfs

Hi Stuart,

you can reduce a filesystem only if you have online JFS. If not, you have to do a backup of your filesystem, then reduce the filesystem, which destroys data in it and restore your backup. And if you have online JFS, please do a backup before reducing also, cause it coul fail.

Allways stay on the bright side of life!

Peter
I'm learning here as well as helping
Shahul
Esteemed Contributor

Re: Reducing file system on vxfs

Hi

Do U have online JFS installed? If no, then U are in trouble. After decreasing the lvol by lvreduce command, U will have to do newfs for reflecting the change in bdf. By the time ur data will be washed away. if U have online jfs, don't worry U can use fsadm command. If no online jfs

Take backup of lvol8, then do
#newfs /dev/vg00/rlvol8

Then restore backup. Otherwise U forget about that space, Once again use lvextend for the lvol, Let it be 500 MB size.

Best of luck
Shahul
Uday_S_Ankolekar
Honored Contributor
Solution

Re: Reducing file system on vxfs

Hello,

You need to run fsadm before lvreduce.

I think your lovl might corrupted.
try fsck -F vxfs lvolname

If you have backup create new filesystem with newfs and restore file system from backup.

-USA..
Good Luck..
PIYUSH D. PATEL
Honored Contributor

Re: Reducing file system on vxfs

Hi,

You need to run the newfs command again if you dont have Online JFS installed on your system.

Since you had run extendfs, you need to do a newfs again.

So backup the data on the filesystem and then run the newfs command and you are done.

Then mount the filesystem and restore the data.

Piyush
Stuart Powell
Super Advisor

Re: Reducing file system on vxfs

Thanks for all the input. Yes I realized that I've hosed the /var file system. I'll back it up, and run newfs on the logical volume.
Sometimes the best answer is another question
PIYUSH D. PATEL
Honored Contributor

Re: Reducing file system on vxfs

Hi,

lvreduce knows nothing about files and filesystems. Therefore, it will change the boundary of a logical volume without regard to any meaningful data. As mentioned, you must umount the filesystem first. There is a high probability that lvreduce may corrupt the filesystem and bdf is just looking at old data.

When you have Online JFS (and patches)and the filesystem you are reducing is indeed JFS (vxfs), then it can be done online.

Piyush
Uli Manschke
Valued Contributor

Re: Reducing file system on vxfs

hi,
just to make things easier:

use

extendfs -b $((1024*500)) ...
(to extend FS using non-OnlineJFS command)
or

fsadm -b $((200*1024)) /var
(to reduce the FS using OnlineJFS command)

this avoids miscalculations of the new FS size (or using a calculator ...)

regards
uli
HP Software PreSales technical consultant
Arockia Jegan
Trusted Contributor

Re: Reducing file system on vxfs

Stuart,

The command you used to increase the size of the file system says that you don't have onlineJFS. If you have onlineJFS you can use the following commands to reduce the file system

#fsadm -F vxfs -b 200M
#lvreduce -L 200 /dev/vg00/lvol8

If you don't have online JFS then as mentioned by everyone you need to recreate the file system.