![](https://seccdn.libravatar.org/avatar/a961d54b41a44a48c5241aab3571178f.jpg?s=120&d=mm&r=g)
On Tue, Oct 25, Anton Aylward wrote:
On 10/25/2016 08:33 AM, Olaf Hering wrote:
Since both grub2 and dracut ignore system settings (they enforce by-uuid) its helpful to rerun mkinitrd, grub-mkconfig and grub-install to update their view on the system. Could you please expand/document/reference that assertion.
The example you gave earlier mentioned "copy rootfs from A to B". I do that alot on i386-pc with plain partitions and chainloading. While it looks easy to reference everything by-label and expect the copy to work, both grub2 and dracut will ruin your day. Typically /etc/fstab is the one and only place that describes how filesystems are referenced (label,uuid,id,path,kernel name). Thats a decision the installer and the admin make. For my own purpose label is good because its obvious and easy to remember. When dracut creates an initrd it includes values for certain settings in case the kernel cmdline lacks the respective override setting. Instead of using the fstab value for a mount point verbatim it enforces uuid for root=. See the output of dracut as reference. When grub creats its grub.cfg it enforces a global kernel cmdline. Thats probably fine, but each kernel also gets a root=UUID=val. This is wrong because in the end only the initrd cares about that root= option and the initrd already has the correct value. Also the code to search for the partition with the kernel/initrd enforces uuid. Here the values from fstab have for be used verbatime in case of label/uuid. For id/path/kernel name grub has to use some other method because such info is typically not available at firmware level, so uuid would be fine. When grub installs its first stage loader it probably also uses uuid to find the second stage. But I have not checked the code what really happens in that case. It most likely differs between the various supported firmware variants. For short: one can not just copy a partition around and expect a properly configured root filesystem to work. Your example may work because grub is unchanged and grub loads the kernel from btrfs and passes root=ext4 to that kernel. Olaf