A P P E N D I X  F

Configuring a Linux Server

This appendix provides LUN setup information needed when you connect a Sun StorEdge 3310 SCSI array to a Linux OS. For a list of supported adapters, refer to the release notes of each array.

This information supplements the configuration steps presented in Chapter 4 and covers the following steps:

F.1 Checking the Adapter BIOS

When booting the server, watch for the host bus adapter (HBA) card BIOS message line to show up and then press the proper sequence of keys in order to get into the HBA BIOS: Key strokes for SCSI Adaptec cards = <Ctrl><A>.

The key strokes are listed on the screen when the adapter is initializing. After you enter the Adaptec HBA BIOS with <Ctrl><A>, perform the following steps.

1. Highlight Configure/View Host Adapter Settings and press Return.

2. Go to Advanced Configuration Options and press Return.

3. Go to Host Adapter BIOS and press Return.

a. Select disabled:scan bus if this is not going to be a bootable device.

b. If it is going to be bootable device, select the default Enabled. The * represents the default setting.

4. Press Esc until you get back to the main options screen where Configure/View Host Adapter Settings was located.

5. Highlight SCSI Disk Utilities and press Return.

The BIOS scans the SCSI card for any SCSI devices attached to the HBA.

The HBA's SCSI ID is displayed, as well as any other SCSI devices attached to the HBA. If you see only the HBA's SCSI ID, then something is not correct with the configuration on the SCSI attached device, or the cable between the HBA and the SCSI device is bad or not attached.

6. If you are satisfied with the configuration, press Esc.

A confirmation prompt asks you if you want to exit the utility.

7. Select Yes and press Return.

A confirmation prompt is displayed:

Please press any key to reboot.

8. Press any key.

The server reboots.

Repeat this procedure for every HBA that is going to be attached to the Sun StorEdge 3310 SCSI array.

F.2 Multiple LUN Linux Configuration

By default, the Linux kernel does not support multiple LUNs. To support multiple LUNs, modify the kernel with the following steps.

1. Log in as root, or su to root if you are logged in as a user.

2. Add this line to the end of /etc/modules.conf file and save the file.

options scsi_mod max_scsi_luns=255

3. At the system prompt, enter this command and press Return:

mkinitrd -f /boot/initrd-2.4.9-e.3.img 2.4.9-e.3 

The 2.4.9-e.3 entries refer to the current kernel. To find out your current kernel, type uname -r and substitute your kernel information in place of the 2.4.9-e.3 entries.

4. Reboot the server.

To halt the server completely, use shutdown -h. To reboot automatically after the shutdown is complete, use shutdown -r.

F.3 Making an ext3 Filesystem for Linux

The following procedure to label and partition drives using fdisk applies to an ext3 filesystem. To discover which disk you want to label, you must find out what device it is.

1. To list all devices and their paths, start a terminal session and type:

# fdisk -l

Record the device name(s) and path(s) which you plan to use.

2. Then type:

# fdisk /dev/sd(x) x= a,b,c,...

A banner appears for the specified array device. The last statement displays a prompt Command (m or help):

3. Type m or help.

4. On the displayed menu, select n for the Command action and press Return.

Two choices are displayed:

e extended

p primary partition (1-4)

Only four primary partitions are allowed per array. All additional partitions must be added as extended LUNs under one primary partition. Only one primary partition is allowed to have extended LUNs.

5. For the first partition, choose p.

When several options appear, keep the defaults. You can reconfigure this after you understand the process and see what it looks like. Add additional primary partitions and extended partitions as needed.

6. After you have completed accepting the defaults and are back at the Command (m or help): screen, press w to save the configuration and exit fdisk.

Your partition is ready for a filesystem now.

F.4 Creating a Filesystem

1. Log in as root, or su to root if you are logged in as a user.

2. Take the device that you ran fdisk on and run the following command to create an ext3 filesystem:

# mkfs -t ext3 /dev/sdb(x) 

where x = the partition that you want to have become a filesystem. Replace x with 1 since there is only one partition.

F.5 Creating a Mount Point and Mounting the Filesystem Manually

1. Go to the directory where you want to create a directory to use as the mount point.

2. Type this command:

# mkdir name

3. To mount your filesystem, type the following:

# mount /dev/sdb(x) /directory path

where x = 1 for this partition.

F.6 Mounting the Filesystem Automatically

You can label the partition so that it can be entered in the fstab file for mounting the partition automatically at bootup. The use of the label and fstab file is a faster operation than mounting the filesystem manually with a device path.

1. Type the following command to add a label to the partition:

# e2label /dev/sdb(x) /directory_path

where x = 1 for this partition and the directory path is the directory that was created and where it is located.

2. Edit the /etc/fstab file and add the following line:

# LABEL=/mount/point /mount/point ext3 1 2

3. Save the file.

4. To check to see if fstab was set up correctly, type:

# mount -a

If the mount point and the fstab file are correctly set up, no errors appear.

5. To verify it is mounted and list all mounted filesystems, type:

# df -k

6. To unmount the filesystem, type:

# umount /filesystem_name