1847254 Members
4228 Online
110263 Solutions
New Discussion

remove disk from vg

 
SOLVED
Go to solution
Marton Ferenc
Advisor

remove disk from vg

Hello,

I have a vg with mirrored lvs and i want to remove one of those disks. how can i do that?

bash-2.03# lvlnboot -v /dev/vg00
Boot Definitions for Volume Group /dev/vg00:
Physical Volumes belonging in Root Volume Group:
/dev/dsk/c1t15d0 (0/0/1/1.15.0) -- Boot Disk
/dev/dsk/c4t0d0 (0/4/0/0/4/0.0.0)
/dev/dsk/c4t1d0 (0/4/0/0/4/0.1.0)
Boot: lvol1 on: /dev/dsk/c1t15d0
/dev/dsk/c4t0d0
Root: lvol3 on: /dev/dsk/c1t15d0
/dev/dsk/c4t0d0
Swap: lvol2 on: /dev/dsk/c1t15d0
/dev/dsk/c4t0d0
Dump: lvol2 on: /dev/dsk/c1t15d0, 0

i want to remove c1t15d0 disk, thanks.
J5000
5 REPLIES 5
Ashwani Kashyap
Honored Contributor

Re: remove disk from vg

c1t15d0 is theonly bootable disk you have .
Before removing it make another disk bootable first . then boot from that disk .
then you can remove c1t15d0 .
Jeff Schussele
Honored Contributor
Solution

Re: remove disk from vg

Hi Marton,

1) Remove the disk for all the LVs
lvreduce -m 0 /dev/vg_name/lv_name /dev/dsk/c1t15d0 # Do for ALL mirrored LVs in that VG

2) Remove the disk from the VG
vgreduce /dev/vg_name /dev/dsk/c1t15d0

3) Since it appears this is probably the primary boot disk you'll want to set the other as the new primary
setboot -p 0/4/0/0/4/0.0.0

4) Since Dump is only defined on c1t15d0 - you'll need to set Dump to c4t0d0 after removeing c1t15d0
lvlnboot -d /dev/vg00/lvol2

5) Check the new config - verify root/boot/swap/dump are all setup properly on c4t0d0
lvlnboot -v

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Bernhard Mueller
Honored Contributor

Re: remove disk from vg

Hi,

be careful, are you sure you want to remove your *only* bootdisk???

The other disks in vg00 are not boot disks, lvlnboot -v would have told you if they were bootable. If that is the complete output of lvlnboot -v, you do not have another vg with a bootable disk from which you currently booted.

So if you want to mirror to the c4 disks and be able to boot off one of them you need to make them boot disks (pvcreate -B, mkboot).

Search for docs/thread on how to mirror boot disks. Guess you may want to start from scratch.

otherwise you use lvreduce -m 0 /dev/vg00/lvolXYZ /dev/dsk/cXtYdZ for all lvols on any disk you want to get free, (pvdisplay will tell you what's on the disk)

If no LEs are on a disk you can vgreduce vg00 /dev/dsk/cxtydz.

note: you may also want to use setboot to change boot paths.

Regards,
Bernhard
Sridhar Bhaskarla
Honored Contributor

Re: remove disk from vg

Hi,

Your mirroring is not correct. c1t15d0 is only the boot disk you have. If you remove it, you will not be able to boot the system again later.

First make sure, the mirroring is correct. c4t0d0 should appear as a "Boot Disk" in your lvlnboot output. There are many posts here that will point you to correct procedure.

Test the mirroring by booting the system from the other disk.

Before doing anything further, make sure you have a good working make_tape_recovery tape.

Once the above is taken care, then reduce all the logical volumes from c1t15d0 and then reduce the disk from vg00. You can find all the lvols by "pvdisplay -v /dev/dsk/c1t15d0" For each logical volume do

#lvreduce -m 0 /dev/vg00/lvolx /dev/dsk/c1t15d0
#vgreduce vg00 /dev/dsk/c1t15d0

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

Re: remove disk from vg

Hi (again) Marton,

Ashwani's correct!
You need to see -- Boot Disk
next to c4t0d0 on those top lines for it to truly be a boot disk.

BEFORE YOU REMOVE c1t15d0 you need to redo the steps to make it *truly* bootable.

1) Do the earlier steps - BUT this time do them on c4t0d0
2) Then recreate it as bootable
A) pvcreate -fB /dev/rdsk/c4t0d0
B) vgextend vg00 /dev/dsk/c4t0d0
C) mkboot -l /dev/rdsk/c4t0d0
D) mkboot -a "hpux" /dev/rdsk/c4t0d0
E) lvextend -m 1 /dev/vg00/lv_name /dev/dsk/c4t0d0 #Do for ALL LVs in vg00
F) Recheck the new config
lvlnboot -v # If it nows displays properly you can proceed with removing c1t15d0

Rgds,
Jeff

PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!