Online Book Reader

Home Category

UNIX System Administration Handbook - Evi Nemeth [97]

By Root 3082 0

See page 246 for more information about installing device drivers.

In our case, we saw the following messages from our BusLogic SCSI host adaptor:

scsi0 : BusLogic BT-948

scsi : 1 host.

Vendor: SEAGATE Model: ST446452W Rev: 0001

Type: Direct-Access ANSI SCSI revision: 02

Detected scsi disk sda at scsi0, channel 0, id 3, lun 0

scsi0: Target 3: Queue Depth 28, Asynchronous

SCSI device sda: hdwr sector=512 bytes. Sectors=91923356 [44884 MB] [44.9 GB]

sda: unknown partition table

Ignore warnings about the partition table, since this is the first time the disk has been used. Once the system has finished booting, you can move on to partitioning the disk.

You must first check to see if device files for the disk already exist. In Linux, the names for SCSI disk device files are of the form /dev/sdXN, where X is a lowercase letter that identifies the drive (‘a’ is the lowest numbered SCSI disk, ‘b’ is the second lowest, and so on14) and N is the partition number, starting at 1. When referring to the whole disk, simply omit the partition number. There are no character (raw) disk devices in Linux.

In this example, our disk is the first one on the SCSI chain. The first partition is therefore /dev/sda1, and the disk as a whole is referred to as /dev/sda. If these device files do not exist, we can create them with the /dev/MAKEDEV script:

# cd /dev

# ./MAKEDEV sda

The disk is now ready to be partitioned. As in most PC operating systems, the tool used for partitioning under Red Hat is called fdisk. Though all versions of fdisk do approximately the same thing (they implement Microsoft’s standard partitioning system), there are many variations among them. You would be wise to read the man page for your particular system to be sure it matches what we show here.

# fdisk /dev/sda

The number of cylinders for this disk is set to 5721.

There is nothing wrong with that, but this is larger than 1024,

and could in certain setups cause problems with:

1) software that runs at boot time (e.g., LILO)

2) booting and partitioning software from other OSs

(e.g., DOS FDISK, OS/2 FDISK)

Since we will be using this disk only on our Linux system, we will ignore the helpful warning. As stated in the geometry discussion on page 124, it is sometimes important to make the first partition small to ensure that it will work with an old BIOS and will work with other operating systems that might be installed on the system.

The fdisk program is interactive; pressing m displays a list of all its commands. The ones we will use here are:

• n to create a new partition

• t to change the type of a partition

• p to print the partition table

• w to write the partition table to disk

Since our disk does not yet have partitions, we start by creating a new one. If there are old partitions from a disk’s former life, you may have to remove them with fdisk’s delete command before you can create new ones. The fdisk program will not change anything on disk until you tell it to write the partition table.

The partition table has room for four “primary” partitions which can be used to hold data. Alternatively, you can create an “extended” partition, which is a primary partition that points to another partition table, giving you another four “logical” partitions. Although the use of extended partitions can overcome the normal four-partition restriction, it is simplest to stick with primary partitions if only a few will be needed, and that’s what we’ll do in this case:

Command (m for help): new

Command action

e extended

p primary partition (1-4): p

Partition number (1-4): 1

First cylinder (1-5721, default 1): 1

Last cylinder or +size or +sizeM or +sizeK (1-5721, default 5721): +2G

Command (m for help): print

Disk /dev/sda: 255 heads, 63 sectors, 5721 cylinders

Units = cylinders of 16065 * 512 bytes

Device Boot Start End Blocks Id System

/dev/sda1 1 255 2048256 83 Linux

We create a swap partition similarly, except that we change the type from Linux to Linux Swap. Although the kernel does not care about the partition

Return Main Page Previous Page Next Page

®Online Book Reader