Wednesday, July 6, 2011
How to temporarily prevent a Suse linux server from "seeing" it's array on reboot
In this scenario we have a Suse linux host with two HBA fibre controllers installed. Each HBA is connected via fibre to a separate Brocade SAN switch. Then from each SAN switch we have a fibre connection to separate controllers on a DS4300 disk array.
All the operating system files are stored on local disks and only applications and data are stored on the array.
There were some errors with the linux server and we wanted to temporarily remove the array and then reboot the linux server to see whether the errors disappeared, however this was not to be a complete removal of LUNs and Volume Groups from the linux box as the array needs to be back after the test.
The quickest way to prevent the linux server from "seeing" the array was to disable the port on the SAN switch that is connected to the array.
However firstly we need to ensure that all filesystems mounted onto LUNs mapped out from the array are unmounted
To do this we must ensure that all filesystems to be unmounted are quiescent, and therefore any applications referencing these filesystems must be stopped.
Then to unmount the filesystems type umount /filesystem where /filesystem is to be replaced with your mounted filesystem name.
It is a good idea then to deactivate the volume groups that contain array LUNs.
To deactive the volume groups type vgchange -a n /dev/vg_name for each volume group, where /dev/vg_name is to be replaced by your volume group name.
We are going to reboot the linux server so these changes need to be made such that the linux server does not try to activate volume groups with non existent LUNs and mount non existent filesystems on the way up.
To prevent the linux server automatically mounting filesystems we need to edit /etc/fstab. (It is a good idea to make a copy of this file prior to any modifications).
Then edit /etc/fstab ensuring to comment out all filesystems containing LUNs on the array.
Next we need to prevent the activation of volume groups containing array LUNs.
To do this edit the file /etc/sysconfig/lvm, and between the quotes of the LVM_VGS_ACTIVATED_ON_BOOT="" variable add only the volume group you want to be activated. In our case we only want the system volume group on the local disks to be activated. This is called sysvg so our variable will look like the following LVM_VGS_ACTIVATED_ON_BOOT="sysvg".
We are now ready to disable the port on the SAN switch, make sure that no other arrays are using the port then on the switch typeportdisable portnum where portnum will be the number of your port i.e. 3.
Disable the ports on both switches.
Now we can reboot the linux server, type init 6 and hopefully it will come back up without the array being presented.
To present the array back to the Suse linux server just reverse the above procedure