Skip to main content

Adding virtual disk units to a Linux logical partition







You can add virtual disk units dynamically to a Linux® logical partition that uses IBM® i resources. This allows you to increase the storage capacity of your AIX® logical partition when needed.


Virtual disks simplify hardware configuration on the server because they do not require you to add additional physical devices to the server in order to run Linux. You can allocate up to 64 virtual disks to a Linux logical partition. Each virtual disk supports up to 1000 GB of storage. Each virtual disk appears to Linux as one actual disk unit. However, the associated space in the i integrated file system is distributed across the disks that belong to the i logical partition. Distributing storage across the disks provides the benefits of device parity protection through i. Therefore, you do not have to use additional processing resources and memory resources by setting up device parity protection through Linux.


IBM i provides the ability to dynamically add virtual disks to a Linux logical partition. You can allocate disk space in the integrated file system and make it available to Linux without restarting the server or logical partition. The Linux administrator can also configure the newly allocated disk space and make it available without restarting the server.


To add virtual disks dynamically to a Linux logical partition, do the following:


1. If you use System i® Navigator, create a network-server storage space using System i Navigator.


a. Expand My Connections > your server > Network > Windows Administration .


b. Right-click the Disk Drives and select New Disk.


c. In the Disk drive name field, specify the name that you want to give to the network-server storage space.


d. In the Description field, specify a meaningful description for the network-server storage space.


e. In the Capacity field, specify the size of the new network-server storage space in megabytes. Refer to the installation documentation of your preferred Linux distributor to determine the size you want to use.


f. Click OK.


g. Continue with step 4.


2. If you use a character-based interface, create a network-server storage space using the character-based interface:


a. At an IBM i command line, type the command CRTNWSSTG and press F4. The Create NWS Storage Space (CRTNWSSTG) display opens.


b. In the Network-server storage space field, specify the name you want to give to the network-server storage space.


c. In the Size field, specify the size in megabytes for the new network-server storage space. Refer to the installation documentation of your preferred Linux distributor to determine the size you want to use.


d. In the Text description field, specify a meaningful description for the network-server storage space.


e. Press Enter.


3. If you use System i Navigator, link the network-server storage space using System i Navigator.


a. Expand My Connections > your server > Network > Windows Administration .


b. Click Disk Drives, right-click an available network-server storage space, and select Add Link.


c. Select the server to which you want to link the network-server storage space.


d. Select one of the available data access types.


e. Click OK.


f. Continue with step 5.


4. If you use a character-based interface, link the network-server storage space using a character-based interface:


a. At an IBM i command line, type the command ADDNWSSTGL and press F4. The Add Network-Server Storage Link (ADDNWSSTGL) display opens.


b. In the Network server description field, specify the name of the network server description (NWSD).


c. In the Dynamic storage link field, specify *YES to make the network-server storage space dynamically available to the logical partition (that is, available without rebooting the Linux logical partition).


d. In the Drive sequence number field, specify the link sequence position you want to use.


e. Press Enter.


5. If the Linux logical partition is not running, activate the Linux logical partition. Do not continue until the logical partition is running.


6. Log in to Linux using a user name with superuser (root) privileges.


7. Determine the host ID, SCSI bus, and logical unit number (LUN) for your new virtual disk drive. You can list the existing devices by typing the following command at the Linux command prompt: cat /proc/scsi/scsi. The following example shows sample output of the command:


8. Attached devices:


9. Host: scsi0 Channel: 00 Id: 00 Lun: 00


10. Vendor: IBM Model: VDASD NETSPACE Rev: 0001


Type: Direct-Access ANSI SCSI revision: 04


In this example, NETSPACE is the name of the network storage space for the displayed device. Look for the name of an existing network storage space on your Linux logical partition. Note the numeric part of the Host: value (host ID) and the Channel: (SCSI bus) and Lun: (logical unit number (LUN)) values for the existing network storage space. The new virtual disk drive will have the same host ID, SCSI bus, and LUN as the existing network storage space. For example, if the existing network storage space is as displayed in the preceding example output, then the new virtual disk drive will have a host ID of 0, a SCSI bus of 0, and a LUN of 0.


11. Determine the SCSI ID for your new virtual disk drive. You can list the existing devices in table form by typing the following commands at the Linux command prompt:


12. cd /proc/scsi/sg


cat device_hdr; cat devices


The following example shows sample output of the commands:


host chan id lun type opens qdepth busy online


0 0 0 0 0 2 30 0 1


0 1 0 0 0 0 30 0 1


Note the host (host ID), chan (SCSI bus), id (SCSI ID), and lun (logical unit number (LUN)) values for the existing devices. Find the devices that have the same host ID, SCSI bus, and LUN as the new virtual disk drive (as you determined in the previous step). Of those devices, find the device with the greatest SCSI ID. The new virtual disk drive will have a SCSI ID that is one greater than the greatest existing SCSI ID. For example, if the new virtual disk drive has a host ID of 0, a SCSI bus of 0, and a LUN of 0, and the devices on your Linux logical partition are as listed in the example output above, then the new virtual disk drive will have a SCSI ID of1.


13. Type the following command at the Linux command prompt to add the virtual disk drive manually: echo "scsi add-single-device host chan id lun" > /proc/scsi/scsi. Use the following information to help you understand the arguments of the command:


· host is the host ID.


· chan is the SCSI bus.


· id is the SCSI ID.


· lun is the LUN.


For example, if the new virtual disk drive is to have a host ID of 0, a SCSI bus of 0, a SCSI ID of 1, and a LUN of 0, you would type the command echo "scsi add-single-device 0 0 1 0" > /proc/scsi/scsi at the Linux command prompt.


At the Linux command prompt, type the following command to create a disk partition on the virtual disk drive: fdisk /dev/sdb. You must have superuser (root) privileges to run this command. The Command (m for help): prompt is displayed.


Type p at the prompt to see the current partition table for the virtual disk drive. By default, the new virtual disk drive shows a single disk partition on the virtual disk. For example,


Disk /dev/sdb: 64 heads, 32 sectors, 200 cylinders


Units = cylinders of 2048 * 512 bytes





Device Boot Start End Blocks Id System


/dev/sdb1 1 199 203760 6 FAT16


Type d at the command prompt to delete the current partition and then create a new one. The default format for the disk partition is FAT16. Do not use a disk partition that is formatted as FAT16 on your virtual disk drive. The Partition number (1-4): prompt is displayed.


Type the disk partition number you want to delete and press Enter. In this example, you type a 1. The fdisk command indicates that the deletion is successful by displaying the command prompt.


Type n to create a new disk partition. The Command action E extended P primary partition (1-4) prompt is displayed.


Type p to create a primary disk partition on the virtual disk and press Enter. The Partition number (1-4): prompt is displayed.


Type 1 because this is the first partition on the virtual disk, and press Enter. The First cylinder (1-200, default 1): prompt is displayed.


Press Enter to use the default of 1 for the first disk cylinder. This uses the entire disk for this disk partition. The Last cylinder or +size or +sizeM or +sizeK (1-200, default 200): prompt is displayed.


Press Enter to use the default of 200 for the last disk cylinder. This uses the entire virtual disk for this partition.


Note: The type of the partition defaults to Linux. If you need a different disk type (like Logical Volume Manager (LVM), or LinuxExtended), type t to change the type of the partition.


The fdisk command indicates that the partition creation is successful by returning the command prompt.


Type w to commit the changes to the disk structure and press Enter. The fdisk command writes the changes to the virtual disk drive. The fdisk command displays the following diagnostic message:


The partition table has been altered!





Calling ioctl() to re-read partition table.


Syncing disks.


After the operation is completed, the fdisk command returns the command prompt.


Format the disk partition using the Linux mkfs command . There are a number of optional parameters for the mkfs command, but typically the defaults satisfy most disk uses. To format the disk partition created in the previous steps, ensure that you are logged in with superuser (root) privileges and type the following command at a Linux command prompt:


mkfs /dev/sdb1


Since a single disk partition exists on the second virtual disk, the name of the disk is /dev/sdb1 (the sdb indicates that it is the second disk, and the 1 indicates that it is partition 1). The mkfs command displays the following diagnostic messages:


mke2fs 1.28 (31-Aug-2002)


Fileserver label=


OS type: Linux Block size=1024 (log=0)


Fragment size=1024 (log=0)


51200 inodes, 204784 blocks


10239 blocks (5.00%) reserved for the super user


First data block=1


25 block groups


8192 blocks per group, 8192 fragments per group


2048 inodes per group


Superblock backups stored on blocks:


8193, 24577, 40961, 57345, 73729






Writing inode tables: done


Writing superblocks and fileserver accounting information: done






This fileserver will be automatically checked every 29 mounts or


180 days, whichever comes first. Use tune2fs -c or -i to override.


Type the following command to create a directory that you can use to access the new file: mkdir /mnt/data


Type the following command to mount the virtual disk drive in the new directory: mount /dev/sdb1 /mnt/data


Add an entry to the /etc/fstab file using a Linux text editor, such as vi. For example, /dev/sdb1 /mnt/data ext2 defaults 1 1. This entry mounts the virtual disk every time you restart Linux.


Popular posts from this blog

HOW TO EDIT THE BCD REGISTRY FILE

The BCD registry file controls which operating system installation starts and how long the boot manager waits before starting Windows. Basically, it’s like the Boot.ini file in earlier versions of Windows. If you need to edit it, the easiest way is to use the Startup And Recovery tool from within Vista. Just follow these steps: 1. Click Start. Right-click Computer, and then click Properties. 2. Click Advanced System Settings. 3. On the Advanced tab, under Startup and Recovery, click Settings. 4. Click the Default Operating System list, and edit other startup settings. Then, click OK. Same as Windows XP, right? But you’re probably not here because you couldn’t find that dialog box. You’re probably here because Windows Vista won’t start. In that case, you shouldn’t even worry about editing the BCD. Just run Startup Repair, and let the tool do what it’s supposed to. If you’re an advanced user, like an IT guy, you might want to edit the BCD file yourself. You can do this

DNS Scavenging.

                        DNS Scavenging is a great answer to a problem that has been nagging everyone since RFC 2136 came out way back in 1997.  Despite many clever methods of ensuring that clients and DHCP servers that perform dynamic updates clean up after themselves sometimes DNS can get messy.  Remember that old test server that you built two years ago that caught fire before it could be used?  Probably not.  DNS still remembers it though.  There are two big issues with DNS scavenging that seem to come up a lot: "I'm hitting this 'scavenge now' button like a snare drum and nothing is happening.  Why?" or "I woke up this morning, my DNS zones are nearly empty and Active Directory is sitting in a corner rocking back and forth crying.  What happened?" This post should help us figure out when the first issue will happen and completely avoid the second.  We'll go through how scavenging is setup then I'll give you my best practices.  Scavenging s

AD LDS – Syncronizing AD LDS with Active Directory

First, we will install the AD LDS Instance: 1. Create and AD LDS instance by clicking Start -> Administrative Tools -> Active Directory Lightweight Directory Services Setup Wizard. The Setup Wizard appears. 2. Click Next . The Setup Options dialog box appears. For the sake of this guide, a unique instance will be the primary focus. I will have a separate post regarding AD LDS replication at some point in the near future. 3. Select A unique instance . 4. Click Next and the Instance Name dialog box appears. The instance name will help you identify and differentiate it from other instances that you may have installed on the same end point. The instance name will be listed in the data directory for the instance as well as in the Add or Remove Programs snap-in. 5. Enter a unique instance name, for example IDG. 6. Click Next to display the Ports configuration dialog box. 7. Leave ports at their default values unless you have conflicts with the default values. 8. Click N