diff --git a/crates/system-reinstall-bootc/src/lvm.rs b/crates/system-reinstall-bootc/src/lvm.rs index facf9e28..78b6db54 100644 --- a/crates/system-reinstall-bootc/src/lvm.rs +++ b/crates/system-reinstall-bootc/src/lvm.rs @@ -2,7 +2,7 @@ use std::process::Command; use anyhow::Result; use bootc_mount::run_findmnt; -use bootc_utils::CommandRunExt; +use bootc_utils::{CommandRunExt, ResultExt}; use serde::Deserialize; #[derive(Debug, Deserialize)] @@ -54,7 +54,7 @@ pub(crate) fn check_root_siblings() -> Result> { let siblings: Vec = all_volumes .iter() .filter(|lv| { - let mount = run_findmnt(&["-S", &lv.lv_path], None).unwrap_or_default(); + let mount = run_findmnt(&["-S", &lv.lv_path], None).log_err_default(); if let Some(fs) = mount.filesystems.first() { &fs.target == "/" } else { @@ -63,14 +63,14 @@ pub(crate) fn check_root_siblings() -> Result> { }) .flat_map(|root_lv| parse_volumes(Some(root_lv.vg_name.as_str())).unwrap_or_default()) .try_fold(Vec::new(), |mut acc, r| -> anyhow::Result<_> { - let mount = run_findmnt(&["-S", &r.lv_path], None)?; + let mount = run_findmnt(&["-S", &r.lv_path], None).log_err_default(); let mount_path = if let Some(fs) = mount.filesystems.first() { &fs.target } else { "" }; - if mount_path != "/" { + if mount_path != "/" && !mount_path.is_empty() { acc.push(format!( "Type: LVM, Mount Point: {}, LV: {}, VG: {}, Size: {}", mount_path, r.lv_name, r.vg_name, r.lv_size