From fd502cfb99f287f4fbfb147b530b50d5b73555e4 Mon Sep 17 00:00:00 2001 From: Aiden McClelland Date: Tue, 24 Mar 2026 19:19:58 -0600 Subject: [PATCH] fix: probe active block device before vg import cycle When the target VG is already active (e.g. the running system's own VG), probe the block device directly instead of going through the full import/activate/open/cleanup sequence. --- core/src/disk/main.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/src/disk/main.rs b/core/src/disk/main.rs index a88c94ab1..fab738b04 100644 --- a/core/src/disk/main.rs +++ b/core/src/disk/main.rs @@ -409,6 +409,18 @@ pub async fn mount_all_fs>( /// filesystem type. Returns `None` if probing fails (e.g. LV doesn't exist). #[instrument(skip_all)] pub async fn probe_package_data_fs(guid: &str) -> Result, Error> { + // If the target block device is already accessible (e.g. this is the + // currently active system VG), probe it directly without any + // import/activate/open/cleanup steps. + let blockdev_path = if !guid.ends_with("_UNENC") { + PathBuf::from(format!("/dev/mapper/{guid}_package-data")) + } else { + Path::new("/dev").join(guid).join("package-data") + }; + if tokio::fs::metadata(&blockdev_path).await.is_ok() { + return detect_filesystem(&blockdev_path).await.map(Some); + } + // Import and activate the VG match Command::new("vgimport") .arg(guid)