Bug Description

In the installer's partitioner, if you change an existing partition (say, NTFS) to ext3 so that you can install Ubuntu there but make no other changes (e.g. do not resize any partitions), partman mistakenly does not record the partition table as changed, and so the partition type field in the partition table remains as HPFS/NTFS. This causes GRUB to fail to install because it's fussy about the partition type.

I believe this is a fairly common reason for installation failures, and so I think it's worth backporting this fix to Ubuntu 8.04.2.

TEST CASE: Install Windows (for example, taking the whole disk), then start the Ubuntu installer and use manual partitioning. Be careful not to create, delete, or resize any partitions; instead, just edit the existing NTFS partition, set it to "Use as: ext3", and mount it on /. Finish partitioning, ignoring the "no swap" warning. Before this fix, GRUB should fail to install towards the end of installation; afterwards, it should succeed.

At present I know of no plausible regressions likely to happen with this patch, other than the partitioner breaking completely due to some kind of miscompilation. It's probably worth testing an LVM installation on general principles.

[ Colin Watson ]
* Exit straight away if a called script is killed by a signal.
* Disable backup while displaying device/partition locked errors; it makes
no sense and it can cause us to exit without closing the FIFO to
parted_server (LP: #274219).
* Record that CHANGE_FILE_SYSTEM changes the partition table
(LP: #149832).

[ Evan Dandrea ]
* Exclude devices that have mounted partitions. Useful for when installing
from a disk (LP: #276656). This can be disabled by preseeding
partman/filter_mounted to false.

I think we should backport this for Ubuntu 8.04.2. I'm discovering quite a few installation failure reports due to this (I suspect many of those that say "the file /boot/grub/stage1 not read correctly" are due to this, since grub will fail to mount a filesystem using its internal filesystem libraries if the partition has the wrong type), and I think backporting this one would be an easy big win.

I have also verified that, using the desktop hardy CD from 20090112.1, the partitioner properly sets the partition type to ext3 from HPFS/NTFS if no changes have been made to the partition layout. Marking verification-done.