The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: Grant Taylor via TUHS <tuhs@minnie.tuhs.org>
To: tuhs@minnie.tuhs.org
Subject: Re: [TUHS] /usr separation
Date: Tue, 23 Feb 2021 13:29:11 -0700	[thread overview]
Message-ID: <3d2d7b46-41e8-92d7-3a7b-d0f3006bc761@spamtrap.tnetconsulting.net> (raw)
In-Reply-To: <YDVQMUG6UXzrPrMh@mit.edu>

[-- Attachment #1: Type: text/plain, Size: 4716 bytes --]

On 2/23/21 11:57 AM, Theodore Ts'o wrote:
> There are two reasons why you might want to have an initramfs.
Rather than getting into a tit for tat debate, I'll agree that we have 
both proposed reasons why you /might/ want to use an initramfs.  The 
operative words are "you" and "might".  Each person probably wants 
slightly different things.  It's far from one size fits all.

> The other reason is how you run fsck on the root file system.

The same way that it's been done for years.  Root is mounted read only 
and you run fsck to repair damage.  If it's severe damage, you will 
likely need to boot off of something else.  I've had both situations 
happen multiple times.

The quintessential max mount count / max days since last check have 
happily been fixed while root was mounted read only.

> That won't be needed if hardware is perfect, the kernel is 
> bug-free(tm), and the root file system has journalling support, 
> as all modern file systems tend to have.

I wouldn't bet on that.  I've had to run fsck on journalling file 
systems at boot / mount time multiple times.

> However, if it is needed, there are two ways to do this.  One is the 
> traditional way, which is to mount the root file system read/only, 
> repair the file system, and if any changes were required to the root 
> file system, force a reboot; otherwise, remount the root file system 
> read-write, and proceed.

This is what happened in /most/ of the cases that I've needed to 
interact with fsck of a root file system.

> The other way of doing this is to include the fsck program in the 
> initrams, and run fsck on the root file system before it is mounted. 
> Now you never have to worry about rebooting if any chances were made, 
> since the root file system wasn't mounted and so there is no danger 
> of invalid metadata being cached in memory.

Oh ... I would definitely *NOT* say /never/.  There are ways that a file 
system can get corrupted that will cause fsck to stop and require manual 
intervention.

> That being said, it's certainly possible to skip using an initramfs; 
> it's geenrally not required, and if you're building your own kernel, 
> with the device drivers you need for your hardwaer compiled into 
> the kernel, most distributions will support skipping the initramfs. 
> (Debian certainly does, in any case.)

And if you're building a minimal kernel, removing support for modules 
and what's required for swing-root saves space.  ;-)

> /boot needs to exist due to limitations to the firmware and/or boot 
> loader being used.

Not necessarily.  E.g. one single partition containing /boot and / (root).

> If the boot loader is using the legacy PC Bios interfaces to read the 
> kernel and initial ramdisk/file system, then those files need to be in 
> a low-numbered LBA disk space, due to legacy BIOS/firmware limitations.

So make sure said /boot & / (root) partition stays within that 
limitation.  I don't recall exactly what that is.  I think it's ~8 GB. 
But it's definitely possible to have small installations in that space.

> It could also be a concern if you are using some exotic file system 
> (say, ZFS), and the bootloader doesn't support that file system due 
> to copyright licensing incompatibilities, or the boot loader just not 
> supporting that bleeding-edge file system.  In that case, you might 
> have to keep /boot as an ext4 file system.

That scenario is definitely a possibility.  Though such scenarios are 
not a requirement and tend to be antithetical to minimal installations, 
like the type that would be used in embedded devices and possibly copied 
to ROM as indicated in a different post.

> Other than that, there is no reason why /boot needs to be its own 
> file system, except that most installers will create one just because 
> it's simpler to use the same approach for all cases, even if it's 
> not needed for a particular use case.

As Steve Gibson is famous for saying; The tyranny of the default.

> P.S.  Oh, and if you are using UEFI, you might need to have yet 
> another file system which is a Microsoft FAT file system, typically 
> mounted as /boot/efi, to keep the UEFI firmware happy....

Yes, the file system needs to exist.  But that's part of the firmware, 
not the operating system.  I also question if that FAT file system needs 
to be mounted or not.  --  I don't know how GRUB et al. deal with a 
non-mounted UEFI file system.

But even if it does need to be mounted, you can still get away with two 
partitions; / (root) and /boot/efi.  I suspect UEFI does away with the 
LBA issue you mentioned.



-- 
Grant. . . .
unix || die


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4013 bytes --]

  reply	other threads:[~2021-02-23 20:29 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-20 23:09 [TUHS] Abstractions M Douglas McIlroy
2021-02-21  8:15 ` Otto Moerbeek
2021-02-21 11:08 ` Rich Morin
2021-02-21 22:40 ` Dave Horsfall
2021-02-21 23:01   ` Steve Nickolas
2021-02-23  3:31     ` Andrew Warkentin
2021-02-23 17:29       ` [TUHS] /usr separation (was: Abstractions) Greg A. Woods
2021-02-23 18:28         ` [TUHS] /usr separation Grant Taylor via TUHS
2021-02-23 18:57           ` Theodore Ts'o
2021-02-23 20:29             ` Grant Taylor via TUHS [this message]
2021-02-24 14:14               ` Theodore Ts'o
2021-02-24 17:50                 ` Grant Taylor via TUHS
2021-02-24 18:37                   ` Theodore Ts'o
2021-02-24 18:48                     ` Grant Taylor via TUHS
2021-02-25  3:38                       ` Theodore Ts'o
2021-02-24 20:25                     ` Steve Nickolas
2021-02-24 22:08                       ` Steffen Nurpmeso
2021-02-24  3:12         ` [TUHS] /usr separation (was: Abstractions) Andrew Warkentin
2021-02-22  0:13   ` [TUHS] Abstractions Warren Toomey
2021-02-27  2:47     ` Dave Horsfall
2021-02-23  0:25   ` Wesley Parish
2021-02-23  0:38     ` Steve Nickolas
2021-02-23  2:50       ` Theodore Ts'o
2021-02-23  3:19         ` Warner Losh
2021-02-23  1:47     ` Theodore Ts'o
2021-02-21 22:54 ` Clem Cole

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3d2d7b46-41e8-92d7-3a7b-d0f3006bc761@spamtrap.tnetconsulting.net \
    --to=tuhs@minnie.tuhs.org \
    --cc=gtaylor@tnetconsulting.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).