[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#298042: debian-installer: fails to mark partition type as linux if reusing a ntfs partition



tags 298042 patch
user ubuntu-devel@lists.ubuntu.com
usertags 298042 ubuntu-patch intrepid
thanks

On Fri, Mar 04, 2005 at 10:27:33AM +0100, robinud@volja.net wrote:
> If one tries to use an old ntfs partition as an ext3 root
> partition, then d-i forgets to change the partition id
> from 7 (NTFS) to 83 (Linux).
> 
> Then grub failed to install itself on the disk.
> I guess the above is the cause.
> 
> Also, if grub is somehow booted, it will list the partition
> as unknown type and fail to load the kernel image or even to
> browse the directories.

I'm pretty sure that this is because the CHANGE_FILE_SYSTEM command in
parted_server forgets to record that the partition table is changed.
When partman was originally written, this didn't matter because there
would generally also be a CREATE_FILE_SYSTEM command sent which would
mark the partition table as changed. However, it turned out that we
couldn't always use CREATE_FILE_SYSTEM because e.g. libparted can't
create resizable ext3 file systems, so this hasn't been guaranteed for
quite some time. Thus, when the COMMIT command is sent, parted_server
sees that the partition table is "unchanged" and so doesn't bother to
tell libparted to commit its changes to disk.

This doesn't happen if you create new partitions in the same run of
partman (without any intervening steps that involve committing changes
to disk), since the NEW_PARTITION command does record that the partition
table is changed.

The following patch should fix this bug which IMO is release-critical
(although I know that previous releases went out with this bug). I'm
afraid I'm not up to speed with d-i's current freeze state; Otavio, may
I commit this patch? I confess that I have not yet tested it, although I
have replicated the original bug under controlled conditions. I should
be able to perform a similar test soon with a fixed parted_server and
report back.

Index: debian/changelog
===================================================================
--- debian/changelog	(revision 56346)
+++ debian/changelog	(working copy)
@@ -1,3 +1,10 @@
+partman-base (128) UNRELEASED; urgency=low
+
+  * Record that CHANGE_FILE_SYSTEM changes the partition table (closes:
+    #298042).
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Fri, 10 Oct 2008 19:55:51 +0100
+
 partman-base (127) unstable; urgency=low
 
   * Add human readable descriptions for MMC/SD cards.
Index: parted_server.c
===================================================================
--- parted_server.c	(revision 56346)
+++ parted_server.c	(working copy)
@@ -1640,6 +1640,7 @@
         scan_device_name();
         if (dev == NULL)
                 critical_error("The device %s is not opened.", device_name);
+        change_named(device_name);
         open_out();
         if (2 != iscanf("%as %as", &id, &s_fstype))
                 critical_error("Expected partition id and file system");

Thanks,

-- 
Colin Watson                                       [cjwatson@ubuntu.com]



Reply to: