Bug 1967958

Summary: dracut: Add support for virtiofs as root filesystem
Product: Red Hat Enterprise Linux 9 Reporter: Vivek Goyal <vgoyal>
Component: dracutAssignee: Pavel Valena <pvalena>
Status: CLOSED ERRATA QA Contact: qe-baseos-daemons
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.0CC: dgilbert, dracut-maint-list, dtardon, gmaglione, jieli, mszeredi, pvalena, ruyang, slopezpa, stefanha, xiagao
Target Milestone: betaKeywords: FutureFeature, TestOnly, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: dracut-057-13.git20220816.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-17 14:20:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2066816, 2085347    
Bug Blocks: 2054152    

Description Vivek Goyal 2021-06-04 14:25:20 UTC
Description of problem:

dracut currently can't deal with mounting virtiofs as root filesystem. Add support for virtiofs in dracut. People are trying to use virtiofs as rootfs
and complaining.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 David Tardon 2021-06-08 11:21:29 UTC
I assume you have the set up to test this easily, so: does it work if you add qemu module into initrd? If not, does it work if you add qemu module and virtiofs driver?

Comment 2 Vivek Goyal 2021-06-08 15:52:21 UTC
(In reply to David Tardon from comment #1)
> I assume you have the set up to test this easily, so: does it work if you
> add qemu module into initrd? If not, does it work if you add qemu module and
> virtiofs driver?

I don't have a working setup yet. Frankly speaking, my initrd will not mount it and drop me to emergency shell. There I will mount it manually "mount -t virtiofs myfs /sysroot" and then continue booting.

I think one problem is that how rootfs device should be specified for virtiofs filessytem. There does not seem to be a good way and different kind of hacks are being used. I have proposed one patch upstream
just now.

https://lore.kernel.org/linux-fsdevel/20210608153524.GB504497@redhat.com/

If this gets accepted then we can specify "root=fstag:myfs rootfstype=virtiofs" on kernel command line. I am assuming that some dracut module can parse this and mount virtiofs. Not sure if we will need a separate
virtiofs module for this or some existing module can take care this.

I have not played with "qemu" module. Can give it a try. What is it supposed to do? I mean what kind of filesystems it can mount.

Comment 3 Vivek Goyal 2021-06-08 20:16:31 UTC
I see that we have a module 95virtfs/ which seems to have support for 9p/virtfs. I think we will need something similar for virtiofs.

What I am not sure is that does dracut relies on same syntax for "root=" option for kernel and dracut. Or dracut has moved on and has its own
way to parse root= option irrespective of kernel.

If dracut parses "root=virtiofs:myfs", then problem becomes little easier. Or may be we can modify it to parse "root=fstag:myfs rootfstype=virtiofs" combo so that it is inline with kernel parsing. Assuming kernel,
will accept my proposal.

Comment 4 David Tardon 2022-04-19 10:05:10 UTC
*** Bug 2076212 has been marked as a duplicate of this bug. ***

Comment 5 German Maglione 2022-04-20 16:38:25 UTC
I have sent a PR to add virtiofs as a dracut module.
https://github.com/dracutdevs/dracut/pull/1784

Comment 10 Pavel Valena 2022-07-13 21:52:16 UTC
Hello, please test, if you can, whether the planned rebase for 9.1 works for you.

RPMS: https://github.com/pvalena/rpms/tree/main/dracut/2066816