Index: partman-base/lib/base.sh =================================================================== --- partman-base/lib/base.sh (revision 51963) +++ partman-base/lib/base.sh (working copy) @@ -869,10 +869,32 @@ disable_swap () { [ -f /proc/swaps ] || return 0 - grep '^/dev' /proc/swaps \ - | while read path x; do - swapoff $path - done + if [ "$1" ] && [ -d "$1" ]; then + local swaps dev + swaps= + dev="$1" + cd $dev + open_dialog PARTITIONS + while { read_line num id size type fs path name; [ "$id" ]; }; do + [ $fs != free ] || continue + [ -f "$id/method" ] || continue + method=$(cat $id/method) + if [ "$method" = swap ]; then + swaps="$swaps $path" + fi + done + close_dialog + for path in $swaps; do + if grep -q "^$(readlink -f "$path") " /proc/swaps; then + swapoff $path + fi + done + else + grep '^/dev' /proc/swaps \ + | while read path x; do + swapoff $path + done + fi } # Lock a device or partition against further modifications Index: partman-base/commit.d/parted =================================================================== --- partman-base/commit.d/parted (revision 51963) +++ partman-base/commit.d/parted (working copy) @@ -3,11 +3,17 @@ . /lib/partman/lib/base.sh . /lib/partman/lib/commit.sh -disable_swap for dev in $DEVICES/*; do [ -d "$dev" ] || continue cd $dev + open_dialog IS_CHANGED + read_line is_changed + close_dialog + [ "$is_changed" = yes ] || continue + + disable_swap "$dev" + open_dialog COMMIT close_dialog Index: partman-partitioning/lib/disk-label.sh =================================================================== --- partman-partitioning/lib/disk-label.sh (revision 51973) +++ partman-partitioning/lib/disk-label.sh (working copy) @@ -223,7 +223,7 @@ if [ "$chosen_type" = sun ]; then # write the partition table to the disk - disable_swap + disable_swap "$dev" open_dialog COMMIT close_dialog sync Index: partman-partitioning/lib/resize.sh =================================================================== --- partman-partitioning/lib/resize.sh (revision 51973) +++ partman-partitioning/lib/resize.sh (working copy) @@ -159,7 +159,7 @@ commit_changes partman-partitioning/new_size_commit_failed || exit 100 fi - disable_swap + disable_swap "$dev" if [ "$virtual" = no ] && \ [ -f $oldid/detected_filesystem ] && \