LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-08-2022, 09:42 AM   #1
adrian_stephens
Member
 
Registered: Apr 2005
Location: Cambridge, UK
Distribution: KDE Neon, Proxmox
Posts: 37
Blog Entries: 2

Rep: Reputation: 1
Arch root on zfs mkinitcpio generates bad mtab if multiple datasets with mountpoint=/


[SOLVED] On my PC, I have multiple different installed operating systems with root on zfs.
These are arranged:
rpool
rpool/root
rpool/root/arch
rpool/root/kubuntu21
rpool/root/ubuntu

The leaves all have mountpoint=/ and canmount=noauto

The unbuntu process for building the initramfs is perfectly happy with this arrangement.

But the Arch process, which includes the zfs hook scripts called by mkinitcpio generates a bad mtab. Specifically, it include a line for each of these different
operating systems.
I expect to see just a line for the arch os - which corresponds to the dataset that is mounted (in my chroot jail) at the time I run mkinitcpio.

Of course, this causes the system not to boot, because it can't find the root.
Specifically, rpool/root (which is empty) ends up mounted at /new_root, and the boot process fails to find the init script and bails.

Can anybody help me? I've spent some time googling and reading the documentation, but nothing like this is mentioned.

Last edited by adrian_stephens; 01-10-2022 at 09:19 AM.
 
Old 01-10-2022, 09:26 AM   #2
adrian_stephens
Member
 
Registered: Apr 2005
Location: Cambridge, UK
Distribution: KDE Neon, Proxmox
Posts: 37

Original Poster
Blog Entries: 2

Rep: Reputation: 1
There are a couple of bugs in the grub-mkconfig and zfs-linux-git packages.

The zfs mkinitcpio documentation is unclear about the meaning of the zfs= kernel parameter.
I took it to mean listing the pools to be mounted. This is wrong, it is the dataset containing
the root. So by quoting zfs=rpool, rather than zfs=rpool/root/arch, this explains why it mounted
the wrong dataset(s).

grub-mkconfig doesn't know about the zfs= parameter, only about root=zfs=. And then it gets it wrong,
missing out the pool name. This is a known bug (https://github.com/zfsonlinux/grub/issues/22).

There is another issue with the zfs init hook, which attempts to mount all pools (zfs import -aN),
and ignores the cachefile that it has copied into the initcpio. Add -c <cachefilename> is necessary
when there are devices attached with pools that should not be imported (e.g. if they have conflicting
mounts). Such conflicts are likely if copying entire pools between physical devices using zfs send & recv.
 
  


Reply

Tags
arch linux, zfs



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting up separate ZFS datasets for binary package servers doskanoness Linux - Server 0 11-12-2021 09:48 PM
[SOLVED] Problem installing Arch system on a ZFS root: "ZFS: Cannot find bootfs." on boot. tajjada Linux - Software 4 12-25-2013 02:07 AM
[SOLVED] Parsing mountpoint from /etc/mtab (parsing "string") in C deadeyes Programming 3 09-06-2011 05:33 PM
cannot mount internal hard drive: .hal-mtab and .hal-mtab-lock messed up extremewaffles Linux - Newbie 3 07-01-2009 05:15 PM
/media/.hal-mtab and /media/.hal-mtab-lock SlowCoder Linux - General 2 05-13-2008 04:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration