Operating System - HP-UX
1833184 Members
2746 Online
110051 Solutions
New Discussion

How to mount a filesystem with only one mirror copy working

 
SOLVED
Go to solution
Madhu_17
Regular Advisor

How to mount a filesystem with only one mirror copy working

Hi Gurus,

After the reboot, one filesystem was missing. when i try to mount that filesystem i'm getting the following error.

/dev/vg02/u02: No such device or address

It's having mirror copy. i observed that one disk is not showing in ioscan and the other disk is available.

How to mount this filesystem with the available disk without corrupting the data.

Pls reply with step by step commands.

Thanks in Advance,
SR
17 REPLIES 17
Sridhar Bhaskarla
Honored Contributor
Solution

Re: How to mount a filesystem with only one mirror copy working

Hi Rakesh,

Looks like your VG is not activated. If the VG's quorum is missing, it won't get activated. You can activated without quorum and then try to mount the filesystem.

#vgchange -a y -q n vg02
#mount /dev/vg02/u02

Run 'lvdisplay -v /dev/vg02/u02' and make sure the atleast one PV has good extents for this LV. If you see 'stale' for all the PVs, then you lost data on the filesystem.

Make sure you get the other disk fixed. Once it is replaced, follow below procedure to re-sync the mirrors.

#ioscan -f
Ensure disk is claimed
#vgcfgrestore -n vg02 /dev/rdsk/cxtydz
#vgchange -a y vg02
#vgsync vg02

-Sri
You may be disappointed if you fail, but you are doomed if you don't try

Re: How to mount a filesystem with only one mirror copy working

Rakesh,

I assume your volume group is made up of two disks yes?

Chances are that the VG hasn't activated cos it can't establish a quorum (>50% of disks present).

If you want to you can override this by issuing:

vgchange -a y -q n /dev/vg02

You should then be able to mount your filesystems:

mount -a

Of course that assumes that valid extents are available on the functioning drive.

HTH

Duncan

I am an HPE Employee
Accept or Kudo
Ralph Grothe
Honored Contributor

Re: How to mount a filesystem with only one mirror copy working

Probably because of the imposed quorum owe to the missing PV the VG wasn't activated after reboot.
You can try to activate the VG without regarding the quorum by

vgchange -q n vg02

Then you should run fsck on the character device of the LV you want to mount before mounting it.

However, you should check what happened to the mirror disk.
Have you got Online Diagnostics installed.

e.g.

swlist OnlineDiag

Then you could run (x|m|c)stm and get Info of the disk first.
Otherwise you could try to read from the failed disk by dd.
Madness, thy name is system administration
Madhu_17
Regular Advisor

Re: How to mount a filesystem with only one mirror copy working

Thanks for your reply.

Now i'm able to activate VG. but when i try to mount the filesystem i'm getting the below error.

vxfs mount: /dev/vg02/u02 is corrupted. needs checking

shall i run fsck. this is having very important data related to databses. i don't want to take risk. so, can you pls. give me exact syntax.

Thanks,
SR
Sridhar Bhaskarla
Honored Contributor

Re: How to mount a filesystem with only one mirror copy working

Hi Rakesh,

Most probably you lost the data. I am skeptical on the success of your fsck. You can try 'fsck' but don't type 'yes' for any confirmations. If you get any IO errors, then you don't have much choice. Try to see if you can fix the failed disk like reseating it etc.,

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Madhu_17
Regular Advisor

Re: How to mount a filesystem with only one mirror copy working

Hi Sridhar,

Thanks a lot for your response.

i tried fsck. it seems super block got corrupted. i'm getting the below error.

BAD SUPER BLOCK: MAGIC NUMBER WRONG
USE -b OPTION TO FSCK TO SPECIFY LOCATION OF AN ALTERNATE SUPER-BLOCK TO SUPPLY NEEDED INFORMATION; SEE fsck(1M).

as per solaris procedure i tried "newfs -N .

but i got the "illegal option" error. it seems data is not corrupted.

Can you pls. guide me how to go about this problem in HP-UX.

Thanks,
Rakesh

Robert-Jan Goossens_1
Honored Contributor

Re: How to mount a filesystem with only one mirror copy working

SR,

How good is your backup ?

The superblock problem can occur on any filesystem. These errors simply
mean that the filesystem has a problem.

To resolve your problem, you must choose an alternate superblock. You
can choose an alternate superblock from the /etc/sbtab file.

Execute the following command once you choose an alternate superblock:

fsck -b16

If this command is successful, your filesystem will be repaired. If
this command is not successful, you can try other superblocks.

If other superblocks do not work (you can try up to three or four
different superblocks), then the filesystem is beyond repair. At this
point, you will need to newfs the filesystem, and then restore the
filesystem from backup.

Regards,
Robert-Jan
Sridhar Bhaskarla
Honored Contributor

Re: How to mount a filesystem with only one mirror copy working

Rakesh,

Unless you can get your old disk back, you may not be able to retrieve data from this disk. Post your 'lvdisplay -v /dev/vg02/u02' output.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Madhu_17
Regular Advisor

Re: How to mount a filesystem with only one mirror copy working

Hi,

/etc/sbtab is having info. abt. only rootvg.

i'm facing problem with other volume group.

Can i try

fsck -b16


Thanks,
Rakesh
Robert-Jan Goossens_1
Honored Contributor

Re: How to mount a filesystem with only one mirror copy working

# grep /dev/vg02/ru02 /etc/sbtab

10040 is normaly a default alternate superblock

regards,
Robert-Jan
Madhu_17
Regular Advisor

Re: How to mount a filesystem with only one mirror copy working

No output from that command.

Robert-Jan Goossens_1
Honored Contributor

Re: How to mount a filesystem with only one mirror copy working

# fstyp /dev/vg02/u02

HFS or VXFS ?

# grep /dev/vg02/ru02 /var/adm/sbtab

http://www5.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000062684134
Sridhar Bhaskarla
Honored Contributor

Re: How to mount a filesystem with only one mirror copy working

For vxfs filesystems, you won't get superblock information. So, there would be no -b option. 'man fsck_vxfs'. If it was a hfs filesystem, you can try alternate superblocks as mentioned before. But look at /var/adm/sbtab for filesystem specific information. /etc/sbtab contains default superblocks.

Unless you post your 'lvdisplay -v /dev/vg02/u02' output, we may not be able to provide you with more information. There is a good chance that some of the extents may be missing for this LV.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Madhu_17
Regular Advisor

Re: How to mount a filesystem with only one mirror copy working

Hi All,

Thanks a lot for your response.

Now i have mounted the filesystem.

Earlier i have done small mistake by not doing fsck on rvol of Volume Group.

Thanks Again,
SR
Madhu_17
Regular Advisor

Re: How to mount a filesystem with only one mirror copy working

Hi,

I have mounted the filesystem. but the lvdisplay is showing stale for one of the disk.

--- Logical extents ---
LE PV1 PE1 Status 1 PV2 PE2 Status 2
0000 ??? 0000 stale /dev/dsk/c2t2d0 0000 current

i tried to reduce the lv, but it's giving the error. i think for this problematic disks with the question mark we have to use lvreduce command with "pvkey".

Can anybody pls tell me how to find out this pvkey 'n' the exact syntax of this command.

Thanks,
SR
Sridhar Bhaskarla
Honored Contributor

Re: How to mount a filesystem with only one mirror copy working

Rakesh,

Check the other post for using 'lvreduce' with -k option. It can take painfully long time. Once all the lvs are reduced, you can get rid of the disk by using 'vgreduce -f vg02'. If there are any LVs that are still dependent on the failed, vgreduce operation will fail.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Madhu_17
Regular Advisor

Re: How to mount a filesystem with only one mirror copy working

Pls go thr' the all the postings