HPE 9000 and HPE e3000 Servers
1827405 Members
5344 Online
109965 Solutions
New Discussion

2 box with common disks

 
Joeriz Agtay
Occasional Contributor

2 box with common disks

Scenario:
I have 2 N-Class connected to 1 common disk subsystem. I created a volume group on N-A with filesystem and put some data in it. Now I want it to be seen on N-B at some point. I don't mind even if only 1 at a time. I know that it can only be possible 1 at a time as it can not serve 2 masters. When I check, the device files pointing to those disks are different between 2 N-class ie for disk with on both N-class with HW Addrs 8.0.0.12.0
N-A = /dev/rdsk/c6t7d0
N-B = /dev/rdsk/c7t7d0
Q:
a. How can I mount those FS on N-B?
b. How can I make the device file of disks the same on both machine?
There's always a solution for everything
2 REPLIES 2
A. Clay Stephenson
Acclaimed Contributor

Re: 2 box with common disks

Hi Joeriz:

Before I answer your question, I think we have a big problem.
I notice that both of your DISK devices are cxt7d0. (t7 - SCSI ID 7 is normally used for the controller)
You didn't mention any details of your cabling so I'm going to assume it's one SCSI buss and not an alternate and primary path situation.

I would set it up this way:
N-A SCSI Controller ID 7 - Terminated
Disk ID 5
Disk ID 4
....
....
N-B SCSI Controller ID 6 - Terminated

It does not matter that the controller's are c6 in one machine and c7 in the other. You can change that using mknod but I would bother and it would probably lead to future confusion.

Now with this convention,
The disks would be /dev/rdsk/c6t5d0 and /dev/rdsk/c6t4d0 on machine A and
/dev/rdsk/c7t5d0 and /dev/rdsk/c7t4d0 on machine B.

After you get your volume group configured on machine A, do this: (I'll call the volume group vg05 in this example)

1) vgexport -p -v -m /tmp/vg05.map /dev/vg05

This will preview (but not actually export the volumes in this group and create a mapfile describing the logical volumes)

2) vgchange -a n /dev/vg05

3) ftp /tmp/vg05.map to Machine B

4) cd /dev/vg05
ls -l group
you should see an entry like this
cr--r--r-- 1 root sys 64 0x050000
The digits you should pay attention to are the 2 after the 0x in the minor device number. In this case 02. I like to match those on the target machine.

On Machine B:
5) cd /dev
mkdir vg05
chown root:sys vg05
chmod 555 vg05
cd vg05
mknod group c 64 0x050000
chmod 444 group
chown root:sys group
Note the 0x05 (that's the number we got from Machine A.) Make certain that none of the other volume groups have a group file entry on Machine B with the same minor device number!!

Now we will import the disks
6) vgimport -m /tmp/vg05.map -v /dev/vg05 /dev/dsk/c7t5d0 /dev/dsk/c7t4d0

7) Activate the volume group.
vgchange -a y /dev/vg05

8) You can then mount the logical volumes on machine B.

Obvoiusly you have to be very careful to make sure that both machines do not mount the disks.

You will need to edit /etc/lvmrc and set AUTO_VG_ACTIVATE=0 and and customize the activation. You will also need to not automatically mount in /etc/fstab.

If you are doing what I think you are doing, you really should look into MC/ServiceGuard; it's built to handle transfer of disks and network addresses when a machine fails.

Regards, Clay


If it ain't broke, I can fix that.
Glen Hyatt
New Member

Re: 2 box with common disks

Joeriz / Clay,

It is imperative if there are 2 SCSI Controllers connected on a single bus to make sure the SCSI ID of the controllers are set to different ID's. By default, as you point out Clay, the Controller has an ID of 7. If you connect a device to 2 hosts, you must ensure that all SCSI ID's are unique, so on one of the systems, change the ID to something else (Usually set to 6) Without this change, you are in effect setting 2 devices to the same ID on the scsi bus - Never a good idea.

eg: You should have something like this.
SCSI Adapter NA SCSI=7
SCSI Adapter NB SCSI=6
Disk Device A SCSI=1
Disk Device B SCSI=2

To alter the SCSI Id of your adapter, you need to do this from the boot menu.

1. Power on your machine, then interupt the auto boot.

2. use the SCSI commands to view/change.

To View the SCSI adapters, use "scsi init"

this will show something like..

PCI device /5.4 = 7
PCI device /5.5 = 7

Choose the appropriate SCSI adapter, and use the following command to alter the SCSI ID.

scsi init 5 4 6
(ie: Bus 5, Slot 4, SCSI ID 6)

Check to see if it's OK

scsi init

PCI device /5.4 = 6
PCI device /5.5 = 7

Now boot your system.
You can check your success using ioscan -fn

Glen.