Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] fsck separate /usr fails during boot
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
raindev
n00b
n00b


Joined: 26 Dec 2017
Posts: 11
Location: Europe

PostPosted: Tue Jan 09, 2018 5:59 pm    Post subject: [SOLVED] fsck separate /usr fails during boot Reply with quote

[Moderator note: this thread was originally titled fsck check of /usr on a separate partition fails during boot, but per comment from the original poster, this title was too long to permit a SOLVED marker. I condensed the title to make room, and added the marker at the same time. -Hu]

My system boots successfully except for a failing /usr filesystem check. Even if that doesn't cause any immediate issues, I would like the partition's filesystem check to not be omitted.

I found this forum thread about the issue but it's from 2013 and has not real solution.

All of my partitions are inside of an LVM on LUKS container. I use initrafms built with genkernel.

Here's the error I get during the boot:

Code:

 * Checking local filesystems  ...
/dev/mapper/MacVg-gentoo--root: clean, 2390/65536 files, 30938/262144 blocks
/dev/mapper/MacVg-gentoo--usr is mounted.
e2fsck: Cannot continue, aborting.


/dev/mapper/MacVg-gentoo--var: clean, 22647/65536 files, 59083/262144 blocks
/dev/mapper/MacVg-gentoo--home: clean, 8080/917504 files, 243397/3670016 blocks
/dev/mapper/MacVg-data: clean, 5293/3145728 files, 8945157/12582912 blocks
 * Operational error
 [ !! ]


Full boot log (/var/log/rc.log):

Code:

rc sysinit logging started at Tue Jan  9 11:17:50 2018


   OpenRC 0.34.11 is starting up Gentoo Linux (x86_64)

 * /proc is already mounted
 * Mounting /run ...
 * /run/openrc: creating directory
 * /run/lock: creating directory
 * /run/lock: correcting owner
 * Caching service dependencies ...
 [ ok ]
 * Remounting devtmpfs on /dev ...
 [ ok ]
 * Mounting /dev/mqueue ...
 [ ok ]
 * Mounting /dev/shm ...
 [ ok ]
 * Creating list of required static device nodes for the current kernel ...
 [ ok ]
 * Mounting debug filesystem ...
 [ ok ]
 * Mounting SELinux filesystem ...
 [ ok ]
 * Mounting efivarfs filesystem ...
 [ ok ]
 * Mounting cgroup filesystem ...
 [ ok ]
 * Starting udev ...
 [ ok ]
 * Generating a rule to create a /dev/root symlink ...
 [ ok ]
 * Populating /dev with existing devices through uevents ...
 [ ok ]

rc sysinit logging stopped at Tue Jan  9 11:17:50 2018


rc boot logging started at Tue Jan  9 11:17:50 2018

 * Loading kernel modules ...
insmod /lib/modules/4.14.12-gentoo/net/wireless/wl.ko
 [ ok ]
 * Setting system clock using the hardware clock [UTC] ...
 [ ok ]
 * Checking local filesystems  ...
/dev/mapper/MacVg-gentoo--root: clean, 2390/65536 files, 30938/262144 blocks
/dev/mapper/MacVg-gentoo--usr is mounted.
e2fsck: Cannot continue, aborting.


/dev/mapper/MacVg-gentoo--var: clean, 22647/65536 files, 59083/262144 blocks
/dev/mapper/MacVg-gentoo--home: clean, 8080/917504 files, 243397/3670016 blocks
/dev/mapper/MacVg-data: clean, 5293/3145728 files, 8945157/12582912 blocks
 * Operational error
 [ !! ]
 * Remounting root filesystem read/write ...
 [ ok ]
 * Remounting filesystems ...
 [ ok ]
 * Updating /etc/mtab ...
 * Creating mtab symbolic link
 [ ok ]
 * Activating swap devices ...
 [ ok ]
 * Mounting local filesystems ...
 [ ok ]
 * Mounting misc binary format filesystem ...
 [ ok ]
 * Loading custom binary format handlers ...
 [ ok ]
 * Configuring kernel parameters ...
 [ ok ]
 * Creating user login records ...
 [ ok ]
 * Setting terminal encoding [UTF-8] ...
 [ ok ]
 * Setting console font [ter-132n] ...
 [ ok ]
 * Setting hostname to machine  ...
 [ ok ]
 * Setting keyboard mode [UTF-8] ...
 [ ok ]
 * Loading key mappings [workman] ...
 [ ok ]
 * Bringing up network interface lo ...
 [ ok ]
 * Initializing random number generator ...
 [ ok ]

rc boot logging stopped at Tue Jan  9 11:17:52 2018


rc default logging started at Tue Jan  9 11:17:52 2018

 * Starting dbus ...
 [ ok ]
 * sysklogd -> start: syslogd ...
 [ ok ]
 * sysklogd -> start: klogd ...
 [ ok ]
 * Starting consolekit ...
 [ ok ]
 * Starting cronie ...
 [ ok ]
 * /run/lvm: creating directory
 * Starting lvmetad ...
 [ ok ]
 * Bringing up interface wlp3s0
 *   Caching network module dependencies
need dbus
 *   Starting wpa_supplicant on wlp3s0 ...
 [ ok ]
 *   Starting wpa_cli on wlp3s0 ...
 [ ok ]
 *   Backgrounding ... ...
 * WARNING: net.wlp3s0 has started, but is inactive
 * Setting up sddm ...
 [ ok ]
 * Starting local ...
 [ ok ]

rc default logging stopped at Tue Jan  9 11:17:54 2018


/etc/fstab:

Code:

/dev/MacVg/gentoo-root  /       ext4    defaults                0 1
/dev/MacVg/gentoo-usr   /usr    ext4    defaults                0 2
/dev/MacVg/gentoo-var   /var    ext4    nodev,nosuid            0 2
/dev/MacVg/gentoo-home  /home   ext4    nodev,nosuid            0 2
/dev/MacVg/data         /data   ext4    nodev,nosuid,noexec     0 2
LABEL=EFI               /boot   vfat    noauto,umask=0022       0 2
/dev/MacVg/swap         none    swap    defaults                0 0
tmpfs                   /tmp    tmpfs   nosuid,nodev,size=1G,mode=1777 0 0
tmpfs                   /var/tmp tmpfs  nosuid,nodev,size=8G,mode=1777 0 0


Let me know if I should provide any addition information. Thanks in advance for any help.
Back to top
View user's profile Send private message
raindev
n00b
n00b


Joined: 26 Dec 2017
Posts: 11
Location: Europe

PostPosted: Sun Jan 14, 2018 6:34 pm    Post subject: Solved Reply with quote

With some help from gentoo-user list I've got the issue solved.

Below is a short summary, see more details here.

The problem was that /usr partition is mounted by initramfs (e.g. genkernel) causing fsck run by the init system (OpenRC) to fail. The solution was to check root and /usr filesystems by an initramfs leaving rest of the filesystems to the init. I have switched from genkernel to Dracut for initramfs as it includes fsck. Than I set passno only for root and /usr to 1 in fstab leaving 2 for the rest of the filesystems and set fsck_passno=">1" in /etc/conf.d/fsck. This way OpenRC fsck will not run checks of / and /usr (already performed by Dracut) and will complete successfully.

Can't add [solved] to the title as it's of the maximum length already :?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54237
Location: 56N 3W

PostPosted: Sun Jan 14, 2018 6:43 pm    Post subject: Reply with quote

raindev,

I have /var and /usr mounted and checked by the initrd and listed in /etc/fstab as noauto, so that localmount does not try to mount (and fsck) them again.
The initrd does parse /etc/fstab to locate /var and /usr, just in case I move them.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
raindev
n00b
n00b


Joined: 26 Dec 2017
Posts: 11
Location: Europe

PostPosted: Sun Jan 14, 2018 11:00 pm    Post subject: Reply with quote

NeddySeagoon,

Thanks for your reply.
Indeed mounting / and /usr read-write by initramfs and then skipping them in the init with noauto (assuming OpenRC fsck service is not checking noauto filesystems) should work just as well.
Which initramfs do you use?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54237
Location: 56N 3W

PostPosted: Sun Jan 14, 2018 11:55 pm    Post subject: Reply with quote

raindev,

I hand roll my own.
initramfs_list
init
and feed that to the kernel gen_initramfs.sh which is free with the kernel.

The list of libraries is compiled with the help of lddtree. Busybox is static.

My initramfs is kernel agnostic, so its like firmware and the boot loader.
Install once when the system is new and never change it.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
egberts
Guru
Guru


Joined: 04 Nov 2003
Posts: 357
Location: Dimmed Cathode Ray Tube

PostPosted: Sun Oct 02, 2022 4:59 pm    Post subject: Reply with quote

Oh boy ....

This is still a problem for Gentoo 2022 installer with trying to have that /usr partition as a separate partition (as in https://packages.gentoo.org/useflags/split-usr USE) also in other multiple NON-ROOT partitions.

In my case, I have the following partitions:

Code:
/
  /home
  /tmp
  /usr
  /var
  /var/log
  /var/log/audit
  /var/tmp



Now I am getting a bunch of remount error that is not properly logged into the default syslog setup. I can see those remount failures (in attempt to perform a fsck).

I am questioning whether I even got the proper fsck performed on non-root partitions during bootup.
_________________
Clusters of Fry's Special, AMD 2200, 2 GB DDR, 220 GB (2008.1/desktop, stage 1, -O3) x8
HP Compaq Fry's SPecial, AMD 2100, 2 GB DDR, 260 GB (2008.0/server, stage 1, -O3)
Ultra Sparc 5, 256MB, 3GB (2006.1/server, stage 1, -O3)
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21633

PostPosted: Sun Oct 02, 2022 7:44 pm    Post subject: Reply with quote

USE=split-usr is not related to this thread. USE=split-usr is documented as being about not merging the contents of /bin and /usr/bin into one directory (and likewise for the other directories that occur in both / and /usr). This thread is about using distinct filesystems for / and /usr. Unsetting USE=split-usr is probably a bad idea for systems with a separate /usr filesystem.
Back to top
View user's profile Send private message
hujuice
Guru
Guru


Joined: 16 Oct 2007
Posts: 336
Location: Rome, Italy

PostPosted: Mon Mar 04, 2024 3:58 pm    Post subject: Reply with quote

Hello everybody,
I'm using the solution proposed here (I have separate /usr, both / and /usr are in LVM) and it works.
Thank you for this: https://archives.gentoo.org/gentoo-user/message/0afb1bb1a90bd1898cf42ab66e83d98c

It works because dmesg produces the expected output..

Code:
box ~ # dmesg | grep "/dev/dm-"
[    2.232155] dracut: Checking ext4: /dev/dm-1
[    2.233125] dracut: issuing e2fsck -a /dev/dm-1
[    2.237889] dracut: /dev/dm-1: clean, 15617/262144 files, 406384/1048576 blocks
[    2.258996] dracut: Checking ext4: /dev/dm-0
[    2.259986] dracut: issuing e2fsck -a /dev/dm-0
[    2.273766] dracut: /dev/dm-0: recovering journal
[    2.275816] dracut: /dev/dm-0: clean, 455259/1310720 files, 3448816/5242880 blocks


dm-0 is /dev/mainvg/usr1 and /dev/dm-1 is /dev/mainvg/root1

But tune2fs -l don't report the same.
last boot on Mar 4 2024:
box ~ # tune2fs -l /dev/mainvg/root1 | grep "Last checked"
Last checked:             Sun Feb 18 18:05:29 2024
box ~ # tune2fs -l /dev/mainvg/usr1 | grep "Last checked"
Last checked:             Sat Feb 17 22:23:25 2024


Could anybody explain this?

Thanks,
HUjuice
_________________
Who hasn't a spine, should have a method.
Chi non ha carattere, deve pur avere un metodo.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum