User:Zulu Foxtrott/GentooOnARM/EasyInstall/CreatingFilesystems

Default Btrfs filesystem layout
Btrfs is a modern copy-on-write (CoW) filesystem for Linux aimed at implementing advanced features while focusing on fault tolerance, repair, and easy administration. With Btrfs it's possible to use subvolumes to replicate the functionality - organizing and managing data - of what on older systems used to be implemented by an advanced partitioning scheme. Btrfs subvolumes are not block level devices, they are POSIX file namespaces. They can be created at any location in the filesystem and will act like any other directory on the system with the exception that subvolumes can be mounted and unmounted.

Throughout the remainder of the handbook, the following structure for the Btrfs filesystem on will be used as a simple example layout:

TODO remove this section
For instance, to have TODO: what about those nowiki-tags (inherited from upstream handbook)?

To have the main partition in btrfs as used in the example partition structure, the following command would be used:

Alternatively, in case the main partition has been encrypted as outlined in the optional section above, use instead:

Now create the filesystems on the newly created partitions.

Creating Btrfs subvolumes
TODO: text

Alternatively, in case the main partition has been encrypted as outlined in the optional section above, use instead:

TODO: text

Mounting the subvolumes
Now that the partitions are initialized, are housing a filesystem, and subvolumes have been created, don't forget to create the necessary mount directories for every subvolume. Once this is done it is time to mount the subvolumes. Use the command followed by the command line parameter   to indicate that options are going to be passed to the command. The subvolume that is to be mounted can now be specified with the  option. As an example we mount the primary hierarchy root, the subvolume accommodating the rootfs:

Alternatively, in case the main partition has been encrypted as outlined in the optional section above, use instead:

Setting up the swapfile
As another example, in case it hasn't been done yet, create the mount directory for the subvolume that's going to host the swapfile:

Mount the respective subvolume:

Create an empty file that will serve as the swap space:

Adjust the permissions:

Disable copy-on-write (COW) for the swapfile:

As COW is disabled, it's necessary to define the size of the swapfile:

is the command that is used to initialize swapfiles (and swap partitions):

Create the swapfile with the commands mentioned above.

Alternative: no btrfs
TODO

Mounting the boot partition
The boot partition needs to be mounted, too:

Later in the instructions the proc filesystem (a virtual interface with the kernel) as well as other kernel pseudo-filesystems will be mounted. But first we [ [Handbook:/Installation/Stage|install the Gentoo installation files]].

Next
[ [User:Zulu_Foxtrott/GentooOnARM/EasyInstall/Stage|Installing the Gentoo installation files]]