The Linux Letter: Use iSCSI to Build Your SAN

Linux / Open Source
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

"Disks are always full. It is futile to try to get more disk space. Data expands to fill any void." This example of Murphy's Computer Laws usually brings a smile to the faces of IT professionals, yet, while humorous, there's always the truism that "in good humor, there is usually truth" to sober one's mood.

The battle to provide additional storage is never-ending, and for well-heeled corporations, the weapon of choice is the storage area network (SAN). Smaller corporations usually make do with network-attached storage (NAS), but they don't need to. Open-source software, in combination with increasingly faster traditional network speeds, can put a SAN into shops with smaller budgets. This month, I'll point you to some resources that will allow you to build your own SAN, for minimal cost.


Network-attached storage and storage area networks share some of the same properties. From a management standpoint, NAS and SANs are usually implemented to minimize maintenance and downtime through the purchase of quality hardware and backup/recovery solutions. Contrast the management needs of a network of even as few as 10 peer computers, all with cheap hardware and their own disk storage, with a network of a server with 10 clients, and you can easily see the utility of a client/server network. Scale that up a couple of orders of magnitude, and you can really appreciate it. The differences between NAS and SAN technologies boil down to the way data appears to the client machine and the additional recovery options made easier via a SAN.

NAS has been with us for many years and is most familiar in the guise of the Network File System (NFS) on *nix machines and i5, or SMB/CIFS on Windows machines (and i5). In both cases, the server hosting the data provides file-level access; thus it is responsible for authenticating a client's access to the various directories (shares) and files. Since many clients can be simultaneously connected to the same resource, the server also handles file contention/locking. Despite the occasional problem caused by multiple clients accessing a given file, NAS works well and has modest resource requirements both in computing power and network bandwidth. No modern operating system worth its salt comes without the ability to access NAS resources.

A SAN server is a horse of another color. Unlike its NAS brother, a SAN server provides block-level access to the client. Thus, what a SAN serves up appears as a directly attached drive. I'm not talking about a drive as in "I have my drive N: mapped to hatserver hatshare"; I'm talking about a drive as in fdisk, format, and install to it. It doesn't take much to imagine the network bandwidth required to support this kind of access (it's huge) and thus the cost of the network hardware to provide it. Is it any wonder that SANs have traditionally been deployed only in large enterprises?

While NAS allows multiple connections to the same resource, only the über-expensive SAN solutions permit more than one client to connect to a single resource at a time. The faux drives are not shareable, at least not by the low-cost solution I'll be discussing shortly. With this seemingly huge limitation, why would you want to implement a SAN? By utilizing SAN storage instead of directly-connected drives, you enhance your ability to swap server hardware (clients of a SAN) for upgrade or replacement. Provided your server can boot from a SAN, you have little to move except the old hardware. Remember those applications I mentioned earlier, the ones that don't work well with NAS-hosted files? They'll work just fine on a SAN, as it is the host on which the software is running that is taking care of file access. Everything works the same as it would if the storage was directly attached. From a backup perspective, SANs have some terrific tools. Even the on-the-cheap solution I'm going to describe has the ability to make snapshots for backups that won't interfere with, or be interfered with by, the applications currently accessing the SAN drive.


The network technology that I use in my SAN is iSCSI. It uses TCP/IP to transport SCSI commands between the client (the iscsi-initiator) and the server (the iscsi-target). This is but one of the options, but it's one that I can see becoming increasingly attractive as network bandwidth becomes cheaper. The downside to iSCSI is the overhead introduced by the TCP/IP stack, which can be significant. Some iSCSI hardware solutions offload the workload from the CPU to a dedicated card, but they're beyond the scope of this article.

It bears repeating multiple times that the most important resource to a successful SAN implementation is network bandwidth. Without sufficient bandwidth, you'll end up with drive performance reminiscent of the early hard-drive technology. The reigning champ in SAN network technology is fibre channel, with its ability to provide speeds that start at 1 Gbps and go upward from there. Fibre channel makes our humble Ethernet speeds look pathetic (it should, given the price), yet the latest 1 Gbps Ethernet hardware is becoming inexpensive and thus is starting to encroach on fibre's turf. The gap between the two will continue to shrink, or at least the bandwidth provided by Ethernet will become sufficient to handle mid-sized SANs.

Roll Your Own

While there are certainly many commercially available SAN solutions, most companies will not want to pony up the cash to purchase one unless they can be certain that it will work. Fortunately, using very modest hardware, you can roll your own for proof-of-concept or as an educational exercise. While it won't be sufficient for more than testing, that old desktop machine that you have in your closet will do just fine. You'll need at a minimum a 100 Mbps Ethernet card (anything slower won't even be worth the time for testing), a disk drive large enough to hold a Linux installation and the space you'd like to export (20 G or more will be more than enough), and 512 Mb or so of RAM. For testing, I use CentOS Linux (a RHEL derivative), which already includes the iscsi-initiator code. Installing Linux should take no more than 30 minutes if you've done it before or an hour if you haven't and you take the time to read the help text on each of the install screens.

Once you have the Linux installation completed and updates applied, install the iscsi-target software using the instructions found in this article, entitled "Going Enterprise - setup your FC4 iSCSI target in 5 minutes." While his estimate of five minutes is a bit optimistic, Anze (the author) has done a pretty good job of documenting the process, complete with pictures. He uses Windows 2003 for the iscsi-initiator (client), so if you will be attaching to your SAN from that platform, you can see what it looks like. The only caveat to using his method is that you have to remember to recompile the initiator any time you update the Linux kernel. The iscsi-target module is tied to the kernel level and may fail if you reboot after loading a new kernel. You won't lose data if this happens; you'll just be unable to access any iscsi targets until you do recompile.

For those using Linux as the initiator, you will need to load the "iscsi-initiator-utils" package (assuming RHEL or CentOS) or your distribution's equivalent. If you are not going to use authentication (a really bad idea in a production environment), you need only one line in the /etc/ietd.conf file: Adding authentication is a simple process, described in the well-documented configuration files on both the target and initiator sides.

Start the ietd process with /sbin/service iscsi start. If all goes well, you should see something like this in your /var/log/messages file:

Jul 20 01:01:50 laptop2 kernel: iscsi-sfnet: Loading iscsi_sfnet version 4:0.1.11-3
Jul 20 01:01:50 laptop2 kernel: iscsi-sfnet: Control device major number 253
Jul 20 01:01:50 laptop2 iscsi: Loading iscsi driver:  succeeded
Jul 20 01:01:55 laptop2 iscsid[15158]: version 4:0.1.11-4 variant (15-Jan-2007)
Jul 20 01:01:55 laptop2 iscsi: iscsid startup succeeded
Jul 20 01:01:56 laptop2 iscsid[15168]: Connected to 

Discovery Address
Jul 20 01:01:56 laptop2 kernel: iscsi-sfnet:host1: Session established
Jul 20 01:01:56 laptop2 kernel: scsi1 : SFNet iSCSI driver
Jul 20 01:01:56 laptop2 kernel:   Vendor: IET       Model: VIRTUAL-DISK      Rev: 0
Jul 20 01:01:56 laptop2 kernel:   Type:   Direct-Access                      ANSI SCSI revision: 04
Jul 20 01:01:56 laptop2 kernel: SCSI device sda: 536870912 512-byte hdwr sectors (274878 MB)
Jul 20 01:01:56 laptop2 kernel: SCSI device sda: drive cache: 

write back
Jul 20 01:01:56 laptop2 kernel: SCSI device sda: 536870912 512-byte hdwr sectors (274878 MB)
Jul 20 01:01:56 laptop2 kernel: SCSI device sda: drive cache: 

write back
Jul 20 01:01:56 laptop2 kernel:  sda: sda1
Jul 20 01:01:56 laptop2 kernel: Attached scsi disk sda at scsi1, 

channel 0, id 0, lun 0
Jul 20 01:01:56 laptop2 scsi.agent[15205]: disk at /devices/platform



This indicates that the new "drive" will be addressed as /dev/sda, with one partition: /dev/sda1. It appears because I had earlier used fdisk to partition it. Your application may allow (or prefer) accessing the entire drive. Formatting the partition is the same as for any directly attached drive on a Linux system: mkfs.ext3 /dev/sda1. And mounting it into the root filesystem is also identical: mkdir /mnt/iscsi; mount /dev/sda1 /mnt/iscsi.

The iscsi-utilities include iscsi-ls, which, when invoked on my laptop, produces this output:

[root@laptop2 ~]# iscsi-ls -l
SFNet iSCSI Driver Version ...4:0.1.11-4(15-Jan-2007)
TARGET NAME             :
TARGET ALIAS            :
HOST ID                 : 0
BUS ID                  : 0
TARGET ID               : 0
TARGET ADDRESS          :,1
SESSION STATUS          : ESTABLISHED AT Thu Jul 19 19:20:23 EDT 2007
SESSION ID              : ISID 00023d000001 TSIH 100

LUN ID : 0
  Vendor: IET      Model: VIRTUAL-DISK     Rev: 0
  Type:   Direct-Access                    ANSI SCSI revision: 04
  page83 type1: 49455400000000000000000001000000040500000d000000
  page80: 0a
  Device: /dev/sda

Once mounted, it appears as any other drive:

[klinebl@laptop2 ~]$ df -h
Filesystem            Size  Used Avail Use% Mounted on
                      6.0G  5.2G  466M  92% /
/dev/hda2              99M   20M   75M  21% /boot
none                  506M     0  506M   0% /dev/shm
                       25G   23G  540M  98% /home
                      2.5G  1.8G  657M  73% /opt
                      1.2G   35M  1.1G   4% /tmp
                      248M  229M  6.6M  98% /usr/local
                      3.0G  2.1G  784M  73% /var
                       38G   28G  9.4G  75% /vmstorage
/dev/sda1             252G   93M  247G   1% /mnt/iscsi

Throw Money at It

If you have built your SAN using the hardware I've just described, don't expect that it will set any world records for access speed. However, by taking the time to build such a machine, you will see that it is very simple to get a SAN built and to start discovering the benefits one can provide. Once your curiosity is satisfied, it is a simple step to achieve a production-quality version: Throw money at it. If you have lots of money, jump headfirst into fibre channel and a commercial solution. For those who are more frugal or have more modest requirements, consider purchasing server-quality hardware with plenty of disk arms, RAID, and, of course, one or more Gb Ethernet NICs.

I have used my SAN to provide storage to older hardware on my network. I've used it for temporary storage for projects. I've even used it in conjunction with LVM to rearrange and upgrade hard drives—while the systems were running.

SAN technology can be intimidating. Make it less so by dipping your toes into the pond for little more than the cost of a couple of hours. You'll be glad that you did.

Barry L. Kline is a consultant and has been developing software on various DEC and IBM midrange platforms for over 23 years. Barry discovered Linux back in the days when it was necessary to download diskette images and source code from the Internet. Since then, he has installed Linux on hundreds of machines, where it functions as servers and workstations in iSeries and Windows networks. He co-authored the book Understanding Linux Web Hosting with Don Denoncourt. Barry can be reached at This email address is being protected from spambots. You need JavaScript enabled to view it..

Barry Kline

Barry L. Kline is a consultant and has been developing software on various DEC and IBM midrange platforms since the early 1980s. Barry discovered Linux back in the days when it was necessary to download diskette images and source code from the Internet. Since then, he has installed Linux on hundreds of machines, where it functions as servers and workstations in iSeries and Windows networks. He co-authored the book Understanding Web Hosting on Linux with Don Denoncourt. Barry can be reached at



Support MC Press Online





  • White Paper: Node.js for Enterprise IBM i Modernization

    SB Profound WP 5539

    If your business is thinking about modernizing your legacy IBM i (also known as AS/400 or iSeries) applications, you will want to read this white paper first!

    Download this paper and learn how Node.js can ensure that you:
    - Modernize on-time and budget - no more lengthy, costly, disruptive app rewrites!
    - Retain your IBM i systems of record
    - Find and hire new development talent
    - Integrate new Node.js applications with your existing RPG, Java, .Net, and PHP apps
    - Extend your IBM i capabilties to include Watson API, Cloud, and Internet of Things

    Read Node.js for Enterprise IBM i Modernization Now!


  • Profound Logic Solution Guide

    SB Profound WP 5539More than ever, there is a demand for IT to deliver innovation.
    Your IBM i has been an essential part of your business operations for years. However, your organization may struggle to maintain the current system and implement new projects.
    The thousands of customers we've worked with and surveyed state that expectations regarding the digital footprint and vision of the companyare not aligned with the current IT environment.

    Get your copy of this important guide today!


  • 2022 IBM i Marketplace Survey Results

    Fortra2022 marks the eighth edition of the IBM i Marketplace Survey Results. Each year, Fortra captures data on how businesses use the IBM i platform and the IT and cybersecurity initiatives it supports.

    Over the years, this survey has become a true industry benchmark, revealing to readers the trends that are shaping and driving the market and providing insight into what the future may bring for this technology.

  • Brunswick bowls a perfect 300 with LANSA!

    FortraBrunswick is the leader in bowling products, services, and industry expertise for the development and renovation of new and existing bowling centers and mixed-use recreation facilities across the entertainment industry. However, the lifeblood of Brunswick’s capital equipment business was running on a 15-year-old software application written in Visual Basic 6 (VB6) with a SQL Server back-end. The application was at the end of its life and needed to be replaced.
    With the help of Visual LANSA, they found an easy-to-use, long-term platform that enabled their team to collaborate, innovate, and integrate with existing systems and databases within a single platform.
    Read the case study to learn how they achieved success and increased the speed of development by 30% with Visual LANSA.


  • Progressive Web Apps: Create a Universal Experience Across All Devices

    LANSAProgressive Web Apps allow you to reach anyone, anywhere, and on any device with a single unified codebase. This means that your applications—regardless of browser, device, or platform—instantly become more reliable and consistent. They are the present and future of application development, and more and more businesses are catching on.
    Download this whitepaper and learn:

    • How PWAs support fast application development and streamline DevOps
    • How to give your business a competitive edge using PWAs
    • What makes progressive web apps so versatile, both online and offline



  • The Power of Coding in a Low-Code Solution

    LANSAWhen it comes to creating your business applications, there are hundreds of coding platforms and programming languages to choose from. These options range from very complex traditional programming languages to Low-Code platforms where sometimes no traditional coding experience is needed.
    Download our whitepaper, The Power of Writing Code in a Low-Code Solution, and:

    • Discover the benefits of Low-code's quick application creation
    • Understand the differences in model-based and language-based Low-Code platforms
    • Explore the strengths of LANSA's Low-Code Solution to Low-Code’s biggest drawbacks



  • Why Migrate When You Can Modernize?

    LANSABusiness users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.
    In this white paper, you’ll learn how to think of these issues as opportunities rather than problems. We’ll explore motivations to migrate or modernize, their risks and considerations you should be aware of before embarking on a (migration or modernization) project.
    Lastly, we’ll discuss how modernizing IBM i applications with optimized business workflows, integration with other technologies and new mobile and web user interfaces will enable IT – and the business – to experience time-added value and much more.


  • UPDATED: Developer Kit: Making a Business Case for Modernization and Beyond

    Profound Logic Software, Inc.Having trouble getting management approval for modernization projects? The problem may be you're not speaking enough "business" to them.

    This Developer Kit provides you study-backed data and a ready-to-use business case template to help get your very next development project approved!

  • What to Do When Your AS/400 Talent Retires

    FortraIT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators is small.

    This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn:

    • Why IBM i skills depletion is a top concern
    • How leading organizations are coping
    • Where automation will make the biggest impact


  • Node.js on IBM i Webinar Series Pt. 2: Setting Up Your Development Tools

    Profound Logic Software, Inc.Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application. In Part 2, Brian May teaches you the different tooling options available for writing code, debugging, and using Git for version control. Attend this webinar to learn:

    • Different tools to develop Node.js applications on IBM i
    • Debugging Node.js
    • The basics of Git and tools to help those new to it
    • Using as a pre-built development environment



  • Expert Tips for IBM i Security: Beyond the Basics

    SB PowerTech WC GenericIn this session, IBM i security expert Robin Tatam provides a quick recap of IBM i security basics and guides you through some advanced cybersecurity techniques that can help you take data protection to the next level. Robin will cover:

    • Reducing the risk posed by special authorities
    • Establishing object-level security
    • Overseeing user actions and data access

    Don't miss this chance to take your knowledge of IBM i security beyond the basics.



  • 5 IBM i Security Quick Wins

    SB PowerTech WC GenericIn today’s threat landscape, upper management is laser-focused on cybersecurity. You need to make progress in securing your systems—and make it fast.
    There’s no shortage of actions you could take, but what tactics will actually deliver the results you need? And how can you find a security strategy that fits your budget and time constraints?
    Join top IBM i security expert Robin Tatam as he outlines the five fastest and most impactful changes you can make to strengthen IBM i security this year.
    Your system didn’t become unsecure overnight and you won’t be able to turn it around overnight either. But quick wins are possible with IBM i security, and Robin Tatam will show you how to achieve them.

  • Security Bulletin: Malware Infection Discovered on IBM i Server!

    SB PowerTech WC GenericMalicious programs can bring entire businesses to their knees—and IBM i shops are not immune. It’s critical to grasp the true impact malware can have on IBM i and the network that connects to it. Attend this webinar to gain a thorough understanding of the relationships between:

    • Viruses, native objects, and the integrated file system (IFS)
    • Power Systems and Windows-based viruses and malware
    • PC-based anti-virus scanning versus native IBM i scanning

    There are a number of ways you can minimize your exposure to viruses. IBM i security expert Sandi Moore explains the facts, including how to ensure you're fully protected and compliant with regulations such as PCI.



  • Encryption on IBM i Simplified

    SB PowerTech WC GenericDB2 Field Procedures (FieldProcs) were introduced in IBM i 7.1 and have greatly simplified encryption, often without requiring any application changes. Now you can quickly encrypt sensitive data on the IBM i including PII, PCI, PHI data in your physical files and tables.
    Watch this webinar to learn how you can quickly implement encryption on the IBM i. During the webinar, security expert Robin Tatam will show you how to:

    • Use Field Procedures to automate encryption and decryption
    • Restrict and mask field level access by user or group
    • Meet compliance requirements with effective key management and audit trails


  • Lessons Learned from IBM i Cyber Attacks

    SB PowerTech WC GenericDespite the many options IBM has provided to protect your systems and data, many organizations still struggle to apply appropriate security controls.
    In this webinar, you'll get insight into how the criminals accessed these systems, the fallout from these attacks, and how the incidents could have been avoided by following security best practices.

    • Learn which security gaps cyber criminals love most
    • Find out how other IBM i organizations have fallen victim
    • Get the details on policies and processes you can implement to protect your organization, even when staff works from home

    You will learn the steps you can take to avoid the mistakes made in these examples, as well as other inadequate and misconfigured settings that put businesses at risk.



  • The Power of Coding in a Low-Code Solution

    SB PowerTech WC GenericWhen it comes to creating your business applications, there are hundreds of coding platforms and programming languages to choose from. These options range from very complex traditional programming languages to Low-Code platforms where sometimes no traditional coding experience is needed.
    Download our whitepaper, The Power of Writing Code in a Low-Code Solution, and:

    • Discover the benefits of Low-code's quick application creation
    • Understand the differences in model-based and language-based Low-Code platforms
    • Explore the strengths of LANSA's Low-Code Solution to Low-Code’s biggest drawbacks



  • Node Webinar Series Pt. 1: The World of Node.js on IBM i

    SB Profound WC GenericHave you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application.
    Part 1 will teach you what Node.js is, why it's a great option for IBM i shops, and how to take advantage of the ecosystem surrounding Node.
    In addition to background information, our Director of Product Development Scott Klement will demonstrate applications that take advantage of the Node Package Manager (npm).
    Watch Now.

  • The Biggest Mistakes in IBM i Security

    SB Profound WC Generic The Biggest Mistakes in IBM i Security
    Here’s the harsh reality: cybersecurity pros have to get their jobs right every single day, while an attacker only has to succeed once to do incredible damage.
    Whether that’s thousands of exposed records, millions of dollars in fines and legal fees, or diminished share value, it’s easy to judge organizations that fall victim. IBM i enjoys an enviable reputation for security, but no system is impervious to mistakes.
    Join this webinar to learn about the biggest errors made when securing a Power Systems server.
    This knowledge is critical for ensuring integrity of your application data and preventing you from becoming the next Equifax. It’s also essential for complying with all formal regulations, including SOX, PCI, GDPR, and HIPAA
    Watch Now.

  • Comply in 5! Well, actually UNDER 5 minutes!!

    SB CYBRA PPL 5382

    TRY the one package that solves all your document design and printing challenges on all your platforms.

    Produce bar code labels, electronic forms, ad hoc reports, and RFID tags – without programming! MarkMagic is the only document design and print solution that combines report writing, WYSIWYG label and forms design, and conditional printing in one integrated product.

    Request your trial now!

  • Backup and Recovery on IBM i: Your Strategy for the Unexpected

    FortraRobot automates the routine tasks of iSeries backup and recovery, saving you time and money and making the process safer and more reliable. Automate your backups with the Robot Backup and Recovery Solution. Key features include:
    - Simplified backup procedures
    - Easy data encryption
    - Save media management
    - Guided restoration
    - Seamless product integration
    Make sure your data survives when catastrophe hits. Try the Robot Backup and Recovery Solution FREE for 30 days.

  • Manage IBM i Messages by Exception with Robot

    SB HelpSystems SC 5413Managing messages on your IBM i can be more than a full-time job if you have to do it manually. How can you be sure you won’t miss important system events?
    Automate your message center with the Robot Message Management Solution. Key features include:
    - Automated message management
    - Tailored notifications and automatic escalation
    - System-wide control of your IBM i partitions
    - Two-way system notifications from your mobile device
    - Seamless product integration
    Try the Robot Message Management Solution FREE for 30 days.

  • Easiest Way to Save Money? Stop Printing IBM i Reports

    FortraRobot automates report bursting, distribution, bundling, and archiving, and offers secure, selective online report viewing.
    Manage your reports with the Robot Report Management Solution. Key features include:

    - Automated report distribution
    - View online without delay
    - Browser interface to make notes
    - Custom retention capabilities
    - Seamless product integration
    Rerun another report? Never again. Try the Robot Report Management Solution FREE for 30 days.

  • Hassle-Free IBM i Operations around the Clock

    SB HelpSystems SC 5413For over 30 years, Robot has been a leader in systems management for IBM i.
    Manage your job schedule with the Robot Job Scheduling Solution. Key features include:
    - Automated batch, interactive, and cross-platform scheduling
    - Event-driven dependency processing
    - Centralized monitoring and reporting
    - Audit log and ready-to-use reports
    - Seamless product integration
    Scale your software, not your staff. Try the Robot Job Scheduling Solution FREE for 30 days.