Hier even een korte handleiding over het installeren en configureren van de iSCSI target software op Ubuntu Server versie 8.04. De handleiding is gebasseerd op een eerdere post van Frederik Vos op http://www.l4l.be.
Download en installeer Ubuntu 8.04 Server zoals jij het wilt hebben. De ISO kun je hier downloaden: http://www.ubuntu.com/getubuntu/download. Hoe de installatie in zijn werk gaat, lees je hier: http://www.ubuntugeek.com/ubuntu-804-hardy-heron-lamp-server-setup.html
Na de installatie update je de server via de volgende twee commando’s:
sudo apt-get update
sudo apt-get upgrade
De volgende stap is het installeren van build-essential software
sudo apt-get install build-essential linux-headers-`uname -r` libssl-dev
Nadat de bovenstaande stap klaar is, kunnen we gaan beginnen met de installatie van de iscsitarget.
Open de /tmp directory:
cd /tmp
Download het installatie bestand:
sudo wget http://heanet.dl.sourceforge.net/sourceforge/iscsitarget/iscsitarget-0.4.17.tar.gz
Pak het bestand uit:
sudo tar xzvf iscsitarget-0.4.17.tar.gz
Open de nieuwe map:
cd iscsitarget-0.4.17
Via de volgende twee commando’s wordt de iSCSI target software geïnstalleerd:
sudo make
sudo make install
Om te achterhalen welke hardeschijven je in je systeem hebt, voer je het volgende commando uit:
sudo fdisk –l
Disk /dev/sda: 200.0 GB, 200049647616 bytes 255 heads, 63 sectors/track, 24321 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x28781a14
Device Boot Start End Blocks Id System /dev/sda1 * 1 31 248976 83 Linux /dev/sda2 32 24321 195109425 5 Extended /dev/sda5 32 24321 195109393+ 8e Linux LVM
Disk /dev/sdb: 320.0 GB, 320072933376 bytes 255 heads, 63 sectors/track, 38913 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x00004688
Device Boot Start End Blocks Id System /dev/sdb1 1 38913 312568641 5 Extended /dev/sdb5 1 38913 312568609+ 8e Linux LVM
Disk /dev/sdc: 750.1 GB, 750156374016 bytes 255 heads, 63 sectors/track, 91201 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x10a711d3
Device Boot Start End Blocks Id System /dev/sdc1 1 91201 732572001 5 Extended /dev/sdc5 1 91201 732571969+ 8e Linux LVM
|
Zoals je ziet, heb ik drie hardeschijven in deze machine. Ik ga de /dev/sdc gebruiken voor de iSCSI target.
De laatste stap is het configureren van het configuratie bestand.
Open het bestand in je favoriete editor:
sudo nano /etc/ietd.conf of sudo vi /etc/ietd.conf
Pas hier de iqn aan. Meer informatie vind je hier: http://en.wikipedia.org/wiki/ISCSI. Daarnaast moet je een LUN configureren. Hieronder zie je hoe ik /dev/sdc5 aankoppel. Het is ook mogelijk om een file te koppelen als LUN. Hoe dit in zijn werk gaat, lees je hier: http://www.l4l.be. Meer informatie over het ietd.conf bestand vind je hier: http://manpages.ubuntu.com/manpages/hardy/man5/ietd.conf.5.html
Target iqn.2009-02.local.ict-freak:storage.disk2.750.xyz # Users, who can access this target. The same rules as for discovery # users apply here. # Leave them alone if you don’t want to use authentication. #IncomingUser joe secret #OutgoingUser jim 12charpasswd # Logical Unit definition # You must define one logical unit at least. # Block devices, regular files, LVM, and RAID can be offered # to the initiators as a block device. Lun 0 Path=/dev/sdc5,Type=fileio
|
Sla het bestand op en sluit je editor.
Via de volgende twee commando’s start je de iscsi-target en bekijk je de status:
sudo /etc/init.d/iscsi-target start
sudo /etc/init.d/iscsi-target status
Deze target gebruik ik nu binnen VMware ESX 3.5u3.
Via het volgende commando kun je zien of de volume gebruikt word:
cat /proc/net/iet/volume
tid:1 name:iqn.2009-02.local.ict-freak:storage.disk2.750.xyz lun:0 state:0 iotype:fileio iomode:wt path:/dev/sdc5
|
op de ubuntu server kun je de iscsi target monitoren via:
cat /proc/net/iet/session
tid:1 name:iqn.2009-02.local.ict-freak:storage.disk2.750.xyz sid:564049469047296 initiator:iqn.1998-01.com.vmware:esx35srv1-673995f2 cid:0 ip:172.1.1.211 state:active hd:none dd:none
|
Bron: http://www.l4l.be/docs/server/storage/iscsi/iscsitarget_ubuntu.php