-->
Previous | Table of Contents | Next |
Next, create your primary Linux filesystem partition in the same manner. If you want to use the rest of the disk drive for that partition, you can enter the end sector number of your drive (Linuxs fdisk tells you the range you can use). This would be the usual default if your hard drive has a DOS, Linux swap space, and Linux filesystem partition on it. After you have created the Linux filesystem, you should identify its filetype as 82, which is a Linux native type.
You should note somewhere the size of the swap space and filesystem partitions, in blocks, because you will need this information later. You can read this straight from the partition table.
After youve created the Linux partitions and are satisfied with the partition table layout, save and exit fdisk. If you dont save the information, you must repeat the process.
Linux installation routine requires a good chunk of RAM to proceed. If you have 4MB of RAM or less, you will have problems installing Linux unless you have the kernel use the swap space. (If you have only 4MB or less of RAM in your system, you should have a swap space of at least 8MB, and preferably 16MB.) If you try to install Linux and get memory error messages, its because there is not enough RAM, and the swap space is needed.
Tip:
If youve turned the swap space on and still get error messages when you try to install Linux, you need either more physical RAM or a larger swap space. Its better to increase the swap space and install Linux now than it is to have to redo it later. To increase the size of a swap space partition, you may have to remove the existing Linux partitions and re-create them with fdisk.
If you have a small amount of RAM, you should enable the swap space to help the installation process. Even if you have lots of RAM, theres no reason not to enable the swap space now, anyway. To enable the swap space, issue the following command, in which partition is the name of the partition, and size is the size of the partition in blocks:
mkswap -c partition size
You may have noted this number earlier when setting up the partition table. If not, you can start fdisk again and read the size in blocks from the partition table display.
For example, if you have set up the Linux swap space on partition /dev/hda2 (the second primary partition on the first non-SCSI drive) and it has a size of 13,565 blocks, you would issue the following command:
mkswap -c /dev/hda2 13565
The -c option tells the mkswap utility to check for bad blocks in the partition. If this option is on, it will take a little longer to create the swap partition, but a bad block in the swap partition can cause your entire system to crash, so its worth the delay. If mkswap finds any errors in the swap space, it will generate an error message. However, since mkswap flags bad blocks to be left alone, you can ignore the messages unless there are a considerable number of them, in which case your hard drive has too many bad blocks!
When the swap partition has been formatted, you enable the Linux swap space partition with the command swapon. Usually, you must specify the partition, although some versions can figure the partition out automatically from the partition table. It never hurts to be explicit, though. To enable the swap partition just formatted, enter the command
swapon /dev/hda2
Repeat the format and swapon commands for each swap partition if you created more than one. As soon as the swapon command is executed, the Linux kernel starts to use the new swap space as an extension of the physical RAM.
After you have a swap space configured and working, you can set up the Linux file-system. This step may be automated by some Linux installation scripts, or you may have to execute it yourself. Either way, this section explains what is going on.
You have already allocated the partition table to support a Linux filesystem. Now you can create the filesystem with the mkfs (make filesystem) command. The exact format of the command depends on the type of filesystem you are setting up. The most popular filesystem (for reasons of speed and flexibility) is called the Second Extended filesystem (which has nothing to do with extended partitions on a hard disk). To create a Second Extended filesystem, issue this command, in which partition is the device name and size is the size of the partition in blocks (taken from the partition display in fdisk):
mke2fs -c <partition> <size>
For example, to create a filesystem in /dev/hda3, which is 162,344 blocks in size, the command would be
mke2fs -c /dev/hda3 162344
When specifying the size of a partition, make sure you use blocks and not sectors or cylinders. Using the wrong value results in errors or only a fraction of your partition being used.
The mke2fs utility checks the partition for bad blocks (the -c option), then set the filesystem up properly in that partition. If you are setting up a large partition, the disk check can take a few minutes, but you should not ignore it unless you know your disk is good.
The other filesystems available to Linux are the Xia filesystem, the Extended filesystem, and the Minix filesystem. The Xia filesystem is good, but not as popular as the Second Extended. The Extended filesystem is an older version of Second Extended, while the Minix filesystem is compatible with the old Minix operating system (which Linux was written to replace). You can create these filesystems with the following commands:
All three commands take the same arguments as the Second Extended filesystem command. The Minix filesystem is limited to 64MB.
None of the mkfs commands format the filesystem, but simply set it up. You are prompted for a filesystem format during the installation process.
Previous | Table of Contents | Next |