176 lines
11 KiB
HTML
176 lines
11 KiB
HTML
|
<?xml version="1.0" encoding="UTF-8"?>
|
||
|
<!DOCTYPE html
|
||
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
|
<html lang="en-us" xml:lang="en-us">
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||
|
<meta name="security" content="public" />
|
||
|
<meta name="Robots" content="index,follow" />
|
||
|
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
|
||
|
<meta name="DC.Type" content="task" />
|
||
|
<meta name="DC.Title" content="Dynamically adding disks to a Linux partition" />
|
||
|
<meta name="abstract" content="Virtual devices simplify hardware configuration on the iSeries server because they do not require you to add additional physical devices to the server in order to run Linux." />
|
||
|
<meta name="description" content="Virtual devices simplify hardware configuration on the iSeries server because they do not require you to add additional physical devices to the server in order to run Linux." />
|
||
|
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
|
||
|
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1998, 2006" />
|
||
|
<meta name="DC.Format" content="XHTML" />
|
||
|
<meta name="DC.Identifier" content="rzalmdynamicallyaddingdisks" />
|
||
|
<meta name="DC.Language" content="en-us" />
|
||
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
||
|
<!-- US Government Users Restricted Rights -->
|
||
|
<!-- Use, duplication or disclosure restricted by -->
|
||
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
||
|
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
|
||
|
<link rel="stylesheet" type="text/css" href="./ic.css" />
|
||
|
<title>Dynamically adding disks to a Linux partition</title>
|
||
|
</head>
|
||
|
<body id="rzalmdynamicallyaddingdisks"><a name="rzalmdynamicallyaddingdisks"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Dynamically adding disks to a Linux partition</h1>
|
||
|
<div><p>Virtual devices simplify hardware configuration on the iSeries™ server
|
||
|
because they do not require you to add additional physical devices to the
|
||
|
server in order to run Linux. </p>
|
||
|
<div class="p">You can allocate up to 64 virtual disks to a Linux partition, with
|
||
|
a maximum of twenty disks visible to Linux, depending on which distribution
|
||
|
you use. Each disk supports up to 1000 GB of storage. Each virtual disk appears
|
||
|
to Linux as a single physical unit. However, the associated space in the i5/OS<sup>®</sup> integrated
|
||
|
file system is spread across all of the disk arms available on the iSeries server.
|
||
|
This provides the benefits of RAID without the overhead of RAID support in
|
||
|
the Linux kernel.<p>i5/OS provides the ability to dynamically add virtual
|
||
|
disks to a Linux partition. You can allocate disk space in the integrated
|
||
|
files system and make it available to Linux without restarting i5/OS or Linux.
|
||
|
The Linux server administrator can also configure the newly allocated disk
|
||
|
space and make it available, again without interrupting the server.</p>
|
||
|
</div>
|
||
|
<div class="section">To dynamically add virtual disks to a Linux partition, do the following:</div>
|
||
|
<ol><li class="stepexpand"><span>Create a disk drive using iSeries Navigator.</span><ol type="a"><li><span>Click <span class="menucascade"><span class="uicontrol">Network</span> > <span class="uicontrol">Windows
|
||
|
Administration</span></span>.</span></li>
|
||
|
<li><span>Right-click the <span class="uicontrol">Disk Drives</span> folder and
|
||
|
click <span class="uicontrol">New Disk</span>.</span></li>
|
||
|
<li><span>In the Disk drive name field, specify a disk drive name.</span></li>
|
||
|
<li><span>In the Description field, specify a description of this disk.</span></li>
|
||
|
<li><span>If you want to copy data from another disk, select <span class="uicontrol">Initialize
|
||
|
disk with data from another disk</span>. Then specify the source disk
|
||
|
to copy data from.</span></li>
|
||
|
<li><span>In the Capacity field, specify the disk capacity.</span></li>
|
||
|
<li><span>Click <span class="uicontrol">OK</span>.</span></li>
|
||
|
</ol>
|
||
|
</li>
|
||
|
<li class="stepexpand"><span>Link a disk drive using iSeries Navigator.</span><ol type="a"><li><span>Click <span class="menucascade"><span class="uicontrol">Network</span> > <span class="uicontrol">Windows
|
||
|
Administration</span> > <span class="uicontrol">Disk Drives</span></span>.</span></li>
|
||
|
<li><span>Right-click an available disk drive and select <span class="uicontrol">Add
|
||
|
Link</span>.</span></li>
|
||
|
<li><span>Select the server that you want to link the disk to.</span></li>
|
||
|
<li><span>Select one of the available link types and the link sequence
|
||
|
position.</span></li>
|
||
|
<li><span>Select one of the available data access types.</span></li>
|
||
|
<li><span>Click <span class="uicontrol">OK</span>.</span></li>
|
||
|
</ol>
|
||
|
</li>
|
||
|
<li class="stepexpand"><span>Determine the device name of the new disk. </span> As far as i5/OS is
|
||
|
concerned, the space is available to the Linux partition. Now you need to
|
||
|
run through a couple of steps within Linux to partition, format, and access
|
||
|
the disk. The name depends on two factors:<ul><li>The distribution of Linux</li>
|
||
|
<li>The number of disks currently allocated</li>
|
||
|
</ul>
|
||
|
<p> For example, with the SUSE distribution with a single disk allocated,
|
||
|
the first disk device is known as <kbd class="userinput">/dev/hda</kbd>. The second
|
||
|
disk (the newly allocated virtual disk) is known as <kbd class="userinput">/dev/hdb</kbd>.</p>
|
||
|
</li>
|
||
|
<li class="stepexpand"><span>Create partitions on the new disk with the fdisk command in Linux.</span> The fdisk command is a standard Linux command and is the same for all
|
||
|
distributions. You must have superuser (also known as <dfn class="term">root</dfn>) privileges
|
||
|
to execute this command.<ol type="a"><li><span>From the command line, type <kbd class="userinput">fdisk /dev/hdb</kbd> and
|
||
|
press <span class="uicontrol">Enter</span>.</span></li>
|
||
|
</ol>
|
||
|
The command responds with the following prompt: <tt class="sysout">Command
|
||
|
(m for help):</tt></li>
|
||
|
<li class="stepexpand"><span>Type <span class="uicontrol">p</span> (for print) at the prompt to display
|
||
|
the current partition table for the disk. </span> By default, a new virtual
|
||
|
disk shows a single partition formatted as FAT16. For example, <pre>Disk /dev/hdb: 64 heads, 32 sectors, 200 cylinders
|
||
|
Units = cylinders of 2048 * 512 bytes
|
||
|
|
||
|
Device Boot Start End Blocks Id System
|
||
|
/dev/hdb1 1 199 203760 6 FAT16</pre>
|
||
|
</li>
|
||
|
<li class="stepexpand"><span>Delete the partition.</span> The FAT16 partition is not required.
|
||
|
You need to delete the current partition and then create a new one. <ol type="a"><li><span>To delete the partition, Type <span class="uicontrol">d</span> at the
|
||
|
command prompt.</span></li>
|
||
|
</ol>
|
||
|
The fdisk command responds with the following prompt: <tt class="sysout">Partition
|
||
|
number (1-4):</tt></li>
|
||
|
<li class="stepexpand"><span>Enter the partition number (in this case, 1), and press <span class="uicontrol">Enter</span>. </span> The fdisk prompt returns a message indicating that the deletion was
|
||
|
successful.</li>
|
||
|
<li class="stepexpand"><span>Create a new partition.</span><ol type="a"><li class="substepexpand"><span>Type the command <span class="uicontrol">n</span> for a new partition.</span> The fdisk prompt returns the following:<pre>Command action
|
||
|
E extended
|
||
|
P primary partition (1-4)</pre>
|
||
|
</li>
|
||
|
<li class="substepexpand"><span>Type the command <span class="uicontrol">p</span> and press <span class="uicontrol">Enter</span>.</span> The fdisk prompt returns the following:<pre>Partition number (1-4):</pre>
|
||
|
</li>
|
||
|
<li class="substepexpand"><span>Since this is the first partition on the disk, enter <span class="uicontrol">1</span> and
|
||
|
press <span class="uicontrol">Enter</span>. </span> The fdisk prompt returns the
|
||
|
following:<pre>First cylinder (1-200, default 1):</pre>
|
||
|
</li>
|
||
|
<li class="substepexpand"><span>Type <span class="uicontrol">1</span> and press <span class="uicontrol">Enter</span>. </span> The fdisk prompt returns the following:<pre>Last cylinder or +size or +sizeM or +sizeK (1-200, default 200):</pre>
|
||
|
</li>
|
||
|
<li class="substepexpand"><span>Type <span class="uicontrol">200</span> and press <span class="uicontrol">Enter</span>. </span> The fdisk prompt appears again, indicating that the partition
|
||
|
creation was successful.<div class="note"><span class="notetitle">Note:</span> The type of the partition defaults to Linux.
|
||
|
If you need a different disk type (like LVM, or Linux Extended), use the <span class="uicontrol">t</span> (for
|
||
|
type) command to change the type of the partition.</div>
|
||
|
</li>
|
||
|
</ol>
|
||
|
</li>
|
||
|
<li class="stepexpand"><span>Type w (for write) to commit the changes and press <span class="uicontrol">Enter</span>.</span> Up until this point, you have made no changes to the disk structure.
|
||
|
After you commit the changes, fdisk responds with the following diagnostic
|
||
|
messages: <pre>The partition table has been altered!
|
||
|
|
||
|
Calling ioctl() to re-read partition table.
|
||
|
Syncing disks.</pre>
|
||
|
</li>
|
||
|
<li class="stepexpand"><span>Type <kbd class="userinput">mkfs</kbd> to format the new partition. </span> The mkfs command is a standard Linux command that should be available
|
||
|
on each Linux distribution. There are a number of optional parameters for
|
||
|
mkfs, but typically the defaults satisfy most disk uses. To format the partition
|
||
|
created in the previous steps, enter the following command (again, as with
|
||
|
the fdisk command, you need to be logged in as root to execute the mkfs command):<pre>mkfs /dev/hdb1</pre>
|
||
|
<p>Remember
|
||
|
that a single partition exists on the second disk. Hence the name /dev/hdb1
|
||
|
(the hdb indicates that it is the second disk, and the 1 indicates that it
|
||
|
is partition 1). The following diagnostic messages appear:</p>
|
||
|
<pre>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 backkups 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.</pre>
|
||
|
</li>
|
||
|
<li class="stepexpand"><span>Create a new directory. </span> Finally, within the Linux file
|
||
|
tree, you need to create a directory that you can use to access the new file
|
||
|
system. You also need to allocate the new fileserver to that point within
|
||
|
the directory tree. To do this, we create a directory and mount the physical
|
||
|
resource as follows:<ol type="a"><li><span>Type <kbd class="userinput">mkdir /mnt/data</kbd> and press <span class="uicontrol">Enter</span>.</span></li>
|
||
|
<li><span>Type <kbd class="userinput">mount /dev/hdb1 /mnt/data</kbd> and press <span class="uicontrol">Enter</span>.</span></li>
|
||
|
</ol>
|
||
|
</li>
|
||
|
<li class="stepexpand"><span>Add an entry. </span> You now have new virtual disk space available
|
||
|
to the running Linux partition. To facilitate automatic mounting of the resource
|
||
|
across Linux starts, add an entry to the <samp class="codeph">/etc/fstab</samp> file
|
||
|
(this is the file that stores mount definitions). For this example, the entry
|
||
|
in <samp class="codeph">/etc/fstab</samp> would appear as follows:<pre>/dev/hdb1 /mnt/data ext2 defaults 1 1</pre>
|
||
|
</li>
|
||
|
</ol>
|
||
|
</div>
|
||
|
|
||
|
</body>
|
||
|
</html>
|