swapoff before swapon

Bug #199048 reported by John McCabe-Dansted
2
Affects Status Importance Assigned to Milestone
partman-base (Ubuntu)
Fix Released
Medium
Colin Watson
partman-partitioning (Ubuntu)
Fix Released
Medium
Colin Watson

Bug Description

Binary package hint: ubiquity

Ubiquity does a swapoff off the old swap before it does a swapon of the new swap. This makes sense when the old swap is on the device that is being repartitioned. But why do this if the two swap partitions are on different physical devices. Indeed, why do a swapoff at all?

I would expect ubiquity not to swap off the old swap before swapping on the new swap. This may make ubiquity perform better on low memory machines.

ProblemType: Bug
Architecture: i386
Date: Thu Mar 6 17:17:36 2008
DistroRelease: Ubuntu 7.10
NonfreeKernelModules: compcache tlsf lzo1x_decompress lzo1x_compress
Package: ubiquity 1.6.8
PackageArchitecture: i386
SourcePackage: ubiquity
Uname: Linux ubuntu 2.6.22-14-generic #1 SMP Sun Oct 14 23:05:12 GMT 2007 i686 GNU/Linux

Tags: apport-bug
Revision history for this message
John McCabe-Dansted (gmatht) wrote :
Revision history for this message
Colin Watson (cjwatson) wrote :

You have to disable swap on a device (and in general unmount everything on it) in order to convince the kernel to reload the partition table if you make any changes to it. If you don't do this, partitioning can get very confused.

I do agree that there is room for optimisation here. Swap only needs to be disabled on devices that have actually changed at the partition table level. This would allow the sort of multiple-disk case you're talking about, as well as installing onto a pre-partitioned disk with low memory.

Changed in ubiquity:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Colin Watson (cjwatson) wrote :

I think I have something resembling an implementation of this, but it will need some testing.

Changed in partman-partitioning:
importance: Undecided → Medium
status: New → Confirmed
Changed in partman-base:
assignee: nobody → kamion
status: Confirmed → In Progress
Changed in partman-partitioning:
assignee: nobody → kamion
status: Confirmed → In Progress
Revision history for this message
Fred (eldmannen+launchpad) wrote :

Miyagi: swapon... swapoff. swapon... swapoff.

Revision history for this message
Colin Watson (cjwatson) wrote :

I've committed fixes for this to d-i upstream. I can backport them to Ubuntu after the 8.04 beta.

Colin Watson (cjwatson)
Changed in partman-base:
status: In Progress → Fix Committed
Colin Watson (cjwatson)
Changed in partman-partitioning:
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package partman-base - 114ubuntu4

---------------
partman-base (114ubuntu4) hardy; urgency=low

  * Backport from trunk:
    - Don't emit confusing log messages if partman-lvm or partman-crypto are
      already loaded.
    - Allow disable_swap to take a device argument, in which case it only
      disables swap on that device rather than on all devices.
    - Only disable swap on devices that are being changed (LP: #199048).

 -- Colin Watson <email address hidden> Fri, 21 Mar 2008 00:24:24 +0000

Changed in partman-base:
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package partman-partitioning - 54ubuntu5

---------------
partman-partitioning (54ubuntu5) hardy; urgency=low

  * Backport from trunk:
    - Only disable swap on devices that are being changed (LP: #199048).
      Requires partman-base (>= 114ubuntu4).
  * Move 'local' down a line in create_new_partition in order to work
    properly with bash, which initialises local variables without an
    accompanying assignment to empty rather than to any previous value.

 -- Colin Watson <email address hidden> Fri, 21 Mar 2008 00:27:06 +0000

Changed in partman-partitioning:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.