User:Zulu Foxtrott/GentooOnARM/EasyInstall/PartitioningWithParted

Partition the storage device
To partition storage devices the partitioning utility  can be used, which was one of the first to support GPT partitions on Linux.

In this chapter, the example partition layout mentioned earlier in the instructions will be used to partition the storage device that is going to house the new Gentoo installation:

Change the partition layout according to personal preference.

Viewing the current partition layout with parted
The application offers a simple interface for partitioning storage media like disks and supports very large partitions (more than 2 TB). Fire up against the storage device of choice (in the example, we use ). It is recommended to ask to use optimal partition alignment:

Alignment means that partitions are started on well-known boundaries within the storage device, ensuring that operations on the storage device from the operating system level (retrieve pages from the device) use the least amount of internal device operations. Misaligned partitions might require the device to fetch two pages instead of one even if the operating system asked for a single page.

To find out about all options supported by parted, type and press return.

Setting the GPT label
With, the command to put a GPT label on the storage device is :

Removing all partitions with parted
If this isn't done yet (for instance through the operation earlier, or because the storage device is a freshly formatted one), first remove all existing partitions from the device. Type to view the current partitions, and  where   is the number of the partition to remove.

Do the same for all other partitions that aren't needed. However, make sure to not make any mistakes here - parted executes the changes immediately (unlike the traditional which stages them, allowing a user to "undo" his changes before saving or exiting fdisk).

Creating the partitions
Now will be used to create the partitions with the following settings:


 * The name of a partition
 * The start location of a partition (which can be expressed in MiB, GiB, ...)
 * The end location of the partition (which can be expressed in MiB, GiB, ...)

First, tell parted that the size unit we work with is kibibytes (abbreviated as KiB in the "standard" notation):

Then create a 4096 KiB partition (called "firmware" according to the example partition layout) that can be used for software taking care of initializing the target system's hardware, and inform to start from 32 KiB and end at 4128 KiB (creating a partition of 4096 KiB in size).

TODO: instructions how to deal with alignment warning

Do the same for the bootloader partition (starting at 8192KiB, size 4096KiB).

After these two rather small partitions are created, it is time to create the bigger ones. To make things easier, change the size unit for to work with to mebibytes (abbreviated as MiB).

Now create a 128 MiB partition that will serve as the boot partition. Tell with the  command to start from 16 MiB and end at 144 MiB (creating a partition of 128 MiB in size). Then turn on the flag for the newly created third partition.

TODO: disk model? TODO: 16MiB or 16.0MiB?

Last, create the main partition that spans the remaining space on the storage device (for which the end location is marked as -1, meaning the end of the disk minus one MiB, which is the farthest a partition can go).

The end result looks like so:

TODO: 12/16MiB or 12.0/16.0?

Use the command to exit parted.

With the partitions created, it is now time to put filesystems on them. Optionally, the storage device can be encrypted before.