1 |
On Monday, 5 August 2019 02:36:31 BST Grant Taylor wrote: |
2 |
> On 8/4/19 7:26 PM, Grant Taylor wrote: |
3 |
> > I am also using a bit of a hack that I think could be (re)used to allow |
4 |
> > /usr being a separate file system without /requiring/ an initramfs / |
5 |
> > initrd. (I'll reply in another email with details to avoid polluting |
6 |
> > this thread.) |
7 |
> |
8 |
> I think that a variation of a technique I'm using for LUKS encrypted |
9 |
> /home on a VPS could be used to allow booting without an initramfs / |
10 |
> initrd while maintaining a separate /usr file system. |
11 |
> |
12 |
> The problem is that /bin & /sbin would be symbolic links to /usr/bin & |
13 |
> /usr/sbin. So, any commands that would be needed to mount the /usr file |
14 |
> system would need to be directly accessible in /bin & /sbin paths, or |
15 |
> indirectly accessible in /usr/bin & /usr/sbin. |
16 |
> |
17 |
> IMHO this is a whopper of a hack. |
18 |
> |
19 |
> Create the bin and sbin directories inside of the /usr directory that is |
20 |
> the mount point so that they are on the underlying file system that /usr |
21 |
> is mounted over top of. Then copy the needed binaries to the /usr/bin & |
22 |
> /usr/sbin directories on the underlying file system. That way, |
23 |
> /sbin/fsck -> /usr/sbin/fsck still exists even before the real /usr is |
24 |
> mounted. |
25 |
> |
26 |
> I did say this is a whopper of a hack. |
27 |
> |
28 |
> It's trivial to access these directories even when the normal / full |
29 |
> /usr is mounted. |
30 |
> |
31 |
> 1) mkdir /mnt/root-underlay |
32 |
> 2) mount -o bind / /mnt/root-underlay |
33 |
> 3) ls /mnt/root-underlay/bin /mnt/root-underlay/sbin |
34 |
> |
35 |
> This "technique" / "trick" / "hack" works because the /bin & /sbin |
36 |
> ""directories are sym-links to the /usr/bin & /usr/sbin directories. |
37 |
> There is nothing that means that the contents of (/usr)/(s)bin can't |
38 |
> change from one command invocation to another. The /(s)bin sym-links |
39 |
> just need to point to a valid directory. They can easily be on the |
40 |
> root-underlay file system that /usr gets mounted on top of. |
41 |
|
42 |
Interesting concept, thanks for sharing. |
43 |
|
44 |
Unless I misunderstand how this will work, it will create duplication of the |
45 |
fs for /bin and /sbin, which will both use extra space and require managing. |
46 |
|
47 |
Will you mount -bind the underlying fs in fstab? |
48 |
|
49 |
How will you make sure installations of the same binaries are installed/copied |
50 |
in both underlying and mounted /usr/* fs and kept in sync? By changing all |
51 |
affected ebuilds? |
52 |
|
53 |
It is a hack alright, to restore the previous default /usr functionality, so a |
54 |
useful option to consider. If I were to be asked my preference would be to |
55 |
revert the systemd inspired changes which caused this loss of functionality. |
56 |
;-) |
57 |
|
58 |
-- |
59 |
Regards, |
60 |
|
61 |
Mick |