Online Book Reader

Home Category

Running Linux, 5th Edition - Matthias Kalle Dalheimer [36]

By Root 1161 0
command to write the changes to disk and exit fdisk:

Command (m for help): w

#

Keep in mind that none of the changes you make while running fdisk takes effect until you give the w command, so you can toy with different configurations and save them when you're done. Also, if you want to quit fdisk at any time without saving the changes, use the q command. Remember that you shouldn't modify partitions for operating systems other than Linux with the Linux fdisk program.

You may not be able to boot Linux from a partition using cylinders numbered over 1023. Therefore, you should try to create your Linux root partition within the sub-1024 cylinder range, which is almost always possible (e.g., by creating a small root partition in the sub-1024 cylinder range). If, for some reason, you cannot or do not want to do this, you can simply boot Linux from floppy, use the rescue option of the installation CD or DVD, or boot a Linux live CD like Knoppix.

Some Linux distributions require you to reboot the system after running fdisk to allow the changes to the partition table to take effect before installing the software. Newer versions of fdisk automatically update the partition information in the kernel, so rebooting isn't necessary. To be on the safe side, after running fdisk you should reboot from the installation medium before proceeding.

Creating Swap Space

If you are planning to use a swap partition for virtual RAM, you're ready to prepare it.[*] In "Managing Swap Space" in Chapter 10, we discuss the preparation of a swap file, in case you don't want to use an individual partition.

Many distributions require you to create and activate swap space before installing the software. If you have a small amount of physical RAM, the installation procedure may not be successful unless you have some amount of swap space enabled.

The command used to prepare a swap partition is mkswap , and it takes the following form:

mkswap -c partition

where partition is the name of the swap partition. For example, if your swap partition is /dev/hda3, use the command

# mkswap -c /dev/hda3

With older versions of mkswap, you had to specify the size of the partition, which was dangerous, as one typo could destroy your disk logically.

The -c option tells mkswap to check for bad blocks on the partition when creating the swap space. Bad blocks are spots on the magnetic medium that do not hold the data correctly. This occurs only rarely with today's hard disks, but if it does occur, and you do not know about it, it can cause you endless trouble. Always use the -c option to have mkswap check for bad blocks. It will exclude them from being used automatically.

If you are using multiple swap partitions , you need to execute the appropriate mkswap command for each partition.

After formatting the swap space, you need to enable it for use by the system. Usually, the system automatically enables swap space at boot time. However, because you have not yet installed the Linux software, you need to enable it by hand.

The command to enable swap space is swapon, and it takes the following form:

swapon partition

After the mkswap command shown, we use the following command to enable the swap space on /dev/hda3:

# swapon /dev/hda3

Creating the Filesystems

Before you can use your Linux partitions to store files, you must create filesystems on them. Creating a filesystem is analogous to formatting a partition under Windows or other operating systems. We discussed filesystems briefly in "Linux Partition Requirements," earlier in this chapter.

Several types of filesystems are available for Linux. Each filesystem type has its own format and set of characteristics (such as filename length, maximum file size, and so on). Linux also supports several third-party filesystem types, such as the Windows filesystem.

The most commonly used filesystem types are the Second Extended Filesystem, or ext2fs and the Third Extended Filesystem, or ext3fs. The ext2fs and ext3fs filesystems are two of the most efficient and flexible filesystems; they allows filenames

Return Main Page Previous Page Next Page

®Online Book Reader