-->
Previous Table of Contents Next


Linux and Hard Disk Names

After logging in, you’ll want to directly run the fdisk command (ignoring what the screen instructions say about the setup command). The fdisk command assumes that the first IDE drive is the default drive. If you plan on installing Linux on another drive, you’ll need to specify that on the command line. Table 2.5 lists the hard disk device names.

Table 2.5 Linux Hard Disk Device Names
Name Meaning

/dev/hda First IDE hard drive
/dev/hdb Second IDE hard drive
/dev/sda First SCSI hard drive
/dev/sdb Second SCSI hard drive
/dev/fd0 First floppy drive (A:)
/dev/fd1 Second floppy drive (B:)

Note the pattern in Table 2.5? In addition, Linux allows you to specify the partitions in the device names. For example, the first primary partition on the first IDE drive would be known as /dev/hda1, the second primary partition on the first IDE drive would be known as /dev/hda2, and so on. If you’re installing logical partitions, the first logical partition would appear as /dev/hda5, the second logical partition would appear as /dev/hda6, and so on.


NOTE:  The files representing these devices will end up in the directory /dev.

To run fdisk on the second SCSI hard drive, you’d use the following command line:


     # fdisk /dev/sdb

Most of you (most PCs are sold with IDE drives) will be told that Linux is using the first hard drive as the default. When you press m for a list of options, you’ll see the following listing:


     Command action

        a   toggle a bootable flag

        c   toggle the dos compatibility flag

        d   delete a partition

        l   list known partition types

        m   print this menu

        n   add a new partition

        p   print the partition table

        q   quit without saving changes

        t   change a partition's system id

        u   change display/entry units

        v   verify the partition table

        w   write table to disk and exit

        x   extra functionality (experts only)

There are really only three options you’ll ever use, unless you run into some esoteric configurations:

  d, which deletes a current partition. This will work on non-Linux partitions.
  n, which creates a new partition.
  p, which prints a rundown of the current partition table. This will list non-Linux partitions as well.


WARNING:  Linux allows you to make your hard disk configuration (and any configuration) as complex as you want it to be. Our philosophy is to keep it as simple as possible; unless you have a real need for multiple partitions and the like, just keep to the basics—a DOS partition, a Linux partition, and perhaps a partition for an additional operating system (like OS/2) if you like.

Some argue that by creating multiple Linux partitions, you’ll be able to recover more easily if something happens to the boot partition. (Damage to one partition doesn’t automatically mean that all the partitions are damaged.) However, if you’re making frequent backups of important files (mostly data and configuration files), you’ll have a more reliable setup. If there’s damage to the PC’s File Allocation Table (FAT), you’ll have problems with all your partitions.


If you select p, you’ll see the following:


   Device Boot  Begin   Start    End  Blocks   Id  System

/dev/hda1   *       1       1     63   20762+   4  DOS 16-bit (32M)

This is the DOS partition you created in the previous sections.

Before you actually create the Linux partition, you should decide if you want to install a swap partition.


Previous Table of Contents Next