Skip to content

Commit 34e8b5f

Browse files
committed
system-reinstall-bootc: Do not warn on unmounted LVM volumes
If the system has a swap partition (or any other volume which is not currently mounted) the `findmnt` command will (expectedly) fail to find it. Don't early exit in this case, instead just ignore that volume. If it wasn't mounted in the first place, we don't need to warn about it being unmounted after the reinstall operation is complete. Signed-off-by: John Eckersberg <[email protected]> Closes: #1659
1 parent a507380 commit 34e8b5f

File tree

1 file changed

+2
-2
lines changed
  • crates/system-reinstall-bootc/src

1 file changed

+2
-2
lines changed

crates/system-reinstall-bootc/src/lvm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ pub(crate) fn check_root_siblings() -> Result<Vec<String>> {
6363
})
6464
.flat_map(|root_lv| parse_volumes(Some(root_lv.vg_name.as_str())).unwrap_or_default())
6565
.try_fold(Vec::new(), |mut acc, r| -> anyhow::Result<_> {
66-
let mount = run_findmnt(&["-S", &r.lv_path], None)?;
66+
let mount = run_findmnt(&["-S", &r.lv_path], None).unwrap_or_default();
6767
let mount_path = if let Some(fs) = mount.filesystems.first() {
6868
&fs.target
6969
} else {
7070
""
7171
};
7272

73-
if mount_path != "/" {
73+
if mount_path != "/" && !mount_path.is_empty() {
7474
acc.push(format!(
7575
"Type: LVM, Mount Point: {}, LV: {}, VG: {}, Size: {}",
7676
mount_path, r.lv_name, r.vg_name, r.lv_size

0 commit comments

Comments
 (0)