logo
OpenSource Apache Embedded?C Linux MySQL No deposit no GamStop bonuses Perl PHP Samba

Module Release December 2002: Create Partitions and Filesystems

This month's release moves into one of those areas which can scare and confuse first timers and experienced users alike. Many beginners like the idea of dual booting Linux with MS-Windows, until they face the problem of resizing and repartitioning their hard drives. For many experienced users repartitioning also comes under the heading of ?scary hardware stuff?, even if it doesn't quite fall into the category of ?things the kernel takes care of for us?.

Although complex disk partitioning is no longer a requirement for a basic standalone Linux installation, most systems still require a minimum of two partitions (one for the root filesystem and one for swap space) and most hard disks come with only one partition occupying all of their disk space, i.e., only the users of pre-installed Linux systems can avoid the task of repartioning.

The module begins by explaining what partitions are, and the way their use is constrained by IBM PC-compatible architecture, e.g., the limit of four (indivisible) primary partitions and the use of (sub-dividable) extended partitions to overcome that limit. This leads into a discussion of Linux's naming and numbering conventions for primary, extended and logical partitions running off IDE and SCSI controllers.

The core of this module describes the use of fdisk to create new partitions, and to change the partition type of existing partitions. While fdisk may not be the easiest partioning tool to use, it is still ubiquitous, and is pretty handy for low-level tasks, e.g., for recreating an exact copy of a manufacturer's hidden MS-Windows recovery partition (type?1c) at a different physical location on your disk.

Finally, having created a new partition, you need to create a filesystem on it (format it, in DOS-speak) in order write and then read files on it. This is done with the mkfs utility, and the many plug-ins which allow it to format all sorts of non-Linux filesystem types as well as the native ext2 and ext3 types.