
88 Chapter 5. The ext3 File System
5.2. Creating an ext3 File System
If you are adding a new disk drive to a Red Hat Linux system and want to utilize the ext3 file system,
you must first partition the hard disk with a program such as fdisk and then format the file system.
5.2.1. Partitioning with fdisk
To use fdisk, open a shell prompt and log in as the root user. The fdisk command requires you to
specify the device you are partitioning as an argument to the command. In the following examples,
the device will be /dev/hdb, which corresponds to the second device on the primary IDE channel.
To begin, type:
/sbin/fdisk /dev/hdb
The following table provides the most common fdisk commands.
Command What it Does
m displays help
p displays the current partition table
d deletes a partition
n creates a new partition
w writes the partition table to disk
t sets the anticipated file system type for the partition
l displays the list of file system types for partitions
q quits fdisk without altering the disk
Table 5-1. fdisk commands
Tip
If you need to exit the program at any time without altering your disk, type q.
Now that you are in the fdisk program, type n to create a new partition. The program will ask you
to choose a partition type, choose e for an extended and p for a primary partition.
Before choosing the partition type, be aware that Red Hat Linux only allows up to four primary
partitions per disk. If you wish to create more than that, one (and only one) of the four primary
partitions may be an extended partition, which acts as a container for one or more logical partitions.
Since it acts as a container, the extended partition must be at least as large as the total size of all the
logical partitions it is to contain. For more information on disk partitions, see the Appendix called An
Introduction to Disk Partitions in the Official Red Hat Linux Installation Guide.
After choosing the partition type and the number for that partition, choose which cylinder head you
would like the partition to start on. You can type [Enter] to accept the default value.
Next, specify the size. The easiest way to do this is to type +sizeM, where size is the size of the
partition in megabytes. If you press [Enter] without entering a value, fdisk will use the remainder of
the disk.
Repeat this process until you have created your desired partitioning scheme.
Commenti su questo manuale