You are not logged in.

#1 2023-02-13 00:38:37

undeadalex
Member
Registered: 2022-06-28
Posts: 28

[Solved]Unclear on what modules needed for having ext in kernel

I use btrfs for my system's drives, but have a usb that I use daily that is ext4 and encrypted with luks. If I forget to plug in the usb when I boot the machine, It cannot be decrypted and opened because apparently the modules aren't loaded and don't want load themselves. Its a pretty minor thing but I have just been rebooting with the USB plugged in so everything is loaded and I can use the drive.

I assume I can just add a kernel boot parameter to take care of this? I'm a bit confused which module(s)? are needed? Thanks for any help

I also would like to know why the modules aren't loaded when the drive is plugged in? Is there a way to fix this? To have my system detect its ext4 and load the relevant modules?

My system is encrypted with luks as well btw, if that matters.

Thanks in advance for any help.

Last edited by undeadalex (2023-02-14 00:21:57)


He was once a man, then he was almost killed, a mob hit gone wrong. Now we can rebuild him, we have the tools, we have FOSS, he will be better. He will be Alex, he will live again!

Offline

#2 2023-02-13 01:13:36

loqs
Member
Registered: 2014-03-06
Posts: 18,887

Re: [Solved]Unclear on what modules needed for having ext in kernel

undeadalex wrote:

I use btrfs for my system's drives, but have a usb that I use daily that is ext4 and encrypted with luks. If I forget to plug in the usb when I boot the machine, It cannot be decrypted and opened because apparently the modules aren't loaded and don't want load themselves.

What is the output of

uname -a
pacman -Qs linux

Also please post the commands you use for decryption / mounting that fails and the error messages it produces.

Offline

#3 2023-02-13 04:19:56

undeadalex
Member
Registered: 2022-06-28
Posts: 28

Re: [Solved]Unclear on what modules needed for having ext in kernel

loqs wrote:
undeadalex wrote:

I use btrfs for my system's drives, but have a usb that I use daily that is ext4 and encrypted with luks. If I forget to plug in the usb when I boot the machine, It cannot be decrypted and opened because apparently the modules aren't loaded and don't want load themselves.

What is the output of

uname -a
pacman -Qs linux

Also please post the commands you use for decryption / mounting that fails and the error messages it produces.

Sorry but I was clear this was an issue with kernel modules. I'm running the current kernel and asking about which modules to load at boot and/or how to have them loading when I plug in an ext4 device. I have two separate machines, both with different software installs, but both running arch, and this is an issue on both. It just doesn't detect any ext4 formatted drives at boot and when it loads the kernel skips the modules for it. What I don't get is why there isn't a daemon or something that probes the drive when its plugged in and then mounts the kernel modules for ext4 (Which again I'm not sure which ones that would be. I've thought about doing lsmod with no ext 4 modules, and lsmod after rebooting and having them, and just comparing the two and adding the non listed ones to initramfs? Not sure if this is best path though, as I'd rather figure out how to have my system automatically do this when a usb with that filetype is plugged in.). It also happens regardless of encryption present, as I've tried with  a non encrypted usb device formatted as ext 3 & also as ext4. Its a minor pain, but one I experience regularly as a result.

If you think uname -a and pacman -Qs linux are the most helpful here are those outputs:

uname -a

Linux arch-machine 6.1.11-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 09 Feb 2023 20:06:08 +0000 x86_64 GNU/Linux

pacman -Qs linux

Pastebin output


And regarding mounting/decrypting options, I use the graphical file browser, the gnome one - nautilus, and it will either pretend there is no usb plugged in (lsusb shows it is there though), or it will show it, and clicking to mount it prompts for the GUI password prompt, then kicks back a message that it is unable to mount the filesystem of type: Ext4. Thats it. Anything more complicated like manually decrypting and mounting via cli would be counter productive and not what I'm looking for. Its a desktop level issue and I'd like the solution to be desktop level as well if possible. Hence why I'm wondering if I just need to modify some system setting quickly so it will remember how to mount ext related modules.

Last edited by undeadalex (2023-02-13 04:24:06)


He was once a man, then he was almost killed, a mob hit gone wrong. Now we can rebuild him, we have the tools, we have FOSS, he will be better. He will be Alex, he will live again!

Offline

#4 2023-02-13 04:32:41

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,726

Re: [Solved]Unclear on what modules needed for having ext in kernel

So you're complaining they aren't recognized at boot, but you have to use nautilus to decrypt them? None of that makes sense, nautilus isn't running at boot.

You need to check the commands loqs gave you *when you have the problem*. The most common cause of this is updating the kernel but not rebooting, meaning there are no modules for the kernel to load.

Offline

#5 2023-02-13 04:37:00

undeadalex
Member
Registered: 2022-06-28
Posts: 28

Re: [Solved]Unclear on what modules needed for having ext in kernel

Scimmia wrote:

So you're complaining they aren't recognized at boot, but you have to use nautilus to decrypt them? None of that makes sense, nautilus isn't running at boot.

You need to check the commands loqs gave you *when you have the problem*. The most common cause of this is updating the kernel but not rebooting, meaning there are no modules for the kernel to load.


nautilus isn't a kerne module. It is a graphical overlay for file browsing. It shouldn't be an issue to mount an ext4 usb. I don't see anything in the logs that would indicate an error. When the kernel loads it doesn't load every module it has access to, it loads them, from what I understand, based on user specified conditions, but also autodetects hardware. Coming from Ubuntu where it wasn't an issue, its strange to me that there's nothing in place to load the module when its needed during system operation? Shouldn't it be automatically loaded when the usb is detected?

As clearly specified this is happening after boot, so the system has assuredly been reboot.


He was once a man, then he was almost killed, a mob hit gone wrong. Now we can rebuild him, we have the tools, we have FOSS, he will be better. He will be Alex, he will live again!

Offline

#6 2023-02-13 04:39:26

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,726

Re: [Solved]Unclear on what modules needed for having ext in kernel

Yes, I'm well aware what nautilus is.

Let's try this another way. How EXACTLY are you trying to use these drives at boot?

Offline

#7 2023-02-13 04:41:07

loqs
Member
Registered: 2014-03-06
Posts: 18,887

Re: [Solved]Unclear on what modules needed for having ext in kernel

Please post the full system journal for a boot with the issue.  There is no evidence there is an issue with module loading.
Edit:
To prove the point

# modprobe ext4

Then try accessing the device again.

Last edited by loqs (2023-02-13 04:44:35)

Offline

#8 2023-02-13 04:43:45

undeadalex
Member
Registered: 2022-06-28
Posts: 28

Re: [Solved]Unclear on what modules needed for having ext in kernel

Scimmia wrote:

Yes, I'm well aware what nautilus is.

Let's try this another way. How EXACTLY are you trying to use these drives at boot?

user data storage. I am not looking to have them mounted at boot time.

Again, I think I can just tell the kernel to load the modules i need, I just don't get why I need to do that. Again, my system's filesystem is btrfs, and I suspect thats where the issue is, its not loading the modules for ext3/4 and then during operation the usb drives are not mountable as a result. If you know exactly which modules I need (part of my original post) to load in order to mount an ext drive, I would appreciate that, as reading the wiki I wasn't clearly exactly which modules need to be included for it. Again, I can figure it out through process of elimination if I reboot with and without the external drive in question, but it would be easier to just know which modules are needed.

TL;DR
I am not using the usb drives at boot. I plug them in, transfer files to and from. They contain user data only. Just seeing what options are needed to stop having to reboot to get kernel modules to load.


He was once a man, then he was almost killed, a mob hit gone wrong. Now we can rebuild him, we have the tools, we have FOSS, he will be better. He will be Alex, he will live again!

Offline

#9 2023-02-13 04:48:21

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,726

Re: [Solved]Unclear on what modules needed for having ext in kernel

So your issue is likely what loqs was talking about, you updated the kernel without rebooting. If the modules are there, they will be loaded on-demand. You keep making all kinds of assumptions about how things work instead of just telling us the problem

You'd want the usb-storage and the ext4 modules, in /etc/modules-load.d/. Or reboot after a kernel update.

Offline

#10 2023-02-13 04:48:41

loqs
Member
Registered: 2014-03-06
Posts: 18,887

Re: [Solved]Unclear on what modules needed for having ext in kernel

So the device is not opened / mounted /used at boot time.  However if it is not present during boot then it can not be used which you assuming is caused by a failure to load kernel modules.
This seems more likely to be caused by the system firmware leaving the device or controller in a different state when it is present during boot.

Offline

#11 2023-02-13 04:58:47

undeadalex
Member
Registered: 2022-06-28
Posts: 28

Re: [Solved]Unclear on what modules needed for having ext in kernel

loqs wrote:

So the device is not opened / mounted /used at boot time.  However if it is not present during boot then it can not be used which you assuming is caused by a failure to load kernel modules.
This seems more likely to be caused by the system firmware leaving the device or controller in a different state when it is present during boot.


Yes, thank you, I'm trying to be as clear as possible, glad I'm being understood. Ok your suggsetion an interesting thing I hadn't considered. I manually unmount the drive when I need to remove it each time if that matters. And if I do not reboot the system again, I can remount it without any issues and go about my day. The issue only happens if I reboot the sysem and the ext4 drive isn't present when the kernel loads. I will try to clarify the situation where this occurs, and we can go from there, for recommendations log output, etc.:

Step 1:
Boot system (note system was shutdown) without ext4 drive plugged in.

Step 2:
Plug in ext4 drive after system is loaded (Note no kernel updates have occurred.)

Step 3 - Problem:
System won't/is unable to mount the ext4 drive, attempts to mount result in error messages like "Unable to mount drive of type ext4".

Step 4 (current solution):
Reboot system while keeping ext4 drive plugged in.

Step 5:
Drive is visible in graphical file explorers, can be decrypted and mounted without issue.

I would like it so that I can just mount the drive when I want, such as in nautilus, by clicking on it, as I assume most people like to use usb drives.


loqs wrote:

Please post the full system journal for a boot with the issue.  There is no evidence there is an issue with module loading.
Edit:
To prove the point

# modprobe ext4

Then try accessing the device again.


You made this edit after I had written my response. So I didn't see this. I would have been happy to try it:

with drive mounted:
modprobe etx4

(nothing returned)

(i'll have to reboot my system to do without it mounting, so please wait - will update when done.)
after reboot without ext4 drive:
before running modprobe etx4:
unable to mount drive
after:
successfully mounts!


Which brings me to this, as I clearly asked what I needed to mount it:

loq wrote:

https://bbs.archlinux.org/viewtopic.php?id=57855
Edit:
Good Luck Scimmia,  I tried three times.

undeadalex wrote:

I assume I can just add a kernel boot parameter to take care of this? I'm a bit confused which module(s)? are needed? Thanks for any help

I also would like to know why the modules aren't loaded when the drive is plugged in? Is there a way to fix this? To have my system detect its ext4 and load the relevant modules?

I asked pretty clear what modules would need to be loaded. If we're being passive agressive, I was pretty clear. I'll just put it into boot parameters and see if it works. I hadn't actually known the module was just called ext4. I think I had previously tried finding documentation on that and wasn't clear. I still don't know why I need to add it to a boot param, but if asking for help and trying to be clear isn't working. I can go it alone. Thanks for the alienation!



Update for those actually running into problems and winding up here: Its the mkinitcpio.conf hook autodetect that seemed to be the problem. I hadn't even realized it was in my hooks, and removing it seems to have fixed the problem. I'm not clear on if a kernel module can/should be able to load on its own after boot, but given ext filesystems are meat and potatoes of linux, it was crazy to me this wasn't loaded. Here is the hooks before and after:

before:

MODULES=(btrfs)
BINARIES=(/usr/bin/btrfs)
FILES=()
HOOKS=(base udev [b]autodetect[/b] keyboard keymap modconf block encrypt filesystems fsck)

After:

MODULES=(btrfs)
BINARIES=(/usr/bin/btrfs)
FILES=()
HOOKS=(base udev keyboard keymap modconf block encrypt filesystems fsck) 

I had used the archinstaller script with both machines, and I"m going to guess that the autodetect is added to the .conf when you use this script? Either way, it wasn't a hook I needed to add but rather one I needed to remove. Wiki on the autodetect: https://wiki.archlinux.org/title/mkinitcpio

autodetect
Shrinks your initramfs to a smaller size by creating a whitelist of modules from a scan of sysfs. Be sure to verify included modules are correct and none are missing. This hook must be run before other subsystem hooks in order to take advantage of auto-detection. Any hooks placed before 'autodetect' will be installed in full.

Last edited by undeadalex (2023-02-13 07:37:55)


He was once a man, then he was almost killed, a mob hit gone wrong. Now we can rebuild him, we have the tools, we have FOSS, he will be better. He will be Alex, he will live again!

Offline

#12 2023-02-13 05:01:22

loqs
Member
Registered: 2014-03-06
Posts: 18,887

Re: [Solved]Unclear on what modules needed for having ext in kernel

https://bbs.archlinux.org/viewtopic.php?id=57855
Edit:
Good Luck Scimmia,  I tried three times.

Last edited by loqs (2023-02-13 05:01:58)

Offline

Board footer

Powered by FluxBB