A.5. Debian Partitioning Programs

Several varieties of partitioning programs have been adapted by Debian developers to work on various types of hard disks and computer architectures. Following is a list of the program(s) applicable for your architecture.

partman

Recommended partitioning tool in Debian. This swiss army knife can also create filesystems and assign them to the mountpoints.

cfdisk

A simple-to-use, full-screen disk partitioner for the rest of us; read the cfdisk manual page.

Note that cfdisk doesn't understand FreeBSD partitions at all, and, again, device names may differ as a result.

One of these programs will be run by default when you select Partition a Hard Disk. If the one which is run by default isn't the one you want, quit the partitioner, go to the shell (tty2) by pressing Alt and F2 keys together, and manually type in the name of the program you want to use (and arguments, if any). Then skip the Partition a Hard Disk step in debian-installer and continue to the next step.

If you will be working with more than 20 partitions on your ide disk, you will need to create devices for partitions 21 and beyond. The next step of initializing the partition will fail unless a proper device is present. As an example, here are commands you can use in tty2 or under Execute A Shell to add a device so the 21st partition can be initialized:

cd /dev
mknod hda21 b 3 21 
chgrp disk hda21
chmod 660 hda21

Booting into the new system will fail unless proper devices are present on the target system. After installing the kernel and modules, execute:

cd /target/dev
mknod hda21 b 3 21 
chgrp disk hda21
chmod 660 hda21

A.5.1. Partitioning for IA-64

ia64 EFI firmware supports two partition table (or disk label) formats, GPT and MS-DOS. MS-DOS is the format typically used on i386 PCs, and is no longer recommended for ia64 systems. The installer provides two partitioning programs, cfdisk and parted. parted can manage both GPT and MS-DOS tables, while cfdisk can only manage MS-DOS tables. It is very important to note that if your disk has previously been partitioned with a GPT table, and you now want to use MS-DOS tables, you must use parted to create the new partition table. This is because the two tables use different areas of a disk, and cfdisk does not know how to remove a GPT table.

An important difference between cfdisk and parted is the way they identify a partition ``type''. cfdisk uses a byte in the partition table (for example, 83 for a linux ext2 partition), while parted identifies a partition ``type'' by examining the data on that partition. This means that parted will not consider a partition to be a swap partition until you format it as such. Similarly, it won't consider a partition a linux ext2 partition until you create a file system on it. parted does allow you to create file systems and format swap space, and you should do that from within parted.

Unfortunately, parted is a command line driven program and so not as easy to use as cfdisk. Assuming that you want to erase your whole disk and create a GPT table and some partitions, then something similar to the following command sequence could be used:


      mklabel gpt
      mkpartfs primary fat 0 50
      mkpartfs primary linux-swap 51 1000
      mkpartfs primary ext2 1001 3000
      set 1 boot on
      print
      quit

That creates a new partition table, and three partitions to be used as an EFI boot partition, swap space, and a root file system. Finally it sets the boot flag on the EFI partition. Partitions are specified in Megabytes, with start and end offsets from the beginning of the disk. So, for example, above we created a 1999MB ext2 file system starting at offset 1001MB from the start of the disk. Note that formatting swap space with parted can take a few minutes to complete, as it scans the partition for bad blocks.

A.5.2. Boot Loader Partition Requirements

ELILO, the ia64 boot loader, requires a partition containing a FAT file system. If you used GPT partition tables, then that partition should have the boot flag set; if you used MS-DOS partition tables, then that partition should be of type "EF". The partition must be big enough to hold the boot loader and any kernels or RAMdisks you may wish to boot. A minimum size would be about 16MB, but if you are likely to be doing development, or experimenting with different kernels, then 128MB might be a better size.