Operating System - HP-UX
1753730 Members
4551 Online
108799 Solutions
New Discussion юеВ

Re: Problem restoring a replaced disk

 
SOLVED
Go to solution
Michael D. Zorn
Regular Advisor

Problem restoring a replaced disk

I only do this once every 4 or 5 years, so I have to start over every time.

We just replaced a failed disk. I'm using the "When Good Disks Go Bad" doc from HP.

So far, I have
#vgcfgrestore -n /dev/vgfam /dev/rdsk/c9t5d0
- - OK
#vgchange -a y /dev/vfam
- - OK
but
#mount /data05
- - not a hfs file system
OK - that probably means the disk wasn't initialized. So I tried
#newfs -F hfs /dev/rdsk/c9t5d0
- - /dev/rdsk/c9t5d0 is a logical volume device

then
#pvcreate /dev/rdsk/c9t5d0
- - already belongs to a VG

#vgreduce /dev/vgfam /dev/dsk/c9t5d0
- - could not be removed ... some of its physical extents are still in use

I'm in single-user mode, the FS are not mounted on c9t5d0.

pvdisplay shows extents are there for all the FS that should be.

#vgdisplay shows the lvols in that VG as "available/syncd", and size not zero.

I'm probably overlooking some small but essential step, but I don't know what it is.

12 REPLIES 12
Patrick Wallek
Honored Contributor

Re: Problem restoring a replaced disk

Is it an HFS or a VxFS filesystem?

What if you do:

mount -F vxfs /data05
Michael D. Zorn
Regular Advisor

Re: Problem restoring a replaced disk

It is a hfs sytem.
It's also HP-UX 10.02, so 'pvchange' doesn't have '-a'
Albert_31
Trusted Contributor

Re: Problem restoring a replaced disk

hello Micheal,

Can you post the following

# vgdisplay -v
# strings /etc/lvmtab
# vgcfgbackup -f /tmp/vgfam.conf /dev/vgfam
# vgcfgrestore -l -f /tmp/vgfam.conf
# vgcfgrestore -l -f /etc/lvmconf/vgfam.conf
# cat /etc/fstab


so that we get a good idea of the current scenario and help you with the disk replacement.

regards

albert
Torsten.
Acclaimed Contributor

Re: Problem restoring a replaced disk

I assume the disk was not mirrored.

If you replaced the disk and the config was restored to it (vgcfgrestore), don't do a pvcreate!

After the vgchange command, just create a new file system and mount it. Now you should restore the data from the backup.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Michael Duthie
Trusted Contributor

Re: Problem restoring a replaced disk

"#mount /data05
- - not a hfs file system
OK - that probably means the disk wasn't initialized. So I tried
#newfs -F hfs /dev/rdsk/c9t5d0
- - /dev/rdsk/c9t5d0 is a logical volume device"

You have "newfs'ed" the physical volume no the logicel volume.

the process is

pvcreate -f /dev/rdsk/cXtXd0

Restore the volume group information.
vgcfgrestore -n /dev/vgXX /dev/rdsk/cXtXd0

Activate the volume group with the new disk.
vgchange -a y /dev/vgXX

Make a new file system on the associated lvols on the volume group.
newfs -F vxfs /dev/vgXX/rlovlX (JFS file system)

Mount the file system or systems.
mount -a

Do a pvdisplay /dev/dsk/c9t5d0 to see what is on the disk. You will see the locical volumes that you restored using vgrestore. Your newfs of the disk "/dev/rdsk/c9t5d0" has probably trashed it.
Michael D. Zorn
Regular Advisor

Re: Problem restoring a replaced disk

Torsten says don't do a pvcreate if I ran vgcfgrestore - I did... Michael Duthie says do - I assume he means if I didn't.

I think what may be getting me in trouble is that /etc/fstab has entries for the FS that were on the disk. /etc/mnttab does not.

Albert asks for output from volume mgmnt commands - I'll attach it.

rayche
Frequent Advisor

Re: Problem restoring a replaced disk

You do not need to be in troule about fstab and mnttab, fstab is used to mount file system automatically when boot system,and mnttab will display which file system is being mounted currently, so pls do according to Tosten's advice, and make sure the lv name and mount point is same as /etc/lvmtab, then run mount all
Albert_31
Trusted Contributor

Re: Problem restoring a replaced disk

Hello Michael,

Checked the data collected and agree with Torsten.. the volume group vgfam is not mirrored and all logical volumes which have their LE/PE's on the disk c9t5d0, have they data lost and you need to restore them.

You can check this using the

# lvdisplay -v /dev/vgfam/ | more

You will notice that all LVOL's which have LE/PE on the c9t5d0 will not be mountable or accessible.

So basically we have to follow the data restoratin steps

# vgcfgrestore -n /dev/vgfam /dev/rdsk/c9t5d0
This will put the LVM headers and LV configs onto the disk. Next you have to do the newfs followed by mounting the LV on the mount points and then restoring data.

# newfs -F -o /dev/vgfam/r

# restore the data from backup.

Regards


Albert
Michael Duthie
Trusted Contributor
Solution

Re: Problem restoring a replaced disk

"Torsten says don't do a pvcreate if I ran vgcfgrestore - I did... Michael Duthie says do - I assume he means if I didn't."

Torsten mean dont pvcreate after a vgrestore, you will blow away what you have just restored.

can you attached a pvdisplay of the disk, all looks in order. a "newfs /dev/vgfam/rlvol3", 4, 5, & 16 may be enough to fix.