Categories
Software

iSCSI on Ubuntu 9.04

The following section is a brief overview of “How to Install iSCSI on Ubuntu”, and is intended as a reference.

These instructions were done as a guide to set up a test environment.

If you see anything that is in “error” or would like to have something added, please feel free to contact us.

– Andrew

The following section is for the basic installation of the Ubuntu Operating System and needed Services to get iSCSI running.

During these installations, the Default values should be used.

Install the Base Operating System

For this installation, we used the Desktop version of Ubuntu 9.04, which can be downloaded from the main Ubuntu website.

  1. Download the ISO installation file;
  2. Create an Installation CD;
  3. Boot the Target Computer from the Installation CD;
  4. Install the Default Ubuntu Desktop;

Install DHCP (dhcp3-server)

The following installation is done from the Terminal Window (aka – Command Line), and must be done with root/sudo access to the system.

  1. Open a Terminal Window/Command Line session;
  2. Type in the following:
sudo aptitude install dhcp3-server
  1. Select or OK the Default settings.

Install TFTP (tftpd-hpa)

The following installation is done from the Terminal Window (aka – Command Line), and must be done with root/sudo access to the system.

  1. Open a Terminal Window/Command Line session;
  2. Type in the following:
sudo aptitude install tftpd-hpa
  1. Select or OK the Default settings.

Install iSCSI (iscsitarget)

The following installation is done from the Terminal Window (aka – Command Line), and must be done with root/sudo access to the system.

  1. Open a Terminal Window/Command Line session;
  2. Type in the following:
sudo aptitude install iscsitarget
  1. Select or OK the Default settings.

Update the System

At this point, run the Update Manager, and Reboot the System.

From the top menu bar, select the following:

System > Administration > Update Manager

You will be prompted for the root/sudo password to apply any and all updates.

 

 

 

The following section is for the basic installation of the Ubuntu Operating System and needed Services to get iSCSI running.

During these installations, the Default values should be used.

 

Configuring Static Address

It is general “Best Practice” to set up Servers with a Static IP address.

Caution — Backup config files BEFORE Editing them!

The main file that you will be working with is, and you will need sudo/root access to this file:

/etc/network/interfaces

To Backup the original config file:

sudo cp /etc/network/interfaces /etc/network/interfaces.bak

To Edit the file:

sudo gedit /etc/network/interfaces

These settings are going to be uniques to your environment, and is beyond the scope of this document.

Once you have configured your IP Address set, you will need to restart the Service:

sudo /etc/init.d/networking restart

 

Configuring DHCP

Caution — Backup config files BEFORE Editing them!

The main file that you will be working with is, and you will need sudo/root access to this file:

/etc/dhcp3/dhcpd.conf

Backup the original config file:

sudo cp /etc/dhcp3/dhcpd.conf /etc/dhcp3/dhcpd.conf.bak

Now to Edit the file:

sudo gedit /etc/dhcp3/dhcpd.conf

These settings are going to be uniques to your environment, and is beyond the scope of this document.

Once you have configured your DHCP server, you will need to restart the Service:

sudo /etc/init.d/dhcp3-server restart

Additional Useful Commands

To manually start the DHCP Service:

sudo /etc/init.d/dhcp3-server start

To get DHCP Service to Autostart:

sudo update-rc.d dhcp3-server defaults

To check DHCP leases:

gedit /var/lib/dhcp3/dhcpd.leases

To Verify that the Server is listen for Clients:

sudo netstat -uap

To check Log files:

gedit /var/log/messagesgedit /var/log/syslog

 

Configuring TFTP

Generally, when TFTP (tftpd-hpa) is installed, the installation will add the correct lines of configuration code, but if you would like to check (or add) use the following:

Caution — Backup config files BEFORE Editing them!

The main file that you will be working with is, and you will need sudo/root access to this file:

/etc/inetd.conf

Backup the original config file:

sudo cp /etc/inetd.conf /etc/inetd.conf.bak

Now to Edit the file:

sudo gedit /etc/inetd.conf

To enable TFTP, add the following code:

tftp dgram udp wait nobody /usr/sbin/tcpd in.tftpd /tftpboot

Note: If you wish to log Boot errors, then add the -l switch to in.tftpd causing errors to be logged to the system logs.

tftp dgram udp wait nobody /usr/sbin/tcpd in.tftpd -l /tftpboot

If you changed /etc/inetd.conf, then you will need to reload the inetd process with the following command:

/etc/init.d/inetd reload

 

Configuring iSCSI

Caution — Backup config files BEFORE Editing them!

The main file that you will be working with is, and you will need sudo/root access to this file:

sudo cp /etc/ietd.conf /etc/ietd.conf.bak

Now to Edit the file:

sudo gedit /etc/ietd.conf

Once you have opened this file, you will find additional information/comments within the file on how to “tweak” your installation.

For a basic install, you will need to add the following:

Target iqn.yyyy-mm.com.mydomain:[Optional identifier]Lun 0 Path=/path/to/image,Type=fileio,IOMode=rw

Where:

  • yyyy is the year and mm is the month that the domain became valid.
  • is written as 1.168.192 or com.yourdomain (this will change in your environment).
  • [Optional identifier] is used to further identify the target.
  • Path= is where your files are located on the local machine.

To restart iSCSI you can use the following command:

sudo invoke-rc.d iscsitarget restart

The iSCSI target daemon is:

tail -f /var/log/messages
§ § §

Trouble Shooting – Things to Check/Verify

If you get the error:

iscsitarget not enabled in “/etc/default/iscsitarget”, not starting…

check:

/etc/default/iscsitarget

to confirm

ISCSITARGET_ENABLE=true

One should also check/verify that:

/etc/initiators.allow

to confirm

ALL ALL

[contentblock id=1]

Categories
How to(s)? Projects Software

How to Boot from a Ubuntu SAN

Introduction

The following section is a brief overview of “How to Boot from a Ubuntu SAN” with a Microsoft Server Operating System, and is intended as a reference.

These instructions were done as a guide to setup a test environment.

The following Microsoft Server Operating systems have been tested:

  • Windows 2003 SP-3
  • Windows 2008 SP-2 (Core)
  • Windows 2008 SP-2 (Enterprise)
  • Windows 2008 SP-2 (Standard)

If you see anything that is in “error” or would like to have something added, please feel free to contact us.

SDC

Install the Windows Operating System

Install the Windows Operating System as you normally would, with the following notes:

  • Install the OS unto an External Storage Device;
    • This Device will later be moved and mounted on the Ubuntu target
  • Format the OS installation partition as small as possible, but keep in mind:
    • Physical RAM on the Initiator/Client machine;
    • Windows Patching needs;

Minimal Recommendations:

Although numerous attempts were done with a bare minimal requirements, it is STRONGLY suggested that you install the following:

  • Windows Server 2003 SP2 or Greater

Download iSCSI support (2003 and below)

If you are installing a Microsoft Windows OS 2003 SP2 (or below), then you will need to do the following:

Install and Setup of Microsoft iSCSI Software Initiator (2003 and below)

The basic installation of the software is straight forward,

    1. Run the setup program;
    2. In the Microsoft iSCSI Initiator Installation window, be sure to select:
      • Initiator Service
      • Software Service
      • DO NOT SELECT “Microsoft MPIO Multipathing Support for iSCSI” because it is NOT COMPATIBLE with iSCSI boot.
No Multipathing
No Multipathing
    1. In the next dialog box, you will be asked to select “Configure iSCSI Network Boot Support”
Configure Network Boot
Configure Network Boot
  1. After the installation is complete, Reboot the system to check that is boots correctly.

Transferring Windows OS Image to Ubuntu

In these steps, you will be physically and digitally transferring the Target OS image.

    1. Shut down the Windows OS machine;
    2. Disconnect the Drive from the Windows machine;
    3. Reconnect the Drive to the Ubuntu Server;
    4. Once mounted, Open a Terminal Window;
    5. Type in the following command:
      • Disk pathExample: /dev/sdb
      • Bytes per CylinderExample: 8225280
      • Ending cylinder number for the partitionExample: 1026

sudo fdisk -l

Which should return something similar to:

Disk Allocations
Disk Allocations

You will need the the following information:

    1. Using this information, type in:

dd if=/dev/sdb of=/path/to/image/file.img bs=8225280 count=1026

It is strongly recommended that the /path/to/file.img, be placed into a LARGE /var path.

Note: Using /dev/sdb copies the Master Boot Record (MBR), while /dev/sdb1 just copies the partition.

    1. To verify the image transfer, use the following command:

fdisk -l /path/to/image/file.img

Making the Windows OS image available on iSCSI

Now the Windows OS image need to be made available:

    1. In the terminal window, type in:

sudo gedit /etc/ietd.conf

    1. Add the following to the end of the file:
      • yyyy is the year and mm is the month that the domain became valid.
      • is written as 1.168.192 or com.yourdomain (this will change in your environment).
      • [Optional identifier] is used to further identify the target.
      • Path= is where your files are located on the local machine.

Target iqn.yyyy-mm.com.mydomain:[Optional identifier]
Lun 0 Path=/path/to/image,Type=fileio,IOMode=rw

Where:

    1. Restart the iSCSI daemon:

sudo invoke-rc.d iscsitarget restart

Configure your Ubuntu DHCP Server

Now to configure your DHCP Server:

    1. In the terminal window, type in:

sudo gedit /etc/dhcpd.conf

    1. Add the following to the end of the file:

filename "";
option root-path "iscsi:my.target.dns.name::::iqn.2007-08.name.dns.target.my:iscsiboot";

Note: The second line (“Option…”) should be all on one line.

    1. Restart the DHCP daemon:

sudo /etc/init.d/dhcpd restart

Boot from the Diskless Client

It is now possible to boot from your Diskless client:

  1. Insert and Boot the Initiator/Client from the Etherboot media.
  2. After a short time, the Target OS should start to boot in a Normal fashion.

Etherboot Project

  • Required for Booting the Local Computer over the network to the SAN.
  • Booting can be done with Floppies, CD/DVD or USB devices.
  • This documentation is derived from the “HowTo Guides – Boot from SAN

– Andrew
§ § § § §
[adrotate banner=”1″]