Bug 980251 - initramfs depends on UUID of root
Summary: initramfs depends on UUID of root
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: dracut
Version: 19
Hardware: Unspecified
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: dracut-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-01 21:04 UTC by John Reiser
Modified: 2013-08-20 12:56 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-08-20 12:56:48 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description John Reiser 2013-07-01 21:04:33 UTC
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):
dracut-029-1.fc19.i686
grubby-8.26-2.fc19.i686


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 21:44:27 UTC
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 22:35:47 UTC
Changing /usr/lib/dracut/dracut.d/01-dist.conf to have
  hostonly="no"
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
  #hostonly="yes"
This is confusing because the actual value is taken from /usr/lib/dracut/dracut.d/01-dist.conf which had
  hostonly="yes"
before I changed it.

Comment 3 Kay Sievers 2013-07-01 22:44:46 UTC
Things in /usr/lib/ should not be edited, they are replaced with every update.

You can install:
  dracut-nohostonly.rpm
for a packaged config, changing the default.

Comment 4 Harald Hoyer 2013-08-20 12:56:48 UTC
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

       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"


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