Operating System - HP-UX
1833813 Members
3344 Online
110063 Solutions
New Discussion

Re: How to remove a disk?

 
GBR
Regular Advisor

How to remove a disk?

I would like to remove a 34G disk from my HP-UX server, but before I do how can I confirm that it is not being used?

I will reward points.

Thanks,
GBR
15 REPLIES 15
Torsten.
Acclaimed Contributor

Re: How to remove a disk?

Get the device file and check if it is in use by LVM.

search in
/strings/lvmtab or vgdisplay ...

inspect the disk
pvdisplay -v ...

Ask yourself or your documentation if the disk is in use directly without LVM, maybe directly as a raw device.

If needed, remove the disk from LVM (vgreduce/vgremove) and the device files too (rmsf). Finally remove the disk.

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!   
Pete Randall
Outstanding Contributor

Re: How to remove a disk?

The real danger here is if the disk is in use as a raw device, typically used for a data base. How you detect that will depend on the type of data base and how the raw devices are defined to it. Check your system documentation, check with your DBA, check with any other admins who might have knowledge concerning this system. In other words, proceed with caution.


Pete

Pete
MarkSyder
Honored Contributor

Re: How to remove a disk?

sam -> filesystems and disks -> disks

will show you if the disc is in a VG.

bdf -l will tell you if there are any filesystems on the VG. If there are and you are not sure if they are used:

cd /suspect_filesystem
find . -atime -7 -print

will give you a list of files in the suspect filesystem that have been accessed within the last week (but note that backing up to tape counts as access).

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
MarkSyder
Honored Contributor

Re: How to remove a disk?

Torsten and Pete raise a good point that I had overlooked. If you are using a database, please igonre my suggestion.

Mark
The triumph of evil requires only that good men do nothing
Torsten.
Acclaimed Contributor

Re: How to remove a disk?

And there are not only databases.

Some admins are using "dd" to create an emergency copy of the (boot) disk, some have HPVM installed ... to be sure you NEED to have a good documentation of your setup.

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!   
GBR
Regular Advisor

Re: How to remove a disk?

The disk in question belongs to no VG. Does that still mean something may be using it?
Pete Randall
Outstanding Contributor

Re: How to remove a disk?

Are you running a DB? Oracle? Informix? Sybase? Or some other? If you are, then there is a fairly strong possibility that the DB may be using the disk as a raw volume, either through LVM or natively.


Pete

Pete
GBR
Regular Advisor

Re: How to remove a disk?

We're running on HP OVO Oracle db. I'm not sure how to tell though if the db is attached to the disk.
Geoff Wild
Honored Contributor

Re: How to remove a disk?

And what if he is running VXVM and not lvm?

Check with vxdiskadm

Also, look at sar data - is there any i/o on the disk itself?

sar -d

Make sure you have good backups...

Then, shut the server down, pull the disk....reboot...

Is everything working?

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
GBR
Regular Advisor

Re: How to remove a disk?

Doing a sar -d 5 5, and sar -d 2 10 gives no activity on the disk in question. So is there anything else I can do before I pull the disk out?
John Carr_2
Honored Contributor

Re: How to remove a disk?

make sure you backup the disk and more importantly that you verfiy the contents of the media you have completed the backed.
A. Clay Stephenson
Acclaimed Contributor

Re: How to remove a disk?

Sadly, it's almost impossible to know that a disk is not being used. It's very easy to know that a disk is in use but it is very, very difficult to know that it is not being used. The common use is by databases and you can write SQL scripts to identify them but there could be many applications which use raw devices as well --- and the only way to know is to examine the applications themselvers. Fortunately, this type of usage is rare but the only way to protect yourself from harm is to document, document, document. This is one of those cases that if you have to ask then it's too late because the documentation doesn't exist. Now having said all of this, if the disk is not being used by LVM or VxVM, it's not being used as a swap device, it's not being used as a lifeboat boot disk, and not being used as a database device (and OV/O by default uses cooked files for its Oracle data) then you are probably safe.
If it ain't broke, I can fix that.
Bill Hassell
Honored Contributor

Re: How to remove a disk?

There's three ways to find out about raw volumes (once you have ruled out any association with :

- check in /etc/fstab for swap referring to the raw devicefile. If found, you'll need to remove the entry in fstab then reboot sometime in the future. You cannot remove swap space from a running system as it is permanently assigned at bootup.

- check with your database administrator. Configuring Oracle will require knowing which disks are used and in which manner (ie, taw for filesystem).

- and the guaranteed-to-work method: pull out the disk and look for errors. It seems brutal but there's no other way once the above methods have been tried.


Bill Hassell, sysadmin
A. Clay Stephenson
Acclaimed Contributor

Re: How to remove a disk?

... and even the "yank the disk and look for errors (or loud user screams)" is not foolproof because if the mystery application is not in use at the time of removal then there will be no screams (until later).

My method of dealing with this is when a disk/LUN is first made available to a system (and even if I know that I am immediately going to use this disk under LVM, for example) I run a small C program that writes an 80-byte string and then a series of increasing 4-byte integers to the 1st 1MiB of the disk. If that pattern is undisturbed then I have a very good indicator (though not foolproof) that the disk has not be in use. Of course, in addition to this, I also document the usage.
If it ain't broke, I can fix that.
GBR
Regular Advisor

Re: How to remove a disk?

Thanks everyone.