Calamares mounts the default subvolume instead of the root subvolume on BTRFS if I choose a BTRFS partition as root partition and choose not to format it. Here is what happens:
I have 2 BTRFS partitions. One of them multiple linux distributions seperated by subvolumes like this, the other is for testing:
/@
/@/.snapshots
/@/.snapshots/1/snapshot (openSUSE root)(default subvolume)
/@/var , /@/srv … (openSUSE contains fstab entries for these and manually mounts them)
/@/arch (Arch Linux root)
/@/mint (Linux Mint root)
/@/fedora (Fedora root)
If my setup looks insane, I admit that it is not normal, yet I am not the only one who does this
While I initially tried to install EndeavourOS, I had renamed /@ to /linux so installer would create its own subvolumes like /@, /@home and not touch the existing subvolumes. Instead, it mounted /linux/.snapshots/1/snapshot (the default subvolume) and tried to create its subvolumes there and installation failed at a later stage.
I tried to reproduce the behavior in the dummy partition with the subvolumes
/linux/.snapshots/1/snapshot (default)
/linux/
/linux/.snapshots
- Installer mounts the dummy partition. There is no -o subvol=/ so default subvolume is mounted.
00:06:49 [6]: static CalamaresUtils::ProcessResult CalamaresUtils::System::runCommand(CalamaresUtils::System::RunLocation, const QStringList&, const QString&, const QString&, std::chrono::seconds)
Running "env" ("mount", "-t", "btrfs", "/dev/sda10", "/tmp/calamares-root-pj5s76nn/")
.. Finished. Exit code: 0
- Installer creates new subvolumes under the default subvolume. So there are subvolumes like
/linux/.snapshots/1/snapshot/@
/linux/.snapshots/1/snapshot/@home …
Create subvolume '/tmp/calamares-root-pj5s76nn/@'
Create subvolume '/tmp/calamares-root-pj5s76nn/@home'
Create subvolume '/tmp/calamares-root-pj5s76nn/@cache'
Create subvolume '/tmp/calamares-root-pj5s76nn/@log'
- Instaler looks for these subvolumes at the root of the partition and fails.
Running "env" ("mount", "-t", "btrfs", "-o", "subvol=/@,", "/dev/sda10", "/tmp/calamares-root-pj5s76nn/")
.. Target cmd: ("mount", "-t", "btrfs", "-o", "subvol=/@,", "/dev/sda10", "/tmp/calamares-root-pj5s76nn/") Exit code: 32 output:
mount: /tmp/calamares-root-pj5s76nn: mount(2) system call failed: No such file or directory.
00:06:50 [6]: static CalamaresUtils::ProcessResult CalamaresUtils::System::runCommand(CalamaresUtils::System::RunLocation, const QStringList&, const QString&, const QString&, std::chrono::seconds)
Running "env" ("udevadm", "settle")
.. Finished. Exit code: 0
00:06:50 [6]: static CalamaresUtils::ProcessResult CalamaresUtils::System::runCommand(CalamaresUtils::System::RunLocation, const QStringList&, const QString&, const QString&, std::chrono::seconds)
Running "env" ("sync")
.. Finished. Exit code: 0
WARNING: [PYTHON JOB]: "Cannot mount /dev/sda10"
00:06:50 [6]: static CalamaresUtils::ProcessResult CalamaresUtils::System::runCommand(CalamaresUtils::System::RunLocation, const QStringList&, const QString&, const QString&, std::chrono::seconds)
Running "env" ("mount", "-t", "btrfs", "-o", "subvol=/@home,", "/dev/sda10", "/tmp/calamares-root-pj5s76nn/home")
.. Target cmd: ("mount", "-t", "btrfs", "-o", "subvol=/@home,", "/dev/sda10", "/tmp/calamares-root-pj5s76nn/home") Exit code: 32 output:
mount: /tmp/calamares-root-pj5s76nn/home: mount(2) system call failed: No such file or directory.
00:06:50 [6]: static CalamaresUtils::ProcessResult CalamaresUtils::System::runCommand(CalamaresUtils::System::RunLocation, const QStringList&, const QString&, const QString&, std::chrono::seconds)
Running "env" ("udevadm", "settle")
.. Finished. Exit code: 0
00:06:50 [6]: static CalamaresUtils::ProcessResult CalamaresUtils::System::runCommand(CalamaresUtils::System::RunLocation, const QStringList&, const QString&, const QString&, std::chrono::seconds)
Running "env" ("sync")
.. Finished. Exit code: 0
WARNING: [PYTHON JOB]: "Cannot mount /dev/sda10"
00:06:50 [6]: static CalamaresUtils::ProcessResult CalamaresUtils::System::runCommand(CalamaresUtils::System::RunLocation, const QStringList&, const QString&, const QString&, std::chrono::seconds)
Running "env" ("mount", "-t", "btrfs", "-o", "subvol=/@cache,", "/dev/sda10", "/tmp/calamares-root-pj5s76nn/var/cache")
.. Target cmd: ("mount", "-t", "btrfs", "-o", "subvol=/@cache,", "/dev/sda10", "/tmp/calamares-root-pj5s76nn/var/cache") Exit code: 32 output:
mount: /tmp/calamares-root-pj5s76nn/var/cache: mount(2) system call failed: No such file or directory.
00:06:50 [6]: static CalamaresUtils::ProcessResult CalamaresUtils::System::runCommand(CalamaresUtils::System::RunLocation, const QStringList&, const QString&, const QString&, std::chrono::seconds)
Running "env" ("udevadm", "settle")
.. Finished. Exit code: 0
00:06:50 [6]: static CalamaresUtils::ProcessResult CalamaresUtils::System::runCommand(CalamaresUtils::System::RunLocation, const QStringList&, const QString&, const QString&, std::chrono::seconds)
Running "env" ("sync")
.. Finished. Exit code: 0
WARNING: [PYTHON JOB]: "Cannot mount /dev/sda10"
00:06:50 [6]: static CalamaresUtils::ProcessResult CalamaresUtils::System::runCommand(CalamaresUtils::System::RunLocation, const QStringList&, const QString&, const QString&, std::chrono::seconds)
Running "env" ("mount", "-t", "btrfs", "-o", "subvol=/@log,", "/dev/sda10", "/tmp/calamares-root-pj5s76nn/var/log")
.. Target cmd: ("mount", "-t", "btrfs", "-o", "subvol=/@log,", "/dev/sda10", "/tmp/calamares-root-pj5s76nn/var/log") Exit code: 32 output:
mount: /tmp/calamares-root-pj5s76nn/var/log: mount(2) system call failed: No such file or directory.
00:06:50 [6]: static CalamaresUtils::ProcessResult CalamaresUtils::System::runCommand(CalamaresUtils::System::RunLocation, const QStringList&, const QString&, const QString&, std::chrono::seconds)
Running "env" ("udevadm", "settle")
.. Finished. Exit code: 0
00:06:50 [6]: static CalamaresUtils::ProcessResult CalamaresUtils::System::runCommand(CalamaresUtils::System::RunLocation, const QStringList&, const QString&, const QString&, std::chrono::seconds)
Running "env" ("sync")
.. Finished. Exit code: 0
WARNING: [PYTHON JOB]: "Cannot mount /dev/sda10"
Then the installer continues and fails with error ERROR: Installation failed: "Failed to unpack image \"/run/archiso/bootmnt/arch/x86_64/airootfs.sfs\"" .. - message: "Failed to unpack image \"/run/archiso/bootmnt/arch/x86_64/airootfs.sfs\"" .. - details: rsync failed with error code 11.
Full log: http://ix.io/3xRf
Solution would be adding -o subvol=/ to the command in (1). Even if I had tried to install the os to a partition with other operating systems, the intended behaviour of the installer is to mount the root subvolume and create other subvolumes there, not at somewhere else so I recommend this change.