Bug 980251 - initramfs depends on UUID of root
initramfs depends on UUID of root
Product: Fedora
Classification: Fedora
Component: dracut (Show other bugs)
Unspecified Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: dracut-maint
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2013-07-01 17:04 EDT by John Reiser
Modified: 2013-08-20 08:56 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-08-20 08:56:48 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description John Reiser 2013-07-01 17:04:33 EDT
Description of problem: The initramfs depends on the UUID of the root filesystem, but the name of the initramfs does not show this dependency.  This makes it hard to clone installations, to have only one  merged /boot directory for several root filesystems (which might share the same kernel version, etc.), and to perform other boot manipulations that may be  necessary or appropriate in constrained circumstances.

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

How reproducible: every time

Steps to Reproduce:
1.mkdir /tmp/foo; cd /tmp/foo
2.gzip -d </boot/initramfs-XXX.img  |  cpio --extract
3.grep -sr <<UUID-of-root>> .

Actual results:
./usr/lib/dracut/hooks/initqueue/finished/devexists-\x2fdev\x2fdisk\x2fby-uuid\x2fabad1f09-d503-402a-b87b-9d84a9ae65e1.sh:[ -e "/dev/disk/by-uuid/abad1f09-d503-402a-b87b-9d84a9ae65e1" ]
./usr/lib/dracut/hooks/emergency/80-\x2fdev\x2fdisk\x2fby-uuid\x2fabad1f09-d503-402a-b87b-9d84a9ae65e1.sh:[ -e "/dev/disk/by-uuid/abad1f09-d503-402a-b87b-9d84a9ae65e1" ] || warn ""/dev/disk/by-uuid/abad1f09-d503-402a-b87b-9d84a9ae65e1" does not exist"

Expected results:  Dependency on UUID of root filesystem is determined at runtime  by reading the kernel command line.  At the least, if initramfs depends on literal UUID of the root filesystem, then that dependency is visible in the name of the initramfs.

Additional info:  If the actual UUID of the root does not agree with the UUID that is baked into the initramfs, then a boot using that initramfs fails and drops to a dracut emergency shell.
Comment 1 Kay Sievers 2013-07-01 17:44:27 EDT
What happens if you don't create a host-only initrd, which is the default?

See: man dracut ...
Comment 2 John Reiser 2013-07-01 18:35:47 EDT
Changing /usr/lib/dracut/dracut.d/01-dist.conf to have
and re-running "dracut --force" (as root) generates an initramfs which does not depend on UUID of root.  Good!  [On my system the size increases from 7.5MB to 22.6MB.]

However, the updated /var/log/dracut.log contains no record of the value of 'hostonly'.  Bad!  The log should note the values of all controlling parameters and the source of each individual override, not just the shell command line.  For instance, hostonly was not specified on the command line, and in /etc/dracut.conf appears
This is confusing because the actual value is taken from /usr/lib/dracut/dracut.d/01-dist.conf which had
before I changed it.
Comment 3 Kay Sievers 2013-07-01 18:44:46 EDT
Things in /usr/lib/ should not be edited, they are replaced with every update.

You can install:
for a packaged config, changing the default.
Comment 4 Harald Hoyer 2013-08-20 08:56:48 EDT
dracut-032 supports:

$ man dracut:

       --persistent-policy <policy>
           Use <policy> to address disks and partitions.  <policy> can be any
           directory name found in /dev/disk. E.g. "by-uuid", "by-label"

$ man dracut.conf

           Use <policy> to address disks and partitions.  <policy> can be any
           directory name found in /dev/disk. E.g. "by-uuid", "by-label"

Note You need to log in before you can comment on or make changes to this bug.