public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] HACK: Boot without an initramfs / initrd while maintaining a separate /usr file system.
@ 2019-08-05  1:36 Grant Taylor
  2019-08-05 11:45 ` Mick
  2019-08-05 23:52 ` [gentoo-user] " Ian Zimmerman
  0 siblings, 2 replies; 11+ messages in thread
From: Grant Taylor @ 2019-08-05  1:36 UTC (permalink / raw
  To: Gentoo-Users

On 8/4/19 7:26 PM, Grant Taylor wrote:
> I am also using a bit of a hack that I think could be (re)used to allow 
> /usr being a separate file system without /requiring/ an initramfs / 
> initrd.  (I'll reply in another email with details to avoid polluting 
> this thread.)

I think that a variation of a technique I'm using for LUKS encrypted 
/home on a VPS could be used to allow booting without an initramfs / 
initrd while maintaining a separate /usr file system.

The problem is that /bin & /sbin would be symbolic links to /usr/bin & 
/usr/sbin.  So, any commands that would be needed to mount the /usr file 
system would need to be directly accessible in /bin & /sbin paths, or 
indirectly accessible in /usr/bin & /usr/sbin.

IMHO this is a whopper of a hack.

Create the bin and sbin directories inside of the /usr directory that is 
the mount point so that they are on the underlying file system that /usr 
is mounted over top of.  Then copy the needed binaries to the /usr/bin & 
/usr/sbin directories on the underlying file system.  That way, 
/sbin/fsck -> /usr/sbin/fsck still exists even before the real /usr is 
mounted.

I did say this is a whopper of a hack.

It's trivial to access these directories even when the normal / full 
/usr is mounted.

1)  mkdir /mnt/root-underlay
2)  mount -o bind / /mnt/root-underlay
3)  ls /mnt/root-underlay/bin /mnt/root-underlay/sbin

This "technique" / "trick" / "hack" works because the /bin & /sbin 
""directories are sym-links to the /usr/bin & /usr/sbin directories. 
There is nothing that means that the contents of (/usr)/(s)bin can't 
change from one command invocation to another.  The /(s)bin sym-links 
just need to point to a valid directory.  They can easily be on the 
root-underlay file system that /usr gets mounted on top of.



-- 
Grant. . . .
unix || die


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-08-06  8:18 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-05  1:36 [gentoo-user] HACK: Boot without an initramfs / initrd while maintaining a separate /usr file system Grant Taylor
2019-08-05 11:45 ` Mick
2019-08-05 16:30   ` Grant Taylor
2019-08-06  8:13     ` Neil Bothwick
2019-08-05 23:52 ` [gentoo-user] " Ian Zimmerman
2019-08-05 23:59   ` Manuel McLure
2019-08-06  0:04   ` Grant Taylor
2019-08-06  8:18     ` Neil Bothwick
2019-08-06  0:28   ` Jack
2019-08-06  2:45     ` Grant Taylor
2019-08-06  2:46       ` Grant Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox