fdisk doesn't write MBR if only Windows NT ID is changed.

Bug #225564 reported by Ralph Corderoy on 2008-05-02
This bug affects 1 person
Affects Status Importance Assigned to Milestone
util-linux (Ubuntu)

Bug Description

Binary package hint: util-linux

Ubuntu 7.10, util-linux 2.13-8ubuntu1.

If the only change to a disc's MBR in fdisk is to use the `expert' menu's `i' option to set the MBR's Window NT's ID, now used by Linux for EDD, then the altered partition isn't written back to disc so the change isn't done. This seems to be because write_table() doesn't call write_sector() which calls write(2) unless one of the four primary partition entries has been altered, which is the case of `i', they haven't.

fdisk misleadingly goes onto say

    Expert command (m for help): w
    The partition table has been altered!

    Calling ioctl() to re-read partition table.

    WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
    The kernel still uses the old table.
    The new table will be used at the next reboot.
    Syncing disks.

but this isn't true and on the next reboot the old ID will still be present. This can also be seen with a hexdump before reboot, "hexdump -C -s 440 -n 4 /dev/sda".

A workaround is to toggle a partition's boot flag with the `a' command, thus setting the `partition foo is changed' flag, toggle it again, which doesn't clear said changed flag, then use the expert `i' command to change the ID before using `w' to write the MBR.

Thank you for taking the time to report this bug and helping to make Ubuntu better. We are sorry that we do not always have the capacity to look at all reported bugs in a timely manner. There have been many changes in Ubuntu since that time you reported the bug and your problem may have been fixed with some of the updates. It would help us a lot if you could test it on a currently supported Ubuntu version. When you test it and it is still an issue, kindly upload the updated logs by running apport-collect <bug #> and any other logs that are relevant for this particular issue.

Changed in util-linux (Ubuntu):
status: New → Incomplete
Launchpad Janitor (janitor) wrote :

[Expired for util-linux (Ubuntu) because there has been no activity for 60 days.]

Changed in util-linux (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers