clear dmsetup before import

This commit is contained in:
Aiden McClelland
2022-01-19 13:09:08 -07:00
committed by Aiden McClelland
parent 8e5a7ea9a7
commit a16eacd3f8

View File

@@ -218,6 +218,10 @@ pub async fn import<P: AsRef<Path>>(guid: &str, datadir: P, password: &str) -> R
crate::ErrorKind::IncorrectDisk, crate::ErrorKind::IncorrectDisk,
)); ));
} }
Command::new("dmsetup")
.arg("remove_all") // TODO: find a higher finesse way to do this for portability reasons
.invoke(crate::ErrorKind::DiskManagement)
.await?;
match Command::new("vgimport") match Command::new("vgimport")
.arg(guid) .arg(guid)
.invoke(crate::ErrorKind::DiskManagement) .invoke(crate::ErrorKind::DiskManagement)