Handbook:SPARC/Blocks/Disks

Partitions
Although it is theoretically possible to use the entire disk to house a 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 partitions or slices.

The first partition on the first SCSI disk is, the second and so on.

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.

Default partition scheme
The table below suggests a suitable starting point for most systems. Note that this is only an example, so feel free to use different partitioning schemes.

Using fdisk to partition the disk
The following parts explain how to create the example partition layout described previously, namely:

Change the partition layout as required. Remember to keep the root partition entirely within the first 2 GB of the disk for older systems. There is also a 15-partition limit for SCSI and SATA.

Firing up fdisk
Start fdisk with the disk as argument:

To view the available partitions, type in :

Note the Sun disk label in the output. If this is missing, the disk is using the DOS-partitioning, not the Sun partitioning. In this case, use to ensure that the disk has a Sun partition table:

The right values can be found in the documentation of the hard disk itself. The 'auto configure' option does not usually work.

Deleting existing partitions
It's time to delete any existing partitions. To do this, type and hit. Give the partition number to delete. To delete a pre-existing, type:

Do not delete partition 3 (whole disk). This is required. If this partition does not exist, follow the "Creating a Sun Disklabel" instructions above.

After deleting all partitions except the Whole disk slice,a partition layout similar to the following should show up:

Creating the root partition
Next create the root partition. To do this, type to create a new partition, then type  to create the partition. When prompted for the first cylinder, hit. When prompted for the last cylinder, type +512M to create a partition 512 MB in size. Make sure that the entire root partition fits within the first 2 GB of the disk. The output of these steps is as follows:

When listing the partitions (through ), the following partition printout is shown:

Creating a swap partition
Next, let's create the swap partition. To do this, type to create a new partition, then  to create the second partition,  in our case. When prompted for the first cylinder, hit. When prompted for the last cylinder, type +512M to create a partition 512 MB in size. After this, type to set the partition type,  to select the partition just created and then type in 82 to set the partition type to "Linux Swap". After completing these steps, typing should display a partition table that looks similar to this:

Creating the usr, var and home partitions
Finally, let's create the, and  partitions. As before, type to create a new partition, then type  to create the third partition (we do not count the whole disk as being a partition),  in our case. When prompted for the first cylinder, hit. When prompted for the last cylinder, enter +2048M to create a partition 2 GB in size. Repeat this process for and, using the desired sizes. When finished, the partition table will look similar to the following:

Save and exit
Save the partition layout and exit fdisk by typing :