Autor: Didier Kryn Data: Para: dng Assunto: Re: [DNG] Premounting a partition other than /usr
Le 20/09/2024 à 22:56, Ralph Ronnquist via Dng a écrit : > On Fri, Sep 20, 2024 at 08:08:08AM -0700, Marc Shapiro via Dng wrote:
>> Several years ago I was trying to premount a separate partition for
>> /lib/modules. I have multiple releases bootable on the system and I wanted
>> a single place to store the modules, since they can take up a lot of disk
>> space.
>>
>> I tried everything that I could think of, or find online, but nothing
>> worked. I gave up on it, then, all of a sudden, it was premounting! The
>> odd thing is that it is NOT being done the same as /usr (in
>> /usr/share/initramfs-tools/init). In fact, since I had given up on it there
>> is NO entry for it at all in /etc/fstab!
>>
>> It has been this was since Daedalus, maybe since Chimaera, and is still
>> premounting without an /etc/fstab entry in Excalibur (although it is on
>> /usr/lib/modules in Excalibur).
>>
>> Does anyone have any idea how this could be happening? I'm not complaining,
>> since it was what I originally wanted to do, but I would like to know HOW it
>> is happening. Even / has to have an entry in fstab. How can this be mounting
>> without an entry?
> It's not hard to have rootfs /lib/modules mounted by initramfs init
> scripting or (post-pivot) startup scripting; the initramfs
> /lib/modules only needs to include modules to access the rootfs
> drive(s). Though I can't say how it's done on your system.
> Premounting is done during initramfs init. The fstab is not
available at that time.
One way is getting rid of Debian's initramfs and write your own.
This way you premount everything you want where you want. I recommend
doing like Debian for /run and /var/tmp: mount them on tmpfs. I think in
this case you need to get rid of the kernel packages and build your own
kernel, wrapped in some way with your initramfs. Alternatively you may
boot into a dedicated partition instead of initramfs and then
switsh_root to the Debian rootfs. You keep Debian for userspace only. It
just takes a lot of work.