Operating System - HP-UX
1834089 Members
2312 Online
110063 Solutions
New Discussion

Re: fsadm corrupt lvol HELP!!

 
SOLVED
Go to solution
AIMC
Frequent Advisor

fsadm corrupt lvol HELP!!

Hi,

A colleague was trying to reduce the size of a logical volume, lvreduce worked ok & fsadm complained that some files were in use, he then unmounted the filesystem & now cannot mount it again to complete the fsadm resize. Is there a way around this? Can fsadm be run to resize an unmounted filesystem?

Regards,

Aidan
7 REPLIES 7
Robert-Jan Goossens_1
Honored Contributor

Re: fsadm corrupt lvol HELP!!

Hi Aidan,

I'm hoping you have a good backup.

You could try a full fsck, but i'm afraid you will need to recreate the volume.

Best regards,
Robert-Jan
Devender Khatana
Honored Contributor

Re: fsadm corrupt lvol HELP!!

Hi,

What error does mount give ? It possiblly refers to a corrupted file system.
What does fsck give for the file system. Also try to extend it to original size ( More than the reduced size)& then retry fsck. If these do not work you need to recreate the file system.

HTH,
Devender
Impossible itself mentions "I m possible"
Pete Randall
Outstanding Contributor

Re: fsadm corrupt lvol HELP!!

From man lvreduce:

"-f
Force reduction of the number of logical extents without first requesting confirmation.

This option can be dangerous when there is a file system on the lv_path that is larger than the size that the logical volume is being reduced to. If the file system is unmounted, the -f option forces the reduction of the logical volume without reducing the file system. The file system becomes corrupt and is not mountable."

I'm afraid you're going to need to re-create the logical volume and restore it's contents from backup.


Pete

Pete
RAC_1
Honored Contributor

Re: fsadm corrupt lvol HELP!!

The prcedure followed was wrong. It is first fsadm and then lvreduce.

But in most cases this works if you enough free space in the lvol. Most probablly, you will have to restore from backup.

Anil.
There is no substitute to HARDWORK
Bill Hassell
Honored Contributor
Solution

Re: fsadm corrupt lvol HELP!!

If you ALWAYS assume that reducing the size of a filesystem will fail and DESTROY the entire filesystem, you'll be OK. lvreduce is like taking a chainsaw to a disk. It cuts off part of the storage and it knows NOTHING about files and directories. Therefore, it is a very dangerous command. Remember that an lvol might contain a filesystem, but it might also be a swap area or perhaps a Sybase or Informix raw data area. In all cases, lvextend will remove physical tracks of data regardless of whether they are important or not.

Now the VxFS filesystem does tend to grow from the bottom but there is no command to tell you where the last piece of useful data is located. For HFS filesystems, there are cylinder blocks all the way to the end of the disk which must remain intact.

Online JFS can increase a filesystem quite nicely online, but except for the very latest 3.3 version (and filesystems that are conveted to the latest VxFS revision), most sysadmins will report total loss of data using fsadm. NOTE: lvreduce should not be used--only fsadm.

Now if you're lucky and remember the original size of the lvol, you can lvextend the lvol back to it's original size and assuming you didn't try to force an fsck, the filesystem may be still be intact. Otehrwise, get out your backup tapes.


Bill Hassell, sysadmin
AIMC
Frequent Advisor

Re: fsadm corrupt lvol HELP!!

Hi All,

Thanks for your inputs, i had noted the exact size of the lvol prior to the lvreduce so an lvextend & an fsck -o full cleaned the filesystem & it was remounted ok! Think we'll be looking at removing & recreating the lvol next.

Regards,

Aidan
AIMC
Frequent Advisor

Re: fsadm corrupt lvol HELP!!

Closed