Monday, May 11, 2009

Setup SAN presentation on Linux

The steps below are to scan for new LUNs from a SAN after the LUNs have been presented from the storage side when using QLogic HBA's . This post uses the QLogic Dynamic Target and LUN Discovery utilities which can be downloaded from:

http://driverdownloads.qlogic.com/QLogicDriverDownloads_UI/SearchByProduct.aspx?ProductCategory=39&Product=935&Os=126

The steps below will work on SUSE Linux Enterprise Server (SLES) 10 and Red Hat Enterprise Linux (RHEL) 5.
You can discover what version of Linux you are on by running:

cat /etc/*ease

Create a directory to hold the utilites. In this examle we will use the /tmp/ql_utils directory:

mkdir /tmp/ql_utils

Change to the /tmp/ql_utils directory:

cd /tmp/ql_utils

Retrieve the utilities from the download above and extract them from the zip file into the /tmp/ql_utils directory.
This will put five files into /tmp/ql_utils:

ql-dynamic-tgt-lun-disc.sh
README.ql-dynamic-tgt-lun-disc.txt
Copying
revision.qldynamic.txt
sg3_utils-1.23.tgz

The file that we are going to be using is the ql-dynamic-tgt-lun-disc.sh file. We need to ensure that it is set to executable:

chmod a+x /tmp/ql_utils/ql-dynamic-tgt-lun-disc.sh


The ql-dynamic-tgt-lun-disc.sh script has several options available. You can see what these options are by running:

/tmp/ql_utils/ql-dynamic-tgt-lun-disc.sh -h

The commands to scan for new LUNs are listed below. After the commands we'll describe what each command does. These commands should be run with root priveledges while inside the /tmp/ql_utils directory.

powermt display dev=all | egrep "Pseudo|Logical" > before
./ql-dynamic-tgt-lun-disc.sh
Please make sure there is no active I/O before running this script
Do you want to continue: (yes/no)? yes
powermt config
powermt display dev=all | egrep "Pseudo|Logical" > after
diff after before
powermt save

The first line outputs the current list of LUNs to the file named before. This is optional, but, makes it easy to see what new LUNs have been discovered later on.
The second line actually does the scan for new LUNs and prompts you to make sure that it's ok to run the script. Answer yes to the prompt.
The fifth line (powermt config) creates the emcpower devices in /dev.
The sixth line outputs the new list of LUNs to the file named after.
The seventh line runs a command to compare the list of new LUNs to the list of old LUNs. The differences will be displayed on screen. Make sure that names of the new LUNs show up in the output.
The last line saves the configuration.

After this is done, the LUNs can be setup with LVM. (see LVM post)

6 comments:

Hara said...

Hi,
Very nice blog.answered most of my questions.

could you please explain , how to
return/release LUNs graciously after removing file system.

On AIX ,using rmdev I delete all LUNS.

Thad said...

Great idea, Hara! I'll type these steps up as soon as I get a spare moment.

Thad said...

I have now added a post on how to remove LUNs from a Linux server.

ayaz pathaan said...

Hi Dear

Can you give the Answer some linux Question

1: If your hard disk has some issues , what are the possible checks you will carry out ?


2: I am not able to get ssh of a remote server . How will i get the console of the server. ( ssh is not working and vnc is also not allowed .) . What is the otherway you can access the server ?


3: What you know about minegetty


4: What will you do if your /tmpfs partition gets full ?


5: What is load average ? What is CPU utilization ? How do they differ ?


6: If your hard disk has some issues , what are the possible checks you will carry out ?


7: What are the reasons as to which a web page does not open ?


8: What will you do if your machine is very high load and the top command is taking too long to give the output ?



9: What is the name of the serivce which is responsile to create the logs / events ?

10: What is sticky-bit?

11: How will you allow a user to login without password

12: Explain DNS troubleshooting steps

13: Have you work on SAN

Advance Thanks

Mohammed Ayaz

Thad Van Ry said...

Ayaz,
The questions that you post seem to be questions that one would encounter in a job interview for a Linux System Administrator position. The questions are pretty basic Linux questions. You can usually find the answer to these by using Google. If you require the knowledge to answer these questions, might I recommend taking an introductory Linux Administrator Course.
Thad

ayaz pathaan said...

Hi, Thad

i have to try to configure yum repository in Centos but not configure properly. i am using yum in my Centos DVD.

Please give me some step how to configure in centos