Gentoo Archives: gentoo-user

From: Rich Freeman <rich0@g.o>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] eject and util-linux blocker
Date: Wed, 18 Mar 2015 21:55:41
Message-Id: CAGfcS_nkyjAgGbSwkuV2C9QnaOS8xE5wRZnv9pAg-MXgS4ZcOA@mail.gmail.com
In Reply to: Re: [gentoo-user] eject and util-linux blocker by Dale
1 On Wed, Mar 18, 2015 at 2:12 PM, Dale <rdalek1967@×××××.com> wrote:
2 >
3 > I thought there was a tool that just lists the contents. Things is, I'm
4 > not sure what I would be looking at.
5
6 An initramfs is just a root filesystem. init is /sbin/init unless the
7 kernel is told otherwise.
8
9 If you took your entire root filesystem, compressed it into a cpio
10 archive, and put that in grub as your initramfs, then your entire
11 distro would run from a ramdisk and you might not even notice the
12 difference (well, assuming you had enough RAM).
13
14 The only real "magic" with an initramfs is that it mounts your real
15 root somewhere, then swaps it out for the real root:
16 http://manpages.courier-mta.org/htmlman8/switch_root.8.html
17
18 This is a bit like chroot, but the old root filesystem is deleted in
19 the process (so that your initramfs does not consume any RAM once the
20 system actually boots). I'm not sure exactly how dracut does it with
21 systemd, since my understanding is that during shutdown systemd
22 actually pivots back to the initramfs (which allows all filesystems to
23 be cleanly unmounted instead of merely being mounted read-only).
24
25 --
26 Rich