Adding Another Disk Drive


Another solution to the problem of running out of disk space is to add another hard disk drive, perhaps as a slave on the primary IDE channel. Using a new disk within SUSE Linux is very easy and can be done from the command-line shell.

Partitioning the Disk

Once the disk has been fitted, boot into SUSE Linux, open a command-line shell and switch to root user. You should then use the cfdisk command to initially partition the disk. Assuming that you've added the new disk as a slave on the primary channel, use the following command:

cfdisk /dev/hdb

Working out how SUSE Linux refers to the hard disks installed on the system isn't hard. Usually, they're given letters from a through to d. So, /dev/hda is the primary master, /dev/hdb is the primary slave, /dev/hdc is the secondary master, and /dev/hdd is the secondary slave. If your system uses SCSI drives, you'll find they're named /dev/sda, /dev/sdb, and so on.

The first thing to do within the cfdisk program is create a new partition. Use the cursor keys to highlight New, and then press Enter. The default partition size should automatically be all of the disk space, so press Enter again to confirm this. With the new partition created, highlight Quit on the menu. This will write the partition table. After this, you should reboot the system to ensure the new partition is made available.

When SUSE Linux is back up and running, open a command-line shell prompt again, switch to root user, and issue the following command (again assuming that the new hard disk is /dev/hdb):

mkfs -t reiserfs /dev/hdb1

Note that you need to specify the partition number in this instance. Because there's only one partition on the disk, this is number 1. Had you created two or more partitions, each would be numbered 1, 2, and 3 consecutively.

You've created a Reiser-formatted partition, because this is the preferred standard used within SUSE Linux. Other versions of Linux might use different file systems, such as ext3.

Configuring SUSE Linux to Use the Drive

Now the new drive is ready for use, but you need a way of making it available within the SUSE Linux file system. Therefore, you need to create a mount point and also configure the system so that the disk is mounted automatically at bootup.

As discussed in Chapter 15, creating a mount point is simply a matter of creating an empty folder. Therefore, you can create a directory in the root of the hard disk (or anywhere else) and call it something like second_disk.

Then you must edit the /etc/fstab file. All you need to do is add a line at the end of the file, such as this:

/dev/hdb1  /second_disk  reiserfs  default  1 1

Note that it's important that you add a carriage return after the line.

You can test your new hard disk by rebooting. When SUSE Linux returns, you should find that the new disk is available by accessing the /second_disk directory. You can check its capacity by typing df –h.




Beginning SUSE Linux from Novice to Professional
Beginning SUSE Linux: From Novice to Professional
ISBN: 1590594584
EAN: 2147483647
Year: 2005
Pages: 293
Authors: Keir Thomas

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net