Handbook:PPC64/Blocks/Disks/de

Partitions and slices
Although it is theoretically possible to use a full 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. On most systems, these are called partitions. Other architectures use a similar technique, called slices.

Default: Using mac-fdisk
Start mac-fdisk:

First delete the partitions that have been cleared previously to make room for Linux partitions. Use in mac-fdisk to delete those partition(s). It will ask for the partition number to delete.

Second, create an Apple_Bootstrap partition by using. It will ask what block to start from. Enter the number of the first free partition, followed by a. For instance this is 2p.

Now create a swap partition by pressing. Again mac-fdisk will ask what block to start from. As we used 2 before to create the Apple_Bootstrap partition, enter 3p. When asked for the size, enter 512M (or whatever size needed). When asked for a name, enter swap (mandatory).

To create the root partition, enter, followed by 4p to select from what block the root partition should start. When asked for the size, enter 4p again. mac-fdisk will interpret this as "Use all available space". When asked for the name, enter root (mandatory).

To finish up, write the partition to the disk using and  to quit mac-fdisk.

Alternative: Using fdisk
If the system has an ipr-based SCSI adapter, start the ipr utilities now.

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

Change the partition layout according to personal preference.

Viewing current partition layout
fdisk is a popular and powerful tool to split a disk into partitions. Fire up fdisk on the current disk (in our example, we use ):

If there is still an AIX partition layout on the system, then the following error message will be displayed:

Don't worry, we can create a new empty DOS partition table by pressing.

Type to display the disk current partition configuration:

This particular disk is configured to house six Linux filesystems (each with a corresponding partition listed as "Linux") as well as a swap partition (listed as "Linux swap").

Removing all partitions
First remove all existing partitions from the disk. Type to delete a partition. For instance, to delete an existing :

The partition has been scheduled for deletion. It will no longer show up when typing, but it will not be erased until the changes have been saved. If a mistake was made and the session needs to be aborted, then type immediately and hit  and none of the partitions will be deleted or modified.

Now, assuming that indeed all partitions need to be wiped out, repeatedly type to print out a partition listing and then type  and the number of the partition to delete it. Eventually, the partition table will show no more partitions:

Now that the in-memory partition table is empty, let's create the partitions. We will use a default partitioning scheme as discussed previously. Of course, don't follow these instructions to the letter but adjust to personal preference.

Creating the PPC PReP boot partition
First create a small PReP boot partition. Type to create a new partition, then  to select a primary partition, followed by  to select the first primary partition. When prompted for the first cylinder, hit. When prompted for the last cylinder, type +7M to create a partition 7 MB in size. After this, type to set the partition type,  to select the partition just created and then type in 41 to set the partition type to "PPC PReP Boot". Finally, mark the PReP partition as bootable.

Now, when looking at the partition table again (through ), the following partition information should be shown:

Creating the swap partition
Now create the swap partition. To do this, type to create a new partition, then  to tell fdisk to create a primary partition. Then type to create the second primary partition,  in our case. When prompted for the first cylinder, hit. When prompted for the last cylinder, type +512M to create a partition 512MB 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 root partition
Finally, create the root partition. To do this, type to create a new partition, then  to tell fdisk to create a primary partition. Then type to create the third primary partition,  in our case. When prompted for the first cylinder, hit. When prompted for the last cylinder, hit enter to create a partition that takes up the rest of the remaining space on the disk. After completing these steps, typing should display a partition table that looks similar to this:

Saving the partition layout
To save the partition layout and exit fdisk, type.