Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
sanboot:iscsi_create_via_linux [2009/01/18 13:28]
johan added how to create arbitrary sized files
sanboot:iscsi_create_via_linux [2009/02/25 14:10] (current)
mcb30
Line 1: Line 1:
-==== iSCSI Enterprise Target (IET) ====+====== Creating an iSCSI target on Linux ======
  
-IET (http://​iscsitarget.sourceforge.net/​) is iSCSI target with good performance,​ easy config and small footprint. It lives completely in userland so the install and basic setup is trivial.+===== Creating ​disk image =====
  
-== Installing IET on Gentoo ==+Create an empty file to be the disk image:
  
-  adrenaline ~ # emerge iscsitarget+    dd if=/​dev/​zero of=/​path/​to/​image/​file.img bs=1M count=0 seek=8192
  
-== Installing IET on Ubuntu 8.10 ==+where ///​path/​to/​image/​file.img//​ is the path where you want to store the disk image file, and //​**8192**//​ is the size of the disk image that you want to create, in megabytes.
  
-  root@novBackup:​~#​ apt-get install iscsitarget+===== Creating an iSCSI target =====
  
-== Configuration of IET ==+Edit the file ///​etc/​ietd.conf//​ and add:
  
-Edit /etc/ietd.conf and add the following:+    Target iqn.2007-08.name.dns.target.my:​iscsiboot 
 +        Lun 0 Path=/path/to/​image/​file.img,​Type=fileio
  
-  Target iqn.2001-04.com.example:​myVolumeName +where ///​path/​to/​image/​file.img// is the path to your disk image file, and //name.dns.target.my// is your DNS name in reverse order.
-        Lun 0 Path=/dev/sdX,​Type=fileio+
  
-Where **Path** can be any block device ​(including regular block devices like hdX and sdX and virtual block devices like LVM and Software RAID devices) or regular filesIf you use a regular file you need to make it as big as you want the target ​device to beThis will get you a 1 GB file:+(For completeness,​ you should also replace //2007-08// with the year and month in which you first obtained your DNS domain The iSCSI naming schemes are somewhat pedantic, but it won't affect anything in practice; ​as long as the target ​name is unique then everything will work just fine.)
  
-  root@novBackup:~# dd if=/dev/zero of=/tmp/myfile bs=1024 count=1000000+Restart the iSCSI target service: 
 + 
 +    ​/etc/init.d/​iscsi-target restart 
 + 
 +Make a note of the iSCSI target IQN that you chose (//iqn.2007-08.name.dns.target.my:​iscsiboot//​ in the above example). ​ You are now ready to: 
 + 
 +  * [[sanboot:​iscsi_install|Install to the iSCSI target]]
  
-Setup complete! 

QR Code
QR Code sanboot:iscsi_create_via_linux (generated for current page)