You are not logged in.

#26 2021-11-14 23:33:02

loqs
Member
Registered: 2014-03-06
Posts: 18,992

Re: Bind Mounting /usr From Another Filesystem

It does not document what changes you made between the system being bootable and the system failing to boot.

Offline

#27 2021-11-15 00:33:01

BeastlyDoglick
Member
Registered: 2021-11-09
Posts: 18

Re: Bind Mounting /usr From Another Filesystem

Oh, dear. Right, I get you now.

There's nothing to document; it's never been bootable — this is a completely fresh install from the Arch iso on a blank hdd.

It's been partitioned.

The default /boot to /var directories have been created on the systemroot.

The Domain_000 directory structure has been created.


I mounted

the systemroot on /mnt
the boot partition to /mnt/boot
the Domain_000 partition on /mnt/srv/org_000/domain_000

Then ...
did the bind mounts
ran genfstab to create /mnt/etc/fstab
pacstrapped the system
arch-chrooted into /mnt
did the necessary tweaks to complete the config as per the install guide
installed and configured GRUB
rebooted

I then remembered about the usr flag in mkinitcpio.conf and tried that.

Then, when that didn't work, I started investigating and (finally) found the one post by someone who did it with Debian and systemd.

I couldn't complete it, however, because the last bit about adding the extras into one of the Debian scripts defeated me (because I don't know systemd well enough).

So, I came here in the hope someone could point me in the right direction vis-a-vis Arch specifically.


I haven't made changes to a bootable system that prevented it from booting afterwards, it's a clean slate — it has never booted and (with your help) this is as close as it's got to booting so far.

Sorry, that wasn't clear sad.

Last edited by BeastlyDoglick (2021-11-15 00:39:07)

Offline

#28 2021-11-16 12:57:33

BeastlyDoglick
Member
Registered: 2021-11-09
Posts: 18

Re: Bind Mounting /usr From Another Filesystem

N.B. in the following, the files are physically located in their target bind directories, not the systemroot subdirectories (which are just empty mountpoints for the target directories) — so, /etc/mkinitcpio.conf is actually /srv/org_000/domain_000/data_local/device_0000/it/profiles/systems/local/hosts/host_00000/etc/mkinitcpio.conf and just appears to the system at /etc/mkinitcpio.conf


Anyway, after booting the Arch iso, mounting everything as necessary, arch-chrooting into it and

1. disabling all the mount units
2. remarking out the bind mounts in /etc/fstab — so, an effective fstab of

# /dev/sda3 LABEL=Org_000
UUID=52c5acf5-5101-45cc-9097-8043584493f3    /    ext4     rw,relatime    0 1

# /dev/sda4 LABEL=Boot
UUID=e2dd56d1-fc2c-4e2e-a293-f62a2cd3364d    /boot    ext2     rw,relatime    0 2

# /dev/sda2 LABEL=Domain_000
UUID=782c7e72-b0f5-4e30-aa8e-280dfa1c117e    /srv/org_000/domain_000    ext4     rw,relatime    0 2

# /dev/sda1
UUID=3b2d1080-fa07-4b53-be2b-572190b4cecf    none    swap   defaults    0 0

3 ensuring there was no /usr/bin/fsck.none binary
4. issuing the mkinitcpio -P command

/etc/mkinitcpio.conf

MODULES=()
BINARIES=()
FILES=()
HOOKS=(systemd base udev autodetect modconf block filesystems keyboard fsck)

... the initramfs built just fine, with no unexpected errors

But, as expected, when booting from it, it bailed out because there was no /sbin for it to find — the usr directory being empty, the /sbin symlink was broken.


After rebooting the Arch iso, mounting everything as necessary, arch-chroot[ing and

1. enabling all the mount units — /etc/systemd/system/initrd-root-device.target.wants contained symlinks for /etc/systemd/system/[...]

boot.mount

[Unit]
Description=Main Boot Mount
DefaultDependenices=no
Conflicts=umount.target
Before=local-fs.target umount.target
After=swap.target
 
[Mount]
What=/dev/disk/by-uuid/83b5cefa-9819-4d1e-9e53-66da51f7f458
Where=/boot
Type=ext2
Options=defaults,errors=remount-ro
 
[Install]
WantedBy=initrd-root-device.target

etc.mount

[Unit]
Description=Org_000.Domain_000.Host_00000 Etc Mount
DefaultDependenices=no
Conflicts=umount.target
Before=local-fs.target umount.target
RequiresMountsFor=/srv/org_000/domain_000
 
[Mount]
What=/srv/org_000/domain_000/data_local/device_0000/it/profiles/systems/local/hosts/host_00000/etc
Where=/etc
Type=none
Options=bind,x-systemd.requires-mounts-for=/srv/org_000/domain_000
 
[Install]
WantedBy=initrd-root-device.target

home.mount

[Unit]
Description=Org_000.Domain_000.Host_00000 Home Mount
DefaultDependenices=no
Conflicts=umount.target
Before=local-fs.target umount.target
RequiresMountsFor=/srv/org_000/domain_000
 
[Mount]
What=/srv/org_000/domain_000/data_local/device_0000/it/profiles/systems/local/hosts/host_00000/home
Where=/home
Type=none
Options=bind,x-systemd.requires-mounts-for=/srv/org_000/domain_000
 
[Install]
WantedBy=initrd-root-device.target

opt.mount

[Unit]
Description=Org_000.Domain_000.host_00000 Opt Mount
DefaultDependenices=no
Conflicts=umount.target
Before=local-fs.target umount.target
RequiresMountsFor=/srv/org_000/domain_000
 
[Mount]
What=/srv/org_000/domain_000/data_local/device_0000/it/profiles/systems/local/hosts/host_00000/opt
Where=/opt
Type=none
Options=bind,x-systemd.requires-mounts-for=/srv/org_000/domain_000
 
[Install]
WantedBy=initrd-root-device.target

root.mount

[Unit]
Description=Org_000.Domain_000 Root Mount
DefaultDependenices=no
Conflicts=umount.target
Before=local-fs.target umount.target
RequiresMountsFor=/srv/org_000/domain_000
 
[Mount]
What=/srv/org_000/domain_000/data_local/device_0000/it/profiles/systems/local/hosts/host_00000/root
Where=/root
Type=none
Options=bind,x-systemd.requires-mounts-for=/srv/org_000/domain_000
 
[Install]
WantedBy=initrd-root-device.target

srv-org_000-domain_000.mount

[Unit]
Description=Main Domain_000 Mount
DefaultDependencies=no
Conflicts=umount.target
Before=local-fs.target umount.target
After=swap.target
 
[Mount]
What=/dev/disk/by-uuid/cafda08e-85b5-426f-915a-a82844d3bf88
Where=/srv/org_000/domain_000
Type=ext4
Options=defaults,errors=remount-ro
 
[Install]
WantedBy=initrd-root-device.target

usr.mount

[Unit]
Description=Org_000.Domain_000.Host_00000 Usr Mount
DefaultDependenices=no
Conflicts=umount.target
Before=local-fs.target umount.target
RequiresMountsFor=/srv/org_000/domain_000
 
[Mount]
What=/srv/org_000/domain_000/data_local/device_0000/it/profiles/systems/local/hosts/host_00000/usr
Where=/usr
Type=none
Options=bind,x-systemd.requires-mounts-for=/srv/org_000/domain_000
 
[Install]
WantedBy=initrd-root-device.target

var.mount

[Unit]
Description=Org_000.Domain_000.Host_00000 Var Mount
DefaultDependenices=no
Conflicts=umount.target
Before=local-fs.target umount.target
RequiresMountsFor=/srv/org_000/domain_000
 
[Mount]
What=/srv/org_000/domain_000/data_local/device_0000/it/profiles/systems/local/hosts/host_00000/var
Where=/var
Type=none
Options=bind,x-systemd.requires-mounts-for=/srv/org_000/domain_000
 
[Install]
WantedBy=initrd-root-device.target

2. editing /etc/fstab to prevent it interfering with the systemd mounts — so, an effective fstab of

# <file system> <dir> <type> <options> <dump> <pass>
# /dev/sda3 LABEL=Org_000
UUID=52c5acf5-5101-45cc-9097-8043584493f3	/         	ext4      	rw,relatime	0 1

# /dev/sda1
UUID=3b2d1080-fa07-4b53-be2b-572190b4cecf	none      	swap      	defaults  	0 0

.... the initramfs built with no problem, but bailed out again, because it couldn't find /sbin/init

Offline

Board footer

Powered by FluxBB