Sample Header Ad - 728x90

Is it still possible to bind mount /usr?

1 vote
2 answers
702 views
I used to bind mount my /usr from another volume, as my root volume is almost full. However, with KUbuntu 22.04.1 LTS, I.e., systemd ver 249.11, I found it impossible now. Here is how I did it before in /etc/fstab:
LABEL=bigvol    /bigvol         auto defaults,noatime,nodiratime,barrier=1,ro  0 2
/bigvol/d-sys/2023-02/usr  /usr auto bind,ro       0 0
I.e., with 0 2, the /bigvol volume is mounted on boot up, and with 0 0, the /usr volume is not mounted until later. It's been working like that for over 10 years, but with systemd ver 249.11+ under linux-image-5.15.0-60, it starts to *bind* mount the /usr volume before any other volumes has been mounted, even when the root volume is temporarily mounted as /root instead of as /. **UPDATE:** So I tried the suggested /bigvol/d-sys/2023-02/usr /usr auto bind,ro,x-systemd.requires-mounts-for=/bigvol 0 0 And it is _not_ working, stopped at the _same_ place when the root volume is temporarily mounted as /root instead of as /. But Freddy's answer looks so convincing that I tried something else -- using the exact same syntact to bind mount something else (comment out this /usr bind mount but added another bind mount directory /var/cache/apt/archives). And, it, works! So it seems that 1. systemd knows that the /usr volume is very special and should be mounted _before_ anything else. 1. but it fails to see that my /usr volume is only a bind mount should be mounted _after_ anything else.
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.1 LTS
Release:        22.04
Codename:       jammy

$ apt-cache policy linux-image-5.15.0-60-generic
linux-image-5.15.0-60-generic:
  Installed: 5.15.0-60.66
  Candidate: 5.15.0-60.66
  Version table:
 *** 5.15.0-60.66 500
        500 http://security.ubuntu.com/ubuntu  jammy-security/main amd64 Packages
        500 http://archive.ubuntu.com/ubuntu  jammy-updates/main amd64 Packages
        100 /var/lib/dpkg/status

$ apt-cache policy systemd
systemd:
  Installed: 249.11-0ubuntu3.6
  Candidate: 249.11-0ubuntu3.6
  Version table:
 *** 249.11-0ubuntu3.6 500
        500 http://archive.ubuntu.com/ubuntu  jammy-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     249.11-0ubuntu3 500
        500 http://archive.ubuntu.com/ubuntu  jammy/main amd64 Packages
Asked by xpt (1858 rep)
Feb 16, 2023, 10:00 PM
Last activity: Apr 12, 2025, 08:57 AM