- Integrated Systems
- About Us
- Integrated Systems
- About Us
06-27-2020 09:34 PM
How to change disk name in HP-UX 11.31
As per database team requirement, I need to change disk path name at DC2 site. Here some disks are presented to DC-1 OS from EMC storage. They will create oracle cluster between DC-1 and DC-2 server. Here mention that DC-1 storage and DC-2 storage is active-active. Here OS is HP-UX 11.31
Suppose DC-1 OS has disk50, disk51, disk52 from EMC storage . This same disk is also presented to DC-2 OS but it has disk71, disk72,disk73. So we need to change disk from disk71, disk72,disk73. to disk50, disk51, disk52.
Please suggest how to solve this . We are statying at critical state for this.
Hopefully response from expert end.
06-28-2020 09:42 AM
Re: How to change disk name in HP-UX 11.31
I assume this is for use with Oracle ASM yes?
If so, then the best thing to do is not use those disk devices at all, but create your own using the mknod command that can be used just for Oracle. That way you can make sure they match between systems and you can be sure that the permisssions on the devices don't get changed if someone runs the "insf" command on the system (or after a reboot). Here's what I would do on both systems (in my example I don't have any extra disk attached to my system, so I'll use the two internal disks /dev/rdisk/disk3 and /dev/rdisk/disk4 - you'll need to use the correct ones for each node.
1. Identify the device major and minor numbers of the disks in question:
# ls -l /dev/rdisk/disk3 /dev/rdisk/disk4 crw-r----- 1 bin sys 13 0x000000 Jun 6 18:31 /dev/rdisk/disk3 crw-r----- 1 bin sys 13 0x000001 Jun 6 18:31 /dev/rdisk/disk4
So here I can see that disk 3 has a major number of 13 and a minor number of 0x000000 while disk4 has a major number of 13 and a minor number of 0x000001.
The major number identifies the device type - you can look it up using the lsdev command if you like - on my system major number 13 corresponds to the esdisk driver:
# lsdev -c 13 Character Block Driver Class 13 1 esdisk disk
The minor number identfies the drive - this will be a hex interpretation of the disk hardware path - don't worry about how it is constructed, just make a note for both your disks.
2. Now create some new device files for your disks specifically for ASM - I like to create a whole new directory for this, especially for Oracle. You then use the mknod command which has arguments as follows:
mknod <device_name> <device_type> <device_major_number> <device_minor_number>
where <device_name> is the new device name I want to create, <device_type> is a block or character device (ASM expects to use a raw character device, not a block device so we use 'c' rather than 'b') and then those major and minor numbers we created. So here's all my commands:
# mkdir /dev/asm # chmod 755 /dev/asm # ll -d /dev/asm drwxr-xr-x 2 root sys 96 Jun 28 17:24 /dev/asm # mknod /dev/asm/asmdisk1 c 13 0x000000 # chown oracle:dba /dev/asm/asmdisk1 # chmod 640 /dev/asm/asmdisk1 # mknod /dev/asm/asmdisk2 c 13 0x000001 # chown oracle:dba /dev/asm/asmdisk2 # chmod 640 /dev/asm/asmdisk2 # ll /dev/asm total 0 crw-r----- 1 oracle dba 13 0x000000 Jun 28 17:25 asmdisk1 crw-r----- 1 oracle dba 13 0x000001 Jun 28 17:28 asmdisk2
And to prove to myself that this has worked I can now run an ioscan command and look for my new devices listed with the correct disk (I have snipped this output a bit to make it clearer):
# ioscan -funNCdisk Class I H/W Path Driver S/W State H/W Type Description =================================================================== disk 3 64000/0xfa00/0x0 esdisk CLAIMED DEVICE HP 73.4GST373454LC /dev/asm/asmdisk1 /dev/rdisk/disk3 /dev/disk/disk3 disk 4 64000/0xfa00/0x1 esdisk CLAIMED DEVICE HP 73.4GST373454LC /dev/asm/asmdisk2 /dev/rdisk/disk4 /dev/disk/disk4
Remember to repeat this process on the other nodes and use the correct major/minor device numbers on both (they will likely not be the same) until you can see your devices listed correctly on both nodes from an ioscan.
Then tell your Oracle team to set the Oracle ASM parameter ASM_DISKSTRING to /dev/asm - this will ensure that ASM looks under /dev/asm for disks rather than under /dev/rdisk - Then your Oracle team get to have consistent device names across nodes, and you get to ensure that the Oracle team don't accidentally write over the system disk! (been there done that!)
Hope that helps.
I am an HPE Employee