Operating System - HP-UX
1832903 Members
2549 Online
110048 Solutions
New Discussion

Re: Removing disks from system

 
SOLVED
Go to solution
Richard Quinn
Occasional Advisor

Removing disks from system

Hi,
I need to remove 3 disks from a K box here and am wondering if there are any special cleanup tasks that need to be performed - like removing device files or deleting volume groups ... or will a reboot after the disks have been disconnected clean up that for me ?
TIA
Richard.
8 REPLIES 8
Insu Kim
Honored Contributor

Re: Removing disks from system

1. Do vgexport if disks belong to a volume group.

2. Remove special files by running "rmsf -H ".

3. Turn disks off and disconnect them from the system.

Hope this helps,
Never say "no" first.
Santosh Nair_1
Honored Contributor

Re: Removing disks from system

You should do a vgexport or vgreduce to remove the disks from the system. YOu can use 'strings /etc/lvmtab' to find out which disks are on which disk. Then you can remove the disk special files (although not really necessary) by using rmsf.

-Santosh
Life is what's happening while you're busy making other plans
linuxfan
Honored Contributor

Re: Removing disks from system

Hi Richard,

what kind of disks are they? In anycase the general procedure would be to make sure they do not belong to any VG. Quite a few ways to check this,

1. strings /etc/lvmtab |grep cXtYdZ
make sure it doesn't return the disk you want to remove.

2. pvdisplay -v /dev/dsk/cXtYdZ
make sure it says "Couldn't find the volume group to which physical volume ....belongs"

If the disk belongs to any VG, then you should vgreduce the VG to remove this disk
"vgreduce /dev/vgname /dev/dsk/cXtYdZ"

Do the strings /etc/lvmtab, just to make sure.

If these are hot-swappable, at this point you should be able to remove them.

-HTH
Ramesh
They think they know but don't. At least I know I don't know - Socrates
Sanjay_6
Honored Contributor

Re: Removing disks from system

Hi Richard,

If your are removing a complete Vg, do a vgexport and then do a pvcreate -f to wipe ou the disk. Remove the disk.

If you are just removing some disks from the system and the Vg will still be there, do a vgreduce for the disks you want to remove, and then do a pvcreate -f to remove all info from the disk. You can now remove the disk. Do a "rmsf" after reboot if the device files still exist on the system.

hope this helps.

thanks
Wodisch
Honored Contributor

Re: Removing disks from system

Hello,

you might to "pvmove" everything left over on
those disks to the "surviving" ones, first,
then you would "vgreduce" them from their
resp. volume group, and then you could "rmsf"
(or plain "rm") their device files.

HTH,
Wodisch
Deshpande Prashant
Honored Contributor

Re: Removing disks from system

Hi
1. Remove all lv on these disks (lvremove )
2. Reduce these disks from VG (vgreduce vgname pvname)
3. If VG is empty export it out (vgexport )
4.Once machine is rebooted check device files
#lssf /dev/?dsk/c* |grep "???"
All above files can be deleted using rm or rmsf command.

Thanks.
Prashant.
Take it as it comes.
Michael Tully
Honored Contributor
Solution

Re: Removing disks from system

Hi,

To remove the disks you need first to remove
the logical volumes from them, then the volume
groups completely if these disks form the
entire volume group. If they are put of a
group you wish to keep, just remove them from
the group.
If you are needing to use the information
elsewhere use vgexport.

Run ioscan to find the hardware path of the
disks
# ioscan -fnkC disk (note the path of the
disks to be removed)
# lvremove /dev/yourvg/yourlv
# vgreduce /dev/dsk/cXtXdX (for each disk
except for the last one if you are removing
the group)
# vgremove /dev/yourvg
# vgexport -m mapfile.yourvg -v /dev/yourvg
(If your using the disks elsewhere in the same
volume group on a different system)
# rmsf -H 0/0/2/1.6.0 (example)
Turn system off and remove disks.

HTH
-Michael
Anyone for a Mutiny ?
Sridhar Bhaskarla
Honored Contributor

Re: Removing disks from system

Richard,

First find out the device files for the system. say c6t0d0,c6t0d1. Use ioscan -fnC disk to find them through their path.

Check whether they are part of any volume group

If so, find out the logical volumes on it

#pvdisplay -v /dev/dsk/c6t0d0

For all the logical volumes you found on these disks, either pvmove them to other disks or take a backup of the logical volumes and then do lvremove on these logical volumes

Once the logical volumes are taken care, you can reduce them from the volume groups

vgreduce vg01 /dev/dsk/c6t0d0

Once they are out of lvmtab (strings /etc/lvmtab |grep c6t0d0 ) then you are good to go.

If all these disks comprise of a volume group, then you need to export the volume group.

vgexport vg01 (don't do this if they are only part of this volume group and if there are other disks in this volume group that you don't want to remove).

then you can do an rmsf -H H/W path to take the device file off.

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