How to Set ipvtuserver11.04 for iSCSI

Source: Internet
Author: User
UbuntuServer applies to many roles. In many cases, it is possible to assign multiple roles to a server. When you first install UbuntuServer, you will get a list of options, including OpenSSH, DNS, LAMP, Mail, PostgreSQL database, Print, Samba, TomcatJava, and VirtualMachine hosts. With virtualization, You can host different roles into individual Virtual Machine (VM) instances without stopping them.

Ubuntu Server has many roles. In many cases, it is possible to assign multiple roles to a server. When you first install an Ubuntu Server, you will get a list of options, including OpenSSH, DNS, LAMP, Mail, PostgreSQL database, Print, Samba, Tomcat Java, and Virtual Machine hosts.


With virtualization, different roles can be hosted into individual Virtual Machine (VM) instances. You can easily perform updates and restart the system without stopping other services. For storage roles, you can use Samba to install a file server. However, in today's enterprise environments, you are more likely to find using iSCSI NAS, while Ubuntu Server 11.04 is competent for this task. A nas iSCSI storage server is not a role that can be configured in the installation menu, but it is not difficult to install it. The key to installing a server for this storage role is the combination of hardware (multiple disk spaces) and correct software modules and configurations. In this article, I will discuss the necessary conditions for correctly configuring everything and how to manage the system after installation.

   Set Ubuntu 11.04 as the iSCSI target

As long as you are familiar with the command line, it is not difficult to configure the Ubuntu server to an iSCSI target. The first thing you need to do is install iscsitarget packets. Run the following command:

   Aptitude install iscsitarget

After the process ends, you must edit the file/etc/default/iscsitarget and change the options from an error to correct. The command line is similar to the following:

   ISCSITARGET_ENABLE = true

The iscsitarget module handles security issues in multiple ways. Use the/etc/initiators. allow file to specify access based on an IP address. By default, this file has an "ALL" entry, which means it gives ALL applicants the right to access ALL targets.

To start the service, enter:

   /Etc/init. d/iscsitarget start

At this time, there are no available targets, but you can view the iscsitarget module to see the service running. It uses port 3260 for all communications. The open file LIST command with the-I parameter can be used to determine whether any process is connected to this port:

   # Lsof-I: 3260 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME ietd

1356 root 8u IPv4 8958 0t0 TCP *: 3260 (LISTEN)

Ietd 1356 root 9u IPv6 8959 0t0 TCP *: 3260 (LISTEN)


The network status command and grep will also check the activity on port 3260:

   Netstat-apne grep 3260

There are many different options for creating an iSCSI target device. This includes a physical device, a logical volume, or a file. Because the drive types of file storage devices are different, file-based devices may have performance problems. The following command is used to create a blank 20 GB file. You can use it as a file-based object:

   Dd if =/dev/zero of =/storage/lun1.img bs = 1024 k count = 20000

To add the target volume, edit the ietd. conf file. It is the configuration file used for iSCSI Enterprise Target daemon (ietd. In Ubuntu Server 11.04, the file is saved in a previous version of/etc/iet directory. Ubuntu Server and put in/etc directory. In this file, many files use # To add comments. The first line you need to change is the Target line:

   Target iqn.2001-04.com. example: storage. disk2.lun1

The second line you need to change is the row that specifies LUN 0. The number of Luns must start from 0, and each target must have a LUN 0:

   Lun 0 Path =/storage/lun1.img, Type = fileio

Then, run the following command to restart the iscsitarget module:

   /Etc/init. d/iscsitarget restart

To check the status, you can view the content of two files (volumes and sessions) in/proc/net/iet directory:

   Root @ brief tvmsrv:/etc/iet # cat/proc/net/iet/volume

Tid: 1 name: iqn.2001-04.com. example: storage. disk2.lun1

Lun: 0 state: 0 iotype: fileio iomode: wt blocks: 2048000 block size: 512 path:/storage/lun1.img

Root @ brief tvmsrv:/etc/iet # cat/proc/net/iet/session

Tid: 1 name: iqn.2001-04.com. example: storage. disk2.lun1


   ISCSI target management on Ubuntu

Webmin is a good tool for managing all Linux server systems. However, you need to add a module to manage the iSCSI target configuration. It is easy to add Webmin: Open the web browser, enter webmin.org, click "third-party module", search for iSCSI, copy the connection, and paste it to The Webmin add Module window. This provides access to all iSCSI and management system storage configuration options. It displays the files and script commands used by Webmin to complete the configuration.

Webmin provides access to potential storage hardware for RAID configuration, disk partitioning, and full control of logical volume Management (LVM ).



After Webmin is added, you can avoid the command line configuration of Ubuntu Server 11.04. This Linux operating system release is suitable for general purpose server functions, including low-cost storage servers.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.