[Bug 1752876] Re: sfdisk: allow disabling boot flag on MBR partition table

Andrius Štikonas 1752876 at bugs.launchpad.net
Sat Jul 7 18:52:12 UTC 2018


sfdisk has to be run as root but it's fine because KPM KAuth helper can
run commands as root. On the other hand, libparted was a library.

partman might have worked if somebody wrote a backend for it but sfdisk
now has enough functionality anyway. Some things are hard to fix with
libparted, e.g. libparted has no support for hybrid MBR. So we would
just silently corrupt such setups with no way to fix it. We have more
direct control over partition type with sfdisk, although, these
partition flags don't matter that much anyway...

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to util-linux in Ubuntu.
https://bugs.launchpad.net/bugs/1752876

Title:
  sfdisk: allow disabling boot flag on MBR partition table

Status in util-linux package in Ubuntu:
  Fix Committed

Bug description:
  I would like to propose the following patch for Ubuntu 18.04 LTS

  
  https://github.com/karelzak/util-linux/commit/8175ed3d74adacc895657ded7546cb3c5deeabad


  [Impact]

   * This patch allows to use sfdisk to remove boot flag from all MBR partitions.
  At the moment you can only "move" boot flag to other partitions.

  
   * Derivatives of Ubuntu that use Calamares might be impacted by this. At the moment
  KDE Partition Manager and KPMcore (which is used by Calamares installer) are working on migrating to Polkit, so that they won't need to run GUI as root. One of the steps was moving from libparted backend to sfdisk backend for partitioning operations, so kpmcore will require 2.32 or 2.31.1 with this patch to have full functionality.

  
  [Test Case]

  Assuming that your want to deactivate boot flag on /dev/sdb which has
  MBR partition table:

  sudo sfdisk --activate /dev/sdb -

  Without this patch you should see an error message.

  With the patch it will print:
                                                                                                                                                                                                     
  The bootable flag on partition 1 is disabled now.                                                                                                                                                                 
                                                                                                                                                                                                                    
  The partition table has been altered.                                                                                                                                                                             
  Calling ioctl() to re-read partition table.                                                                                                                                                                       
  Syncing disks.


  [Regression Potential]
  .
   * Should be extremely low. The change only adds a couple of lines in one file
  which parses arguments of "sfdisk --activate". Nothing would change unless you
  run sfdisk --activate

   * This patch does not change any libraries in util-linux, no need to
  worry about API/ABI stability.

   * GPT users are not affected at all.

  
  [Other Info]
   * This patch is part of util-linux 2.32.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/1752876/+subscriptions



More information about the foundations-bugs mailing list