You are not logged in.

#1 2017-05-30 20:23:33

Linuxplorer
Member
Registered: 2017-05-26
Posts: 11

[Solved] Understanding partitions and mounts

Working with Arch over the last week or so I have been working with partitioning disks for the first time in many years. It's seems most cases have three parts. A boot, a swap and a root. My understanding is that /boot gets a sort of small part as it should not grow after install. Swap is, well swap. Like the Windows pagefile except on it's own partition. Root contains everything else. Am I correct here? Is there any benefit to putting /boot on it's own part? Other than security I guess?

During the install, /mnt is used and it seems to me that is essentially '/' root on the installed system. Correct?
The installed system has a /mnt folder which doesn't seem to fit in with the installation environment.

/mnt/boot can be placed on another partition so it seems to me the directory or folder structure is sort of a virtual object?

Just sitting here thinking about things...

Last edited by Linuxplorer (2017-05-31 19:18:12)

Offline

#2 2017-05-30 20:28:44

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [Solved] Understanding partitions and mounts

Linuxplorer wrote:

Is there any benefit to putting /boot on it's own part?

That allows for EFI_STUB booting and also the systemd-boot bootloader.

EDIT: /boot must be mounted to the EFI system partition for this.

Last edited by Head_on_a_Stick (2017-05-30 20:29:13)


Jin, Jîyan, Azadî

Offline

#3 2017-05-30 20:45:51

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,546
Website

Re: [Solved] Understanding partitions and mounts

I'll take these out of order:

Linuxplorer wrote:

it seems to me the directory or folder structure is sort of a virtual object?

Correct.  Every running *nix system needs a filesystem tree.  The base or "root" of that filesystem tree is / .  There really is no requirement, however, that the root of the filesystem be an entire partition: sometimes it is, sometimes it isn't.  For most regular desktop systems the root filesystem is on a root partition.  However you can chroot which will give you a new apparent filesystem root.  In fact you do this while installing arch:  you mount a partition (say sda1) at /mnt/ then chroot to /mnt, from that point on the root of the active filesystem is on sda1, not on the live medium you booted into.  You can also mount another partition (say sda2) on /mnt/boot before you chroot, so when you do chroot, sda2 will then be at /boot.

Linuxplorer wrote:

During the install, /mnt is used and it seems to me that is essentially '/' root on the installed system. Correct?

Correct.  As noted above, you mount partitions (sda1 and sda2 in the example above) to /mnt and/mnt/boot, and you install to /mnt.  When you reboot and use sda1 as the root filesystem, everything you put under /mnt/ is now just under /

Linuxplorer wrote:

It's seems most cases have three parts. A boot, a swap and a root... Root contains everything else. Am I correct here?

Those three are common.  But swap is generally not necessary (and becoming less common).  I don't use swap at all on any of my systems.  Some people use a swap file rather than a swap partition.  I know that previously a swap partition was necessary for hibernation - I'm not sure if this is still true (i.e., a swap file *may* be sufficient now, I'm not sure).  You will also frequently see /home/ as a separate partition.  This is useful for keeping user data and system files seperate and can make recovery from significant problems much easier (you can resintall your entire base system without worrying about touching your documents, media, and so forth).

Linuxplorer wrote:

Is there any benefit to putting /boot on it's own part? Other than security I guess?

If you are EFI booting you need a seperate EFI partition which should (generally) be your boot partition.  With BIOS booting with some bootloaders you can have the /boot directory on the root partition.  I don't know that there are any security implications though.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#4 2017-05-30 20:47:39

Xyne
Forum Fellow
Registered: 2008-08-03
Posts: 6,965
Website

Re: [Solved] Understanding partitions and mounts

Linuxplorer wrote:

Working with Arch over the last week or so I have been working with partitioning disks for the first time in many years. It's seems most cases have three parts. A boot, a swap and a root. My understanding is that /boot gets a sort of small part as it should not grow after install. Swap is, well swap. Like the Windows pagefile except on it's own partition. Root contains everything else. Am I correct here? Is there any benefit to putting /boot on it's own part? Other than security I guess?

During the install, /mnt is used and it seems to me that is essentially '/' root on the installed system. Correct?
The installed system has a /mnt folder which doesn't seem to fit in with the installation environment.

/mnt/boot can be placed on another partition so it seems to me the directory or folder structure is sort of a virtual object?

Some bootloaders lack support for "newer" filesystems so a separate partition is a way to limit this restriction. The same goes for encryption. Quite often you need to have an unencrypted boot partition even for an otherwise fully encrypted system, depending on your particular setup.

Separate partitions do not provide any immediate security (in the absence of encryption anyway, but even then the relative security benefit will depend on your setup). The only immediate security benefit is to have /var on a separate partition. Some attacks (or just misbehaving programs) can cause log files to grow and eat up all the free disk space. These are located on /var, so a separate partition prevent them from using up all the free disk space in root and elsewhere.

Any partition can be mounted to any path on the system. /mnt is just a convention. When pacstrapping the system, you mount the target system's root on /mnt, the target system's /boot on /mnt/boot, etc.

In Linux, each device (partition, logical volume, anything else with a file system) exists independently of any mointpoint. You mount devices to make them accessible via a path on the system. /mnt/boot could be the mountpoint of a physical partition, an LVM logical volume, an external USB disk (which is interesting for more secure systems), a file on your phone, etc. Basically, when you mount something, any queries to paths beyond the mount point are resolved to something within the exposed filesystem of the mounted device. This could even be virtual, such as with a FUSE filesystem, that handles each request programmatically and maps it to whatever the program is designed to do.

Linuxplorer wrote:

Just sitting here thinking about things...

The forum isn't the right place for such musings. Such general questions can be answered through online searches, and in much more detail. The forum is meant more for help with specific technical questions when a user gets stuck after such searches.


My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone

Offline

Board footer

Powered by FluxBB