Set up an iSCSI server on the Amahi box. You can install it using yum. Note that all actions must be done as user root.
{{Code| yum install scsi-target-utils}}
Set up 1 Logical Volume (LV) that will be exported as an iSCSI LUN. The below output shows my LV created for time machine (hence the name lvtime).
{{<pre>Code|lvs <nowiki>|</nowiki> grep timelvtime vg00 -wi-ao 500.00g}}</pre>
Export the LV: add it to /etc/tgt/targets.conf (note that there's a convention on how to export these!)
{{Text|Text=<pre><target iqn.2010-08.local.bonabo:galileo.lun1>
backing-store /dev/vg00/lvtime
</target>}}</pre>
The name convention for iSCSI LUNs is usually as follows but a vendor can change it at will, it's a convention not a requirement.
Start the iSCSI target daemon and make sure it starts at boot time:
{{Code| service tgtd start chkconfig tgtd on}}
Check the exported LUN(s):
{{Code| tgt-admin -s}}
= Client side =
quick how-to for connecting to iSCSI storage (implies that iscsi-initiator-utils are installed!):
scan for new LUNs:
{{Code| iscsiadm -m discovery -t sendtargets -p <NAS IP>}}
login and make the connection persistent
{{Code| iscsiadm -m node -T iqn.2012-02.<domain>.<your>:<LUNname> -p <NAS IP> -l}}
you should see a new device, you can partition it now
{{Code| fdisk /dev/<new device> partprobe /dev/<new device>}}
Create LVM stuff if you want to, otherwise create the filesystem as you would normally do
do this by typing
{{Code| Code= yum update }}
Let amahi update whatever is necessary to avoid a kernel module error trying to start the ISCSI server.
Then install kernel headers and gcc
{{Code|Code= yum install kernel-headers kernel-devel gcc}}
Now we going to download the install script i wrote
{{Code| Code= wget http://dl.dropbox.com/u/57179706/iscsi/install.sh}}
Then run
{{Code| Code= sh ./install.sh}}
This should have now compiled and installed the ISCSI server on your Amahi box.
We are doing this by typing:
{{Code|
Code= mkdir /var/hda/files/iscsi
dd if=/dev/zero of=/var/hda/files/iscsi/disk.img bs=1M count=0 seek=256000}}
You can name the disk.img whatever you want and the numbers behind seek is the size of the image disk which in our case is 250 gigs.
Leave everything as it is exept at the bottom we add
{{Code|
Code= Target iqn.2012-02.com.domain:disk.img
Lun 0 Path=/var/hda/files/iscsi/disk.img,Type=fileio}}
Save and exit your editor
''Start/restart your ISCSI server''
{{Code|
Code= service iscsi-target restart
}}
done
For ease of use I have created a repository which can easily be added. Download the repo file located at:
{{Code|
Code= http://amahirepo.3owl.com/repofile/
}}
Download rpmorama.repo (right click and save as)
Copy that file to
{{Text|Text= /etc/yum.repos.d/}}
Run
{{Code|
Code= yum update
}}
Then you can install the iscsi server by typing
{{Code| Code= yum install iscsitarget}}
You still have to create the disk and edit the iet.conf file