diff --git a/dracut/50rdcore/module-setup.sh b/dracut/50rdcore/module-setup.sh index b386cc8b3..645dd458e 100755 --- a/dracut/50rdcore/module-setup.sh +++ b/dracut/50rdcore/module-setup.sh @@ -4,6 +4,7 @@ install() { local _arch=${DRACUT_ARCH:-$(uname -m)} inst_simple "$moddir/rdcore" "/usr/bin/rdcore" + inst_multiple partprobe # `rdcore kargs` calls `zipl` on s390x if [[ "$_arch" == "s390x" ]]; then diff --git a/src/bin/rdcore/rootmap.rs b/src/bin/rdcore/rootmap.rs index e93bef7f4..7681c0633 100644 --- a/src/bin/rdcore/rootmap.rs +++ b/src/bin/rdcore/rootmap.rs @@ -27,6 +27,10 @@ use libcoreinst::runcmd_output; use crate::cmdline::*; pub fn rootmap(config: &RootmapConfig) -> Result<()> { + // fail if we have more than 1 partition with boot label + if !check_single_partition("boot")? { + bail!("System has several partitions with boot label. Please 'wipefs' other disks"); + } // get the backing device for the root mount let mount = Mount::from_existing(&config.root_mount)?; let device = PathBuf::from(mount.device()); diff --git a/src/blockdev.rs b/src/blockdev.rs index 6f28b5e0e..4de94723d 100644 --- a/src/blockdev.rs +++ b/src/blockdev.rs @@ -1556,6 +1556,7 @@ fn count_partition_by_label(label: &str, devices: &[Device]) -> usize { } pub fn check_single_partition(label: &str) -> Result { + runcmd!("partprobe")?; let mut cmd = Command::new("lsblk"); cmd.arg("-o") .arg("NAME,LABEL,UUID")