|
|
Subscribe / Log in / New account

A filesystem corruption bug breaks loose

A filesystem corruption bug breaks loose

Posted Dec 11, 2018 19:30 UTC (Tue) by zblaxell (subscriber, #26385)
In reply to: A filesystem corruption bug breaks loose by ken
Parent article: A filesystem corruption bug breaks loose

I copied e2fsck into initramfs years ago. Also dropbear (to diagnose and repair the root filesystem remotely), mkfs and rsync (in case the diagnosis and repair does not end well, and a restore from backups over the network is required).

The old Unix way of running fsck on a live root filesystem so that it will be potentially modifying its own program text (or block maps thereof) was, at best, a workaround for not having a usable initramfs subsystem to run fsck from. That era ended 15 years ago on Linux, and even earlier on Solaris and other commercial Unixes.

I'm surprised Linux distros that boot with initramfs today still try to fsck after / is mounted.


to post comments

A filesystem corruption bug breaks loose

Posted Dec 11, 2018 20:16 UTC (Tue) by lkundrak (subscriber, #43452) [Link] (3 responses)

Uh? A fresh Fedora install:
[root@nedofet lkundrak]# lsinitrd |grep -i fsck
-rwxr-xr-x   1 root     root        28512 Oct 25 09:14 usr/lib/systemd/systemd-fsck
-rw-r--r--   1 root     root          671 Oct 25 09:14 usr/lib/systemd/system/systemd-fsck@.service
-rwxr-xr-x   2 root     root            0 Jul 13 04:35 usr/sbin/e2fsck
-rwxr-xr-x   1 root     root        55952 Jul 16 13:51 usr/sbin/fsck
-rwxr-xr-x   2 root     root       339424 Jul 13 04:35 usr/sbin/fsck.ext4
[root@nedofet lkundrak]#

A filesystem corruption bug breaks loose

Posted Dec 11, 2018 20:18 UTC (Tue) by zblaxell (subscriber, #26385) [Link] (2 responses)

OK, that's one...

A filesystem corruption bug breaks loose

Posted Dec 12, 2018 3:45 UTC (Wed) by nybble41 (subscriber, #55106) [Link] (1 responses)

Debian also includes e2fsck in the initramfs:

[~]$ lsinitramfs /boot/initrd.img-4.18.0-2-amd64 | fgrep fsck
usr/sbin/e2fsck
usr/sbin/fsck
usr/sbin/fsck.ext4
usr/sbin/reiserfsck

A filesystem corruption bug breaks loose

Posted Dec 20, 2018 17:10 UTC (Thu) by BenHutchings (subscriber, #37955) [Link]

Indeed, we've been doing this by default since Debian 8 "jessie". But if you build a custom kernel with no initramfs then of course fsck gets run in the old way.

A filesystem corruption bug breaks loose

Posted Dec 14, 2018 23:41 UTC (Fri) by nix (subscriber, #2304) [Link]

Presumably you also install iproute2, or you'll have trouble bringing the network up to rsync over it (unless it's already up for netconsole or something, I suppose).


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds