Computing: Computer Administration

Installing a Linux dual boot with one harddisk (common user files).

In my tutorial Installing a Linux dual boot with one harddisk, I described how to implement a classic dual boot of two Linux operating systems installed on a harddisk with MS-DOS partitions (BIOS boot; the bootloader being located in the MBR). No special configuration has been made concerning the OS visibility: Each of the two Linux systems "sees" the other one and all files of the other OS are accessible (normally, you have to act as super-user to do so). This tutorial differs from the "classic case" by the following:

The two Linux systems used here are Manjaro Linux 21.3.3 (German language version) and ArcoLinux 22.07.03 (French language version). I would say that the way to proceed should be similar for other distributions, even if they are of completely different type (Manjaro and ArcoLinux are both based on Arch Linux). Simplifying things by using the user group name when defining the shares, possibly not works as such with all Linux systems. As far as I know, Linux considers the user and group IDs and not the names, and thus it's not to exclude that for given Linux distributions, you'll have to adapt the group ID on one of the systems.

1. Installing ArcoLinux.

Insert the ArcoLinux DVD (or mount the ISO in your virtualization software) and power-on the computer. The ArcoLinux 22.07.03 DVD isn't a live system, thus, apart from EFI related tasks, all boot options will launch the installation program. I chose the default option: "ArcoLinux install medium (x86_64, UEFI, open source)". The installer is GUI based and starts with letting you choose between Easy Installation and Advanced Installation, or to run the partitioning tool GParted. There is no need to use advanced installation; in fact, it is only useful if you want to decide for each component, what to install and what not.

ArcoLinux and Manjaro dual boot installation: Setup of ArcoLinux using 'Easy Installation'

After the selection of the language, the timezone and the keyboard layout, you get to the Partitions screen, where you'll have to select Manual partitioning (French: "Partitionnement manuel").

ArcoLinux and Manjaro dual boot installation: ArcoLinux - Choosing to perform manual partitioning

The first partitioning action to take is to create a new partition table (French: "Nouvelle table de partitionnement"). As we want to configure an UEFI boot, we have to choose to create a new GPT partition table (MBR is for BIOS boot).

ArcoLinux and Manjaro dual boot installation: ArcoLinux - Choosing to create a new GPT partition table

In the free space (French: "espace libre"), create the following partitions (sizes are those on my VM with a 50 GB harddisk):

SizeFilesystemMount pointFlagsNotes
0.5 GBfat32/boot/efibootThe EFI partition is mandatory for UEFI boot, should be FAT32 formatted and must be at least 300 MB (otherwise partitioning fails)
18.0 GBext4  Partition that will be used to install Manjaro Linux
18.0 GBext4/ ArcoLinux root partition (ArcoLinux will be install here)
11.0 GBext4/share Shared data partition (common user files)
2.5 GBswap  Swap partition used by both Manjaro and ArcoLinux

The screenshot shows the partition layout as it will be after the new partition table has been written to the disk (changes have to be confirmed after setup of the computer name and the user name and password).

ArcoLinux and Manjaro dual boot installation: ArcoLinux - Custom partition layout

Let the installation process continue; when terminated reboot the computer. The screenshot shows the ArcoLinux UEFI boot menu (after this OS has been installed).

ArcoLinux and Manjaro dual boot installation: Boot menu after the installation of ArcoLinux

2. Installing Manjaro.

Before you can install Manjaro, you have to make sure that the computer boots from the DVD drive (and not from the harddisk). This may be done by booting into the UEFI firmware and change the boot order there, setting the DVD drive as first boot device.

Manjaro is a Live DVD and at its startup shows the Welcome window, that contains a link named Start the installer (German: "Installer starten"). Click it to install Manjaro onto the harddisk.

ArcoLinux and Manjaro dual boot installation: Manjaro - Choosing to start the installer

As for ArcoLinux, you are asked to select the language, the timezone and the keyboard layout. Then, on the Partitions screen, select Manual partitioning (German: "Manuelle Partitionierung").

ArcoLinux and Manjaro dual boot installation: Manjaro - Choosing to perform manual partitioning

The following operations are crucial: If you mess up things here, you risk to destroy the ArcoLinux installation or make the system unbootable! The screenshot shows the actual partition layout, with none of the partitions mounted by Manjaro. To define the mountpoints, use the Change (German: "Ändern") button. Changes have to be made for all partitions, except for /dev/sda3 (that contains the ArcoLinux installation).

ArcoLinux and Manjaro dual boot installation: Manjaro - Manually setting the mountpoints of the different partitions

Here the changes that you'll have to make:

PartitionSizeFilesystemMount pointFlagsNotes
/dev/sda10.5 GBkeep actual filesystem /boot/efibootThe EFI partition is mandatory for UEFI boot, thus you have to mount it. On the other hand, it already contains the code to boot ArcoLinux, so do not format it!
/dev/sda218.0 GBformat with ext4/ Manjaro root partition (Manjaro will be installed here)
/dev/sda411.0 GBkeep actual filesystem/share Shared data partition (common user files)
/dev/sda52.5 GBreformat (swap)  Swap partition used by both Manjaro and ArcoLinux

And finally, the partition layout (with the mountpoints for Manjaro) as it will be after the changes have been applied and written to disk.

ArcoLinux and Manjaro dual boot installation: Manjaro - Custom partition layout

The code to boot Manjaro will be added to the EFI partition and ArcoLinux will be added to the GRUB boot menu of Manjaro. Thus when rebooting the system (you should move down the DVD drive in the firmware boot order settings, even though this is not mandatory, because the Manjaro partition will be set first boot device), you get a menu, where (among others), you can select to boot either Manjaro or ArcoLinux.

ArcoLinux and Manjaro dual boot installation: Boot menu with OS selection after installation of both systems

3. System isolation.

By default, Linux operating systems normally mount all harddisk partitions found. This includes partitions, that are not part of the OS, as for example the root partition of another OS, installed in parallel. Such partitions are normally mounted read-only, often only accessible by root. So, if we open Thunar in Manjaro, we'll find two items, listed below Devices (German: "Geräte"): Filesystem (German: "Dateisystem"), that is nothing else than the Manjaro filesystem, and Volume 19 GB (German: "Datenträger 19 GB"), that corresponds to the ArcoLinux root partition. In fact, if we open the volume, we can view files, that are actually part of the ArcoLinux installation (on the screenshot below, you can see the file "version", opened in the Manjaro text editor, and its content "v22.07.03" is well the version of the installed ArcoLinux system.

ArcoLinux and Manjaro dual boot installation: Manjaro - Accessing files on the ArcoLinux root partition

As we said at the beginning of this tutorial, our dual boot should be such, that the two operating systems are isolated, that they can't see one another, i.e. not being able to access the other OS's files. The most proper way to implement this would probably be to install a special third-party boot manager, who completely hides the partition of the OS that isn't running. A simpler way to do is not to mount the other OS's root partition at boot time.

This may be done by editing the system file /etc/fstab. This file can be used to define how disk partitions, various other block devices, or remote file systems should be mounted into the file system. The file has a one line entry for each partition, that is defined in it; for details, about the different parameters, you may want to take a look at the fstab page of the ArchWiki.

The screenshots below show the fstab content on my Manjaro system, before (left) and after (right) I made the modifications. You can see that initially the file contained definitions for the EFI partition, the Manjaro root partition and our custom common data partition, mounted at /share. Something somewhat special in the fstab file is that the partitions are not referenced by /dev/sda{n}, but by their UUID. So, to add an entry for the ArcoLinux root partition, we'll need to know the UUID of /dev/sda3. Not difficult to find out: Return to the screenshot that shows the content of the 19 GB volume and have a look at the address given in either the file explorer or the text editor. Yes, this combination of letters and numbers actually is the UUID of the ArcoLinux root partition. Just to be sure, that you are aware: UUID values are system dependent, and the values on your Linux will be different from those shown here. In other words, be sure to look up the values on your system, rather than copying the values shown here! Also, be sure to back up the original fstab file, before making the changes!. Having the ArcoLinux partition's UUID, we can add a definition to fstab, that states that it should not be automatically mounted. This is done by specifying the noauto option (instead of defaults,noatime).

ArcoLinux and Manjaro dual boot installation: Manjaro - Original fstab definitions
ArcoLinux and Manjaro dual boot installation: Manjaro - Modified fstab definitions

Time to reboot and recheck what is accessible and what not in the Manjaro file explorer. The screenshot shows that the Volume 19 GB, displayed before below Devices (German: "Geräte") is no more there. The volume itself still appears below Computer (German: "Rechner"), but if we have a look at its properties, we got a device of unknown type (German: "Typ: unbekannt") with a size of zero (German: "Grösse: 0 Bytes"). The ArcoLinux root partition is no more available; ArcoLinux is well isolated from Manjaro!

ArcoLinux and Manjaro dual boot installation: Manjaro - ArcoLinux root partition unavailable!

To isolate Manjaro from ArcoLinux, we have to make changes in /etc/fstab on ArcoLinux, similar to those we made on Manjaro. In this case, it's /dev/sda2 that has not to be auto-mounted when ArcoLinux boots up. The screenshots below show the content of fstab before (left) and after (right) I made the changes.

ArcoLinux and Manjaro dual boot installation: ArcoLinux - Original fstab definitions
ArcoLinux and Manjaro dual boot installation: ArcoLinux - Modified fstab definitions

Note: As you can see on the screenshots, the swap partition was originally defined in the fstab of ArcoLinux and I removed this definition. I had to do this, because when starting up, ArcoLinux generates some "resume error" on the hibernation device (actually the swap partition). With swap defined in fstab, this leads to a timeout, that results in a waiting delay of several minutes, before ArcoLinux boots up. No idea, what this is about. When removing the swap definition in fstab, the error still occurs, but there is no more timeout and ArcoLinux boots normally. To note that removing the swap definition from fstab has no effect on the usage of the swap partition. Running the "display memory" command
    free -h
in a terminal will show that there are well 2.5 GB of swap available (on each of the two systems).

4. Common user directories.

Finally ready to set up the major feature of this dual boot: Usage of common user directories on Manjaro and ArcoLinux. The common files should be stored in our common partition /share and access to the files should be transparent to the user, meaning that the user may access their Documents, Pictures, etc subdirectories in their home directory just as they are used to do. There are several ways to implement this. I chose to use bind mountpoints, defined in fstab. No idea, if this is the best solution, but I get exactly what I want and it works fine.

First, let's create the directories on /share. As only root may write to this partition, run Thunar as super-user and create the following directories (I did it on Manjaro, using the English names): Documents, Pictures, Music, Videos, Downloads.

ArcoLinux and Manjaro dual boot installation: Manjaro - Creating directories on the common data partition

These directories are intended to be used by the standard user ("allu" in my case) to store their personal data, so it's obvious that this user must be able to create, edit and delete files located inside of them. The best practice would probably be to give "allu" the ownership of the directories. I chose a different way: giving the standard user group read-write permissions to the directories. This may easily be done in Thunar (still run as super-user): Select the 5 directories and right-click them. From the opening context-menu choose Properties > Permissions (German: "Eigenschaften > Zugriffsrechte"), then change the entries "Group: root - Read only" (German: "Gruppe: root - Nur lesen") (screenshot on the left) to "Group: {user-name} - Read-write" (German: "Gruppe {user-name} - Lesen & schreiben") (screenshot on the right).

ArcoLinux and Manjaro dual boot installation: Manjaro - Original permissons to the common directories
ArcoLinux and Manjaro dual boot installation: Manjaro - Changed permissons to the common directories

Note, that when doing these changes, you will be asked if you want to recursively apply the changes to all files and subdirectories. Mandatory to do so, of course! You can test the new settings by opening one of the directories in Thunar, run as "allu". You should be able to create, edit and delete files as you like.

Supposing that they are empty, we can now delete the original user directories (Dokumente, Bilder, Musik, Videos, and Downloads) in allu's home directory, and configure fstab to mount the directories, created in /share, at /home/{user-name}. This may be done using the special option bind. Have a look at the fstab page of the ArchWiki, if you want to learn more about this feature. The screenshot shows the content of my fstab on Manjaro, after I had added the new mountpoints.

ArcoLinux and Manjaro dual boot installation: Manjaro - User directory mountpoint definitions in /etc/fstab

After rebooting the system, the content of the user home directory is complete again: Dokumente, Bilder, Musik, Videos and Downloads are available in /home/{user-name} just as originally (with German names and special folder icons), together with the directories that we had left there (Schreibtisch = Desktop, Öffentlich = Public, ...), the difference being that the 5 directories, that we had deleted before, are actually located on partition /dev/sda4 (and not on /dev/sda2, as is the rest of the filesystem). As the directories have been defined as mountpoints, they also appear below Devices (German: "Geräte"), as did the ArcoLinux root partition after the initial system setup, and as will any external disk (e.g. a flash drive connected to a USB port).

ArcoLinux and Manjaro dual boot installation: Manjaro - Newly created shared directories mounted below the user's home directory

Operations terminated on Manjaro, we'll have now to make the same configuration steps on ArcoLinux. If we open /share in Thunar and view the properties of the 5 directories there, we can see that permissions are correctly set, the group "allu" having read-write access (French: "Accès lecture & écriture) to them.

ArcoLinux and Manjaro dual boot installation: ArcoLinux - Read-write group permissions to the shared directories

It's obvious, that this configuration only works, if the user name (or at least user group name) is the same on both Manjaro and ArcoLinux. What the logic implies: Sharing your private data should only be done with yourself!

Supposing that they are empty, we can now delete the original user directories (Documents, Images, Musique, Vidéos, and Téléchargements) in allu's home directory, and configure fstab to mount the directories, created in /share, at /home/{user-name}. The screenshot shows the content of my fstab on ArcoLinux, after I had added the new mountpoints.

ArcoLinux and Manjaro dual boot installation: ArcoLinux - User directory mountpoint definitions in /etc/fstab

After rebooting the system, the content of the user home directory is complete again: Documents, Images, Musique, Vidéos, and Téléchargements are available in /home/{user-name} just as originally (with French names and special folder icons), together with the directories that we had left there (Bureau = Desktop, Public, ...), the difference being that the 5 directories, that we had deleted before, are actually located on partition /dev/sda4 (and not on /dev/sda3, as is the rest of the filesystem). As the directories have been defined as mountpoints, they also appear below Devices (French: "Périphériques").

ArcoLinux and Manjaro dual boot installation: ArcoLinux - Newly created shared directories mounted below the user's home directory

The configuration of our dual boot with common user directories is hereby terminated. As is this tutorial. I agree that it is rather long and maybe not to easy to follow by people who haven't at least a minimum of sysadmin knowledge. But, such special setups are not what mainstream computer users need, and the tutorial should primarily been seen from an educational point of view. So, I hope that you enjoyed to learn new stuff. And, if you are a pro and are convinced that all this could be better done, as described here, please, consider that I myself am far away from being a Linux sysadmin and setting up my Manjaro-ArcoLinux dual boot was the first time, that I installed two Linux systems with data sharing limited to the content of the user's home directory. A last thing, that we should do: A quick test, to check if everything effectively works as we want. Opening /home/allu/Documents on ArcoLinux, I created a simple text file, saying that it has been created on ArcoLinux. Then, booting Manjaro and opening /home/allu/Dokumente, I viewed the file in Mousepad. That's what shows the final screenshot...

ArcoLinux and Manjaro dual boot installation: Manjaro - Viewing a text document that had been created on ArcoLinux

If you find this text helpful, please, support me and this website by signing my guestbook.