ASP Developer Network - Brought to you by Steve Radich and BitShop, Inc. - http://www.bitshop.com

Menu [hide]

LinuxiSCSITargetOnUbuntu

HOWTO: Setup an iSCSI Target Server on Ubuntu print
similar slides comment
I found a lot of obsolete tutorials about how to do this in testing something (comparison of iscsi targets performance and reliability, i.e. trying to break iscsi targets).. Here's what I did on Ubuntu 8.04:

  • Install Ubuntu, just a normal setup. Personally I do the bare minimum unless more is needed (less patching, less surface for attack, etc.)
  • Update all..
  • sudo apt-get install iscsitarget - Install the iSCSI Target
  • sudo vi /etc/ietf.conf - Configuration file customizations
# Configure your Target name - this is iqn.YYYY-MM.com.example:anyname.you.want
# the YYYY-MM is the year and month your domain name was registered (this is a globally unique id, it's possible a domain name could be sold later and the name not be distinct with a new owner, hence this logic).
# Modify the LUN lines to have the path you want to export, i.e. if you want to export the entire /dev/sdb then the line would be Lun 0 Path=/dev/sdb,Type=fileio
  • Consider security restrictions, in this file, firewall, etc.
  • Restart iscsitarget for changes to take effect
  • "invoke-rc.d iscsitarget restart"

Using Spare Files instead of actual hard disks

While you're testing you may want to consider using sparse files (i.e. files that claim to be a large size, but in reality on disk they are just stored using the real amount of data they hold.

For example lets take a 100 gb drive and create 4x 200gb partitions for iSCSI sharing:

root@ibmx1:/tmp# dd if=/dev/zero of=templun3 count=0 obs=1 seek=200G
0+0 records in
0+0 records out
0 bytes (0 B) copied, 4.1537e-05 s, 0.0 kB/s
root@ibmx1:/tmp# ls -al *lun3*
-rw-r--r-- 1 root root 214748364800 2008-05-03 04:43 templun3


You'll see the file reports being 200 gb, howeer dd wrote 0kB.

You can now export this as an iscsi target:

Target iqn.1995-10.com.example:iscsi.yourid
        Lun 0 Path=/tmp/templun3,Type=fileio


Created by: steveradich last modification: Saturday 03 of May, 2008 [08:54:33 UTC] by steveradich



Search
in:
Our Sponsors
FREE .Net 2.0 Tutorials Available Now
http://www.aspdeveloper.net
Latest Virtual Server 2005 R2 News
www.virtualserverfaq.com/ng
Need a Virtual Server 2005 Hosted Account? Why not trust ASPDeveloper's Team? We're a division of www.bitshop.com
Latest Virtual Server 2005 R2 News
www.virtualserverfaq.com/ng
FREE .Net 2.0 Tutorials Available Now
http://www.aspdeveloper.net
rss Wiki rss Blogs rss Articles rss Image galleries rss File galleries rss Forums rss Maps rss Directories
ASP Developer Network (since 1996) - Brought to you by Steve Radich and BitShop, Inc. - http://www.bitshop.com
Copyright © 1997-2005 by BitShop, Inc. All Rights Reserved.
No content may be reproduced in any form without written permission from BitShop, Inc.
We will be honored to assist with reproduction rights on our material if you contact us.
We also can provide print articles for your magazine, private training seminars at your site, and conference presentations.

Thank you for visiting. Please bookmark our site if you found it useful!
If you wish to make a donation it will help further the development of these free resources: