- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to tell if a disk is being utlised as a raw de...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2006 02:08 AM
05-17-2006 02:08 AM
Question I guess is self explanitory as per the title.
What I am looking for is lets say somebody gives me a device file of a disk. In that moment how can I see if that disk is being used as a raw device or not?
Many thanks as always
Mark
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2006 02:12 AM
05-17-2006 02:12 AM
Re: How to tell if a disk is being utlised as a raw device or not.
Mark Syder (like the drink but spelt different)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2006 02:15 AM
05-17-2006 02:15 AM
SolutionThe answer to your question is to document, document, document and to know the applications that run on your box. It's also a good idea to do something like write a very recognizable bit-pattern to the 1st MB or so of the disk. If you later examine that same disk and the data are unchanged then it's a good bet that the disk is not used.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2006 02:34 AM
05-17-2006 02:34 AM
Re: How to tell if a disk is being utlised as a raw device or not.
strings /etc/lvmtab
and in the display u will get the list of volume groups and the associated device..
ricky
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2006 02:43 AM
05-17-2006 02:43 AM
Re: How to tell if a disk is being utlised as a raw device or not.
*Only* physical disks used by LVM are recorded in '/etc/lvmtab'. Then too, if the volume group built from the physical disk has *not* been 'vgimport'ed (or conversely, has been 'vgexport'ed) then no record will exist in '/etc/lvmtab'.
There are ways to read the LVM header (if any) and thus ascertain that the physical disk is an LVM disk, but as Clay noted, the only way to truly know that you have a raw device in use is to *document* it!
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2006 02:47 AM
05-17-2006 02:47 AM
Re: How to tell if a disk is being utlised as a raw device or not.
Well we've never used raw disks but I wonder if
lsof /dev/rdsk/cXtYdZ
or
lsof /dev/dsk/cXtYdZ
would yield any results?
Seems to me if a process had the device file open then lsof ought to see that.
EVERYTHING in UNIX is a file & that includes devices, pipes & sockets.
My $0.02,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2006 03:04 AM
05-17-2006 03:04 AM
Re: How to tell if a disk is being utlised as a raw device or not.
The least evil method that I have been able to come up with over the years is to write a known pattern of data to a disk when I first get it and then to look for that same pattern before I use it. I do this with EVERY disk/LUN I get when it is first installed or initialized --- even if I know that I am going to use it immediately. I prefer code (even that inside my head) that does not branch.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2006 03:09 AM
05-17-2006 03:09 AM
Re: How to tell if a disk is being utlised as a raw device or not.
Basically there is not good way to know what drives is use as a raw device, the best way is to ask your DBA to see what devices he is using.
The other way aroung might be using the fstyp command to see if the devices show an HFS file system or vxfs file system, if it shows something else like unknown, chances are it's a raw device.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2006 04:30 AM
05-17-2006 04:30 AM
Re: How to tell if a disk is being utlised as a raw device or not.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2006 04:57 AM
05-17-2006 04:57 AM
Re: How to tell if a disk is being utlised as a raw device or not.
first I would check the write permissions of the devicefile. If only root can write to it, it most likely does not belong to a database, because usually a database is running under a diffrent user (but no 100% guarantee).
Run a find for all symlinks on the entire system doing a "ls -l" for these and spool the result to a file. grep for the devicefile afterwards. Usually it is good practise to use a symlink instead of the direct raw-device name, so you can reconfigure without bothering reconfiguration inside the DB.
If you have symlinks pointing to this device this is a potential indication that someone is using it.
In addition you should check for unaccounted lvols on that disk. pvdisplay would be a starter for this to check if there are lvm-structures on it.
Volker