[Pkg-ganeti-devel] Bug#853167: ganeti-instance-debootstrap: OS installations fails because sfdisk believes the disk is in use

hexa- hexa at darmstadt.ccc.de
Wed May 3 13:31:20 UTC 2017


Hi Apollon,

I can confirm this works now with the `--no-reread` flag set instead of
`--force`.


Thanks alot for taking the time to look into this!


Best Regards,

Martin

On 05/03/2017 03:13 PM, Apollon Oikonomopoulos wrote:
> Hi Martin,
> 
> Apologies for the late response.
> 
> Here's a preliminary root cause analysis:
> 
> On Mon, 30 Jan 2017 13:33:33 +0100 Martin Weinelt <hexa at darmstadt.ccc.de> wrote:
>> This disk is currently in use - repartitioning is probably a bad idea.
>> Umount all file systems, and swapoff all swap partitions on this disk.
>> Use the --no-reread flag to suppress this check.
>>
>> sfdisk: Use the --force flag to overrule all checks.
>> ```
> 
> In util-linux 2.26, a safeguard was added to sfdisk to try to detect if 
> a disk is in use before partitioning. It does so by issuing the 
> BLKRRPART ioctl, which instructs the kernel to re-read the partition 
> table, which will fail if the disk is currently in use, and this is what 
> sfdisk looks for.
> 
> However, this operation will also fail with -EINVAL in a number of 
> cases, including when devices are declared to the kernel as 
> unpartitionable, i.e. with bdev->minors == 1. And this is how DRBD 
> declares its own devices. IOW, BLKRRPART on DRBD devices will *always* 
> fail, regardless whether the device is in use or not.
> 
>>
>> Adding `--force` to the sfdisk call in /usr/share/ganeti/os/debootstrap/common.sh:98
>> will allow for completion of the os installation.
>> Adding `--no-reread` didn't change a thing for me.
> 
> In theory, `--no-reread` should work. I tested it manually here, can you 
> please give it a try again? I would prefer to add `--no-reread` rather 
> than `--force`, if the former works.
> 
> Regards,
> Apollon
> 



More information about the Pkg-ganeti-devel mailing list