Although it is theoretically possible to use the entire disk to house your Linux
system, this is almost never done in practice. Instead, full disk block devices
are split up in smaller, more manageable block devices. These are known as
The first partition on the first SCSI disk is
The third partition on Sun systems is set aside as a special "whole disk" slice. This partition must not contain a file system.
Users who are used to the DOS partitioning scheme should note that Sun disklabels do not have "primary" and "extended" partitions. Instead, up to eight partitions are available per drive, with the third of these being reserved.
If you are not interested in drawing up a partitioning scheme, the table below suggests a suitable starting point for most systems.
Note that a separate
| Partition | Filesystem | Size | Mount Point | Description |
|---|---|---|---|---|
The following parts explain how to create the example partition layout described previously, namely:
| Partition | Description |
|---|---|
Change the partition layout as required. Remember to keep the root partition entirely within the first 2 GBytes of the disk for older systems. There is also a 15-partition limit for SCSI and SATA.
Start
# fdisk /dev/sda
You should be greeted with the fdisk prompt:
Command (m for help):
To view the available partitions, type in
Command (m for help): p Disk /dev/sda (Sun disk label): 64 heads, 32 sectors, 8635 cylinders Units = cylinders of 2048 * 512 bytes Device Flag Start End Blocks Id System /dev/sda1 0 488 499712 83 Linux native /dev/sda2 488 976 499712 82 Linux swap /dev/sda3 0 8635 8842240 5 Whole disk /dev/sda4 976 1953 1000448 83 Linux native /dev/sda5 1953 2144 195584 83 Linux native /dev/sda6 2144 8635 6646784 83 Linux native
Note the
Command (m for help): s Building a new sun disklabel. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won't be recoverable. Drive type ? auto configure 0 custom (with hardware detected defaults) a Quantum ProDrive 80S b Quantum ProDrive 105S c CDC Wren IV 94171-344 d IBM DPES-31080 e IBM DORS-32160 f IBM DNES-318350 g SEAGATE ST34371 h SUN0104 i SUN0207 j SUN0327 k SUN0340 l SUN0424 m SUN0535 n SUN0669 o SUN1.0G p SUN1.05 q SUN1.3G r SUN2.1G s IOMEGA Jaz Select type (? for auto, 0 for custom): 0 Heads (1-1024, default 64): Using default value 64 Sectors/track (1-1024, default 32): Using default value 32 Cylinders (1-65535, default 8635): Using default value 8635 Alternate cylinders (0-65535, default 2): Using default value 2 Physical cylinders (0-65535, default 8637): Using default value 8637 Rotation speed (rpm) (1-100000, default 5400): 10000 Interleave factor (1-32, default 1): Using default value 1 Extra sectors per cylinder (0-32, default 0): Using default value 0
You can find the correct values in your disk's documentation. The 'auto configure' option does not usually work.
It's time to delete any existing partitions. To do this, type
Command (m for help): d Partition number (1-4): 1
After deleting all partitions except the Whole disk slice, you should have a partition layout similar to the following:
Command (m for help): p Disk /dev/sda (Sun disk label): 64 heads, 32 sectors, 8635 cylinders Units = cylinders of 2048 * 512 bytes Device Flag Start End Blocks Id System /dev/sda3 0 8635 8842240 5 Whole disk
We're ready to create the root partition. To do this, type
Command (m for help): n Partition number (1-8): 1 First cylinder (0-8635): (press Enter) Last cylinder or +size or +sizeM or +sizeK (0-8635, default 8635): +512M
Now, when you type
Command (m for help): p Disk /dev/sda (Sun disk label): 64 heads, 32 sectors, 8635 cylinders Units = cylinders of 2048 * 512 bytes Device Flag Start End Blocks Id System /dev/sda1 0 488 499712 83 Linux native /dev/sda3 0 8635 8842240 5 Whole disk
Next, let's create the swap partition. To do this, type
Command (m for help): p Disk /dev/sda (Sun disk label): 64 heads, 32 sectors, 8635 cylinders Units = cylinders of 2048 * 512 bytes Device Flag Start End Blocks Id System /dev/sda1 0 488 499712 83 Linux native /dev/sda2 488 976 499712 82 Linux swap /dev/sda3 0 8635 8842240 5 Whole disk
Finally, let's create the /usr, /var and /home partitions. As before,
type
Command (m for help): p Disk /dev/sda (Sun disk label): 64 heads, 32 sectors, 8635 cylinders Units = cylinders of 2048 * 512 bytes Device Flag Start End Blocks Id System /dev/sda1 0 488 499712 83 Linux native /dev/sda2 488 976 499712 82 Linux swap /dev/sda3 0 8635 8842240 5 Whole disk /dev/sda4 976 1953 1000448 83 Linux native /dev/sda5 1953 2144 195584 83 Linux native /dev/sda6 2144 8635 6646784 83 Linux native
To save your partition layout and exit
Command (m for help): w
Now that your partitions are created, you can continue with
Now that your partitions are created, it is time to place a filesystem on them.
If you don't care about what filesystem to choose and are happy with what is
used as default in this handbook, continue with
To create a filesystem on a partition or volume, tools specific to the chosen filesystem are available:
| Filesystem | Creation Command |
|---|---|
For instance, to create the root partition (
# mke2fs /dev/sda1 # mke2fs -j /dev/sda4 # mke2fs -j /dev/sda5 # mke2fs -j /dev/sda6
# mkswap /dev/sda2
To activate the swap partition, use
# swapon /dev/sda2
Create and activate the swap with the commands mentioned above.
Now that your partitions are initialized and are housing a filesystem, it is
time to mount them using the
# mount /dev/sda1 /mnt/gentoo # mkdir /mnt/gentoo/usr # mount /dev/sda4 /mnt/gentoo/usr # mkdir /mnt/gentoo/var # mount /dev/sda5 /mnt/gentoo/var # mkdir /mnt/gentoo/home # mount /dev/sda6 /mnt/gentoo/home
We will also have to mount the proc filesystem (a virtual interface with the
kernel) on
Continue with