- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Script to identify local disks
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
06-01-2004 02:56 AM
06-01-2004 02:56 AM
Script to identify local disks
I own several servers with two internal disks, and I want to automatically mirror my root disk onto another internal disk thanks to a script I wrote which takes a disk device as argument.
The problem is that I do not know how I can determine locally attached disks, as ioscan displays also FC LUNs (when FC paths are scanned). Besides, lssf only displays a HW path, and I don't know how to convert I/O paths into /dev/dsk/cXtYdZ, which is the expected argument to my mirroring script.
Any ideas?
Thank you.
Brian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2004 03:32 AM
06-01-2004 03:32 AM
Re: Script to identify local disks
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2004 03:42 AM
06-01-2004 03:42 AM
Re: Script to identify local disks
If you have emc and local disks. you can see the diff in the h/w path...and it will say something like SYMMETRIX for the frame disks.
disk 4 1/4/0/0.4.0 sdisk CLAIMED DEVICE SEAGATE ST39236LC
/dev/dsk/c4t4d0 /dev/rdsk/c4t4d0
disk 5 1/4/0/0.5.0 sdisk CLAIMED DEVICE SEAGATE ST39175LC
/dev/dsk/c4t5d0 /dev/rdsk/c4t5d0
disk 6 1/4/0/0.6.0 sdisk CLAIMED DEVICE SEAGATE ST39236LC
/dev/dsk/c4t6d0 /dev/rdsk/c4t6d0
disk 686 1/10/0/0.27.19.0.0.0.0 sdisk CLAIMED DEVICE EMC
SYMMETRIX
/dev/dsk/c58t0d0 /dev/rdsk/c58t0d0
disk 687 1/10/0/0.27.19.0.0.0.1 sdisk CLAIMED DEVICE EMC
SYMMETRIX
/dev/dsk/c58t0d1 /dev/rdsk/c58t0d1
disk 688 1/10/0/0.27.19.0.0.0.4 sdisk CLAIMED DEVICE EMC
SYMMETRIX
/dev/dsk/c58t0d4 /dev/rdsk/c58t0d4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2004 04:02 AM
06-01-2004 04:02 AM
Re: Script to identify local disks
I tried something like this:
* ioscan -funC disk
Class I H/W Path Driver S/W State H/W Type Description
=============================================================================
disk 0 0/0/3/0.0.0.0 sdisk CLAIMED DEVICE TEAC DV-28E-B
/dev/dsk/c0t0d0 /dev/rdsk/c0t0d0
disk 1 0/1/1/0.0.0 sdisk CLAIMED DEVICE HP 36.4GMAS3367NC
/dev/dsk/c2t0d0 /dev/rdsk/c2t0d0
disk 2 0/1/1/0.1.0 sdisk CLAIMED DEVICE HP 36.4GMAS3367NC
/dev/dsk/c2t1d0 /dev/dsk/c2t1d0s3 /dev/rdsk/c2t1d0s2
/dev/dsk/c2t1d0s1 /dev/rdsk/c2t1d0 /dev/rdsk/c2t1d0s3
/dev/dsk/c2t1d0s2 /dev/rdsk/c2t1d0s1
disk 183 0/4/1/0.1.16.0.0.0.0 sdisk CLAIMED DEVICE HP OPEN-E
/dev/dsk/c13t0d0 /dev/rdsk/c13t0d0
disk 184 0/4/1/0.1.16.0.0.0.1 sdisk CLAIMED DEVICE HP OPEN-E*3
/dev/dsk/c13t0d1 /dev/rdsk/c13t0d1
disk 185 0/4/1/0.1.16.0.0.0.2 sdisk CLAIMED DEVICE HP OPEN-E*2
/dev/dsk/c13t0d2 /dev/rdsk/c13t0d2
disk 186 0/4/1/0.1.16.0.0.0.3 sdisk CLAIMED DEVICE HP OPEN-E*2
/dev/dsk/c13t0d3 /dev/rdsk/c13t0d3
disk 187 0/4/1/0.1.16.0.0.0.4 sdisk CLAIMED DEVICE HP OPEN-E*2
/dev/dsk/c13t0d4 /dev/rdsk/c13t0d4
disk 188 0/4/1/0.1.16.0.0.0.5 sdisk CLAIMED DEVICE HP OPEN-E*2
/dev/dsk/c13t0d5 /dev/rdsk/c13t0d5
disk 189 0/4/1/0.1.16.0.0.0.6 sdisk CLAIMED DEVICE HP OPEN-E*2
/dev/dsk/c13t0d6 /dev/rdsk/c13t0d6
disk 190 0/4/1/0.1.16.0.0.0.7 sdisk CLAIMED DEVICE HP OPEN-E*2
/dev/dsk/c13t0d7 /dev/rdsk/c13t0d7
(and so on)
I can visually identify local disks /dev/dsk/c2t1d0 and /dev/dsk/c2t2d0, but how can I determine them non interactively? Can I be sure that disks with HW path starting with 0/1/1 are only local disks? Or do I have to deal with ext_bus to make sure that I am browsing a local bus, like in the following example:
* ioscan -funC ext_bus
Class I H/W Path Driver S/W State H/W Type Description
=============================================================================
ext_bus 0 0/0/3/0.0 side CLAIMED INTERFACE IDE Primary Channel
ext_bus 1 0/0/3/0.1 side CLAIMED INTERFACE IDE Secondary Channel
ext_bus 2 0/1/1/0 c8xx CLAIMED INTERFACE SCSI C1010 Ultra160 Wide LVD A6829-60101
ext_bus 3 0/1/1/1 c8xx CLAIMED INTERFACE SCSI C1010 Ultra160 Wide LVD A6829-60101
ext_bus 13 0/4/1/0.1.16.0.0 fcparray CLAIMED INTERFACE FCP Array Interface
ext_bus 14 0/4/1/0.1.16.0.1 fcparray CLAIMED INTERFACE FCP Array Interface
ext_bus 15 0/4/1/0.1.16.255.0 fcpdev CLAIMED INTERFACE FCP Device Interface
ext_bus 16 0/4/1/0.1.24.255.0 fcpdev CLAIMED INTERFACE FCP Device Interface
ext_bus 17 0/4/1/0.1.29.255.0 fcpdev CLAIMED INTERFACE FCP Device Interface
ext_bus 18 0/4/1/0.2.16.0.0 fcparray CLAIMED INTERFACE FCP Array Interface
ext_bus 19 0/4/1/0.2.16.0.1 fcparray CLAIMED INTERFACE FCP Array Interface
ext_bus 20 0/4/1/0.2.16.255.0 fcpdev CLAIMED INTERFACE FCP Device Interface
ext_bus 21 0/4/1/0.2.19.255.0 fcpdev CLAIMED INTERFACE FCP Device Interface
ext_bus 8 0/4/2/0.1.16.0.0 fcparray CLAIMED INTERFACE FCP Array Interface
ext_bus 9 0/4/2/0.1.16.0.1 fcparray CLAIMED INTERFACE FCP Array Interface
ext_bus 10 0/4/2/0.1.16.255.0 fcpdev CLAIMED INTERFACE FCP Device Interface
ext_bus 11 0/4/2/0.1.24.255.0 fcpdev CLAIMED INTERFACE FCP Device Interface
ext_bus 12 0/4/2/0.1.29.255.0 fcpdev CLAIMED INTERFACE FCP Device Interface
ext_bus 4 0/4/2/0.2.16.0.0 fcparray CLAIMED INTERFACE FCP Array Interface
ext_bus 5 0/4/2/0.2.16.0.1 fcparray CLAIMED INTERFACE FCP Array Interface
ext_bus 6 0/4/2/0.2.16.255.0 fcpdev CLAIMED INTERFACE FCP Device Interface
ext_bus 7 0/4/2/0.2.19.255.0 fcpdev CLAIMED INTERFACE FCP Device Interface
And ioscan -Fund c8xx:
pci:wsio:F:F:F:0:0:131072:ext_bus:c8xx:0/1/1/0:16 0 0 33 0 0 0 0 :2:root.sba.lba.c8xx:c8xx:CLAIMED:INTERFACE:SCSI C1010 Ultra160 Wide LVD A6829-60101:2
pci:wsio:F:F:F:0:0:196608:ext_bus:c8xx:0/1/1/1:16 0 0 33 0 87 110 144 :3:root.sba.lba.c8xx:c8xx:CLAIMED:INTERFACE:SCSI C1010 Ultra160 Wide LVD A6829-60101:3
(considering that c8xx is always present within Itanium boxes)?
Or there is maybe a rule that says HW path starting with 0/1, with a "disk" class, is always local?
Thank you for your help.
/Brian.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2004 05:13 AM
06-01-2004 05:13 AM
Re: Script to identify local disks
The thing is, even though most of them are very similar and most of the time the same, they sometimes also differ. Especially, if you have some newer boxes where you have cells.
So, you'll probably have to built some intelligence in your script to determine which server the script is running on, and then depending on the server, what are its local paths.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2004 06:06 AM
06-01-2004 06:06 AM
Re: Script to identify local disks
Jeff Traigle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2004 06:23 AM
06-01-2004 06:23 AM
Re: Script to identify local disks
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2004 08:44 PM
06-01-2004 08:44 PM
Re: Script to identify local disks
It is not a good Idea to make the script decide on the disk automatically. I have a tried and tested script, which will prompt you to input the original disk device and the mirror disk device.
This script works well for HP-UX 11.00 and 11.11 (PA-RISC platforms only). I can forward that script to you if you need it.
Let me know your interest.
Cheers,
Mohan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2004 08:52 PM
06-01-2004 08:52 PM
Re: Script to identify local disks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2004 08:59 PM
06-01-2004 08:59 PM
Re: Script to identify local disks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2004 09:39 PM
06-02-2004 09:39 PM
Re: Script to identify local disks
Thank you for your replies. In fact, I always wondered how Ignite could set internal variable _hp_primary_path to the first internal disk found, as I would have liked to issue the same behaviour to my script.
Mohan, I'd like to have a look at your script. Could you please attach it to a post linked to this thread?
Thank you!
/Brian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2004 12:08 AM
06-03-2004 12:08 AM
Re: Script to identify local disks
Does an output like this help you?:
Disk layout
LVM disk Device file HW Addr size vol. grp
HP 36.4GMAM3367MC /dev/dsk/c1t2d0 0/0/1/1.2.0 34732 /dev/vg00
HP 36.4GMAM3367MC /dev/dsk/c2t2d0 0/0/2/0.2.0 34732 /dev/vg00
It is generated by running "print_manifest" on your machine.
Regards,
Ceesjan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2004 01:11 AM
06-03-2004 01:11 AM
Re: Script to identify local disks
Please find the script attached. It takes the user input for the mirroring.
It may not exactly match your requirement, but it does the mirroring properly.
Cheers,
Mohan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2004 01:15 AM
06-03-2004 01:15 AM
Re: Script to identify local disks
Sorry, there is no attachments with your post!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2004 01:24 AM
06-03-2004 01:24 AM