Say, how does moving to sfdisk help? It still has to be run as root. You might consider using partman, which is the libparted wrapper program that allows debian-installer to make libparted calls from bash scripts. It takes commands and gives replies via a pair of named pipes.
-- You received this bug notification because you are a member of Ubuntu Touch seeded packages, 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: Confirmed 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 -- Mailing list: https://launchpad.net/~touch-packages Post to : touch-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~touch-packages More help : https://help.launchpad.net/ListHelp