Umount all partitions before repartition

This commit is contained in:
Jan Schneider 2018-03-01 17:51:55 +01:00
parent d0e6b549b1
commit 3f1ade345b
1 changed files with 8 additions and 2 deletions

View File

@ -743,8 +743,16 @@ proc ::rmupdate::move_userfs_to_device {target_device {sync_data 0} {repartition
}
if {$target_partition_device == ""} {
array set partitions [get_partitions $target_device]
set keys [array names partitions]
set partition_number 0
if {$repartition == 1} {
foreach key $keys {
regexp {^(.+)::([^:]+)$} $key match id opt
if {$opt == "partition_device"} {
catch { exec /bin/umount $partitions($key) }
}
}
set exitcode [catch {
exec /usr/sbin/parted --script ${target_device} \
mklabel msdos \
@ -755,8 +763,6 @@ proc ::rmupdate::move_userfs_to_device {target_device {sync_data 0} {repartition
}
set partition_number 1
} else {
array set partitions [get_partitions $target_device]
set keys [array names partitions]
foreach key $keys {
regexp {^(.+)::([^:]+)$} $key match id opt
if {$opt == "filesystem_label"} {