This form logs you into your management portal account. To access your help desk account, click here and use the form to the right of the news.
Setting Up iSCSI Filesystems
Posted by Kevin Stange, Last modified by Kevin Stange on 24 February 2012 03:23 PM
|
|
This document describes how to set up a new iSCSI mount point on a Linux system. These directions will assume you are running CentOS 5 or 6.
Note: Replace any text in angle brackets (including the brackets) with the value provided or determined earlier in the procedure. For example, you would replace "<TARGET NAME>" with the target name provided by support when your mount point is set up. PrerequisitesPrior to deployment, you need to identify the Initiator Name setting for any systems that will use the SAN. Run the following to get the correct value: # cat /etc/iscsi/initiatorname.iscsi
Provide the result of the command to support, which will allow us to complete the configuration. Once the volume is ready, you'll be given the relevant connection information to use in the following section. A connection to our Internal Network is required for SAN access, so make sure you have arranged for access on any systems you wish to mount your volume to. Configure the iSCSI service to log into the SANYou can check for existing iSCSI sessions by running the following command: iscsiadm -m session tcp: [0] <HOST IP>:3260,1007 <TARGET NAME>
If you are adding a new type of mount (SAN vs SATA) or have not set up any iSCSI mounts before, run these commands: iscsiadm -m node -p <HOST IP>:3260 -T <TARGET NAME> -o new
Enable the iscsi services and start them: chkconfig iscsid on
If the server is already configured with a connection for the specific mount type, then all you need to do is rescan to identify new devices. iscsiadm -m node --rescan
At this point you should be able to view the disk information. The best utility for this is "lsscsi" or you can just browse the output of "dmesg" yum -y install lsscsi
From here, note the device node to be used for partitioning. It would likely be something like /dev/sdb. Set Up PartitioningIn order to avoid the risk of the device node changing names and to allow the filesystem to be enlarged if desired, LVM is recommended. It's easy to set this up. GROUP NAME and VOLUME NAME can be replaced with any name you want to use. If you're not sure, just use "san" as the GROUP NAME, and "0" as the VOLUME NAME. pvcreate /dev/<DEV NAME>
If only one volume is desired, then: lvcreate <GROUP NAME> -n <VOLUME NAME> -l 100%
At this point your device will be available at: /dev/mapper/<GROUP NAME>-<VOLUME NAME>
If you don't want to use LVM, then you'll can either format the whole device or partition it with parted (recommended). parted /dev/<DEV NAME>
If you do this, your partition would become /dev/<DEV NAME>1. If you used LVM, remember the /dev/mapper/ location and use it below. Now, format your partition. In most cases, ext4 is a good choice: mke4fs /dev/<VOLUME>
Add the mount point to the /etc/fstab file. "_netdev" marks the filesystem on RHEL systems to be unmounted before the network is deactivated on shutdown. /dev/<VOLUME> /<MOUNT POINT> ext4 _netdev,defaults,noatime 0 0
Finally, mount it: mount /<MOUNT POINT>
Your new iSCSI filesystem should be ready to use! If you run into any problems, please feel free to contact support for assistance. | |
|