You are not logged in.

#1 2011-12-24 15:26:59

starfry
Member
From: Surrey, UK
Registered: 2010-08-18
Posts: 233

How does mkinitcpio detect filesystems? (behaves differently in LXC)

Hi, I hit a problem running a system build script inside an LXC container.

The script runs mkinitcpio which fails to detect relevant filesystems, leading to an initramfs that can not mount ext3.

I can solve this by listing ext3 in the MODULES section of /etc/mkinitcpio.conf but I would really like to understand
what mkinitcpio does to determine the filesystem support to include in the initramfs.

Perhaps my LXC config is missing something or perhaps I've just hit on something that doesn't behave right in LXC.

If anyone can help I'd apprecate some pointers...

Thanks.

Offline

#2 2011-12-24 16:02:25

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: How does mkinitcpio detect filesystems? (behaves differently in LXC)

It sounds like you're not including the filesystem hook, so regardless of inclusion of the autodetect hook, no filesystem modules will ever be added.

mkinitcpio is a bash script. Have at it.

install/autodetect
install/filesystems
functions#auto_modules

Offline

#3 2011-12-24 20:11:01

starfry
Member
From: Surrey, UK
Registered: 2010-08-18
Posts: 233

Re: How does mkinitcpio detect filesystems? (behaves differently in LXC)

What I have worked fine when I ran it on the host system but it doesn't work on the container. It's the same code - the only difference is when inside a container it fails to detect the necessary filesystems. I'll take a look at the mkinitcpio internals but my guess is the filesystem hook and autodetect are there but the auto detection is performing differently when inside a container.

Offline

#4 2011-12-24 22:46:19

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: How does mkinitcpio detect filesystems? (behaves differently in LXC)

Sounds like its a similar situation to when you run mkinitcpio inside a chroot -- its impossible to determine the root device, and therefore you can't determine what the filesystem is. I'll again mention the you can add the filesystems hook to add filesystems instead of explicitly specifying them in MODULES. autodetect will not bone you and leave you without a filesystem module when root FS detection fails.

Offline

#5 2011-12-27 13:42:31

starfry
Member
From: Surrey, UK
Registered: 2010-08-18
Posts: 233

Re: How does mkinitcpio detect filesystems? (behaves differently in LXC)

falconindy wrote:

Sounds like its a similar situation to when you run mkinitcpio inside a chroot -- its impossible to determine the root device, and therefore you can't determine what the filesystem is.

Yes, I think this is what it is (a LXC container is essentially a chroot on steroids) wink
I'm going to do a bit of digging around the mkinitcpio source as you suggest and I may be able to work out how a container should be configured to allow mkinitcpio to see the info that it needs.

falconindy wrote:

I'll again mention the you can add the filesystems hook to add filesystems instead of explicitly specifying them in MODULES. autodetect will not bone you and leave you without a filesystem module when root FS detection fails.

Yes, I just checked that any my mkinitcpio.conf contains what I expect are the default hooks (given I haven't changed them):

HOOKS="base udev autodetect pata scsi sata lvm2 filesystems usbinput"

Offline

Board footer

Powered by FluxBB