Operating System - HP-UX
1834277 Members
2305 Online
110066 Solutions
New Discussion

Re: Mirror - change a disk

 
Marco_163
Advisor

Mirror - change a disk

1. What have I to do to change spoiled disk that work in mirror?. I know how to configure a mirror.

2. How to remove a disk that work in mirror from the system. I checked that lvreduce is not enough. What I should to do more?.
Marek
9 REPLIES 9
Victor BERRIDGE
Honored Contributor

Re: Mirror - change a disk

Hi Marco,
Use the search of the technical knowledge base for KBAN00000347,Procedure for replacing an LVM disk in HP-UX 10.x and 11.x
DocId:KBAN00000347
You will have all the information you need

All the best
Victor
Michael_356
Frequent Advisor

Re: Mirror - change a disk

Hi there,

may this Thread will help you:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=5312

Regards

Michael
Fabio Ettore
Honored Contributor

Re: Mirror - change a disk

Hi Marco,

# lvreduce -m 0 /dev/vgXX/lvolX

for each mirrored logical volume.

# vgreduce /dev/vgXX /dev/dsk/cXtXdX

in order to reduce VG from PV to be substituted.

- shutdown the system and replace the disk.
- boot the system and
# vgextend /dev/vgXX /dev/dsk/cXtXdX
# lvextend -m 1 /dev/vgXX/lvolX /dev/dsk/cXtXdX

for each logical volume to be mirrored.

I am supposing that it is not the root/boot volume group.

HTH.

Best regards,
Fabio
WISH? IMPROVEMENT!
Sunil Sharma_1
Honored Contributor

Re: Mirror - change a disk

hi,

1. to change a spoiled mirror disk, first replace faulty disk with new disk, be sure SCSI ID should be same as old so device file will not change.
2. ioscan and see status should be claimed.
3. run vgcfgrestore on disk
4. run vgchange to resynchronise mirror.


To remove a disk from mirrore.
1. lvreduce -m 0
2. vgreduce /dev/vgxx /dev/dsk/cntmd0

now you can remove disk

Sunil
*** Dream as if you'll live forever. Live as if you'll die today ***
Marco_163
Advisor

Re: Mirror - change a disk

It is a boot/root disk.
Marek
bhavin asokan
Honored Contributor

Re: Mirror - change a disk

hi
assuming you are having hot swappable disk.
for reducing the mirror.

try,
1)
lvreduce -m 0 -A n /dev/vgXX/lvolX /dev/dsk/cXtXdX

provided you are having a single mirror .do this for all the LV's in that vg. '-A n' option is to prevent the lvreduce command from performing an automatic vgcfgbackup operation,which is likely to stuck on the defective disk.

2)
replace fauly disk.
do ioscan to insure that faulty disk is accessible (CLAIMED )

ioscan -f /dev/dsk/cXtXdX

3)
vgcfgrestore -n vgXX /dev/rdsk/cXtXdX

for restoring LVM header on the disk.

4)
vgchange -a y vgXX
or
vgchange -a e vgXX (for exclusively activated cluster vgs)

5)

put the mirror back to disk.
lvextend -m 1 /dev/vgXX/lvolX /dev/dsk/cXtXdX &

to check the progress of synchronization you could use
lvdisplay -v /dev/vgXX/lvolX |grep stale |wc -l

regds,




Fabio Ettore
Honored Contributor

Re: Mirror - change a disk

Ahh....then everything is changed.
Have you the ITRC knowledge base acces as Victor suggested you?

In ITRC knowledge base there are the very good procedures in order to replace the boot/root mirror disk.

ULVMKBRC00010386 - How to replace boot disk using LVM mirroring
LVMKBRC00005103 - How to create a Mirrored Boot Disk on PA-RISC Systems - Cookbook

Bets regards,
Fabio
WISH? IMPROVEMENT!
Sยภเl Kย๓คг
Respected Contributor

Re: Mirror - change a disk

#vgcfgrestore /dev/rdsk/cxtxdx -n /dev/vg00
#vgactivate -a y vg00
#vgsync
will do.
# mkboot -a "hpux -lq ;0)/stand/vmunix" /dev/rdsk/cXtYdZ on both mirrors so that quorunm is ignored

regards
SK

Your imagination is the preview of your life's coming attractions
bhavin asokan
Honored Contributor

Re: Mirror - change a disk

if it is a root/boot disk then before doing
lvextend do the folloeing procedure.

1. Write LIF header and LIF files (ISL, AUTO, HPUX, LABEL):
mkboot -l /dev/rdsk/cXtXdX
lifls â l /dev/rdsk/cXtXdX (to ckeck it)

2.Write content of AUTO File (if autoboot is desired)

mkboot -a hpux /dev/rdsk/cXtXdX (autoboot with quroum forced )

mkboot -a 'hpux -lq' /dev/rdsk/cXtXdX
(autoboot without quroum forced)

lifcp /dev/rdsk/cXtXdX:AUTO - (to ckeck it)

3. Install ODE files (may be skipped):

cd /usr/sbin/diag/lif
getconf HW_CPU_SUPP_BITS (the result is either 32, 32/64 or 64)

mkboot -b updatediaglif -p ISL -p AUTO -p HPUX -p LABEL /dev/rdsk/cXtXdX (if 32 or 32/64)

mkboot -b updatediaglif2 -p ISL -p AUTO -p HPUX -p LABEL /dev/rdsk/cXtXdX (if 64)

(the -p option preserves the specified file so that it is not overwritten)


4. Write content of LABEL file,i.e set root, boot, swap and dump device:
note : This step can be omitted if you replace a failed mirror disk. Then this information has already been restored by vgcfgrestore. To be sure to have the latest information on the disk just do the following steps.


# lvlnboot -b /dev//lvol1 (boot)
# lvlnboot -s /dev//lvol2 (swap)
# lvlnboot -r /dev//lvol3 (root)
# lvlnboot -d /dev//lvol2 (dump)

# lvlnboot â v (to ckeck