This option tells whether a hard disk should be partitioned or not. It
defaults to true and have the prime effect of preventing a master boot
record (MBR) to be initialized.
This is useful as some operating system (QNX, Rtems) don't
recognized FAT mounted disks (especially SD cards) if a MBR is present.
Signed-off-by: Clément Chigot <chigot@adacore.com>
---
block/vvfat.c | 21 +++++++++++++++++++--
qapi/block-core.json | 10 +++++++---
2 files changed, 26 insertions(+), 5 deletions(-)
diff --git a/block/vvfat.c b/block/vvfat.c
index 814796d918..de6031db98 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -306,7 +306,8 @@ typedef struct BDRVVVFATState {
array_t fat,directory,mapping;
char volume_label[11];
- uint32_t offset_to_bootsector; /* 0 for floppy, 0x3f for disk */
+ /* 0x3f for partitioned disk, 0x0 otherwise */
+ uint32_t offset_to_bootsector;
unsigned int cluster_size;
unsigned int sectors_per_cluster;
@@ -1082,6 +1083,12 @@ static QemuOptsList runtime_opts = {
.type = QEMU_OPT_BOOL,
.help = "Make the image writable",
},
+ {
+ .name = "partitioned",
+ .type = QEMU_OPT_BOOL,
+ .def_value_str = "true",
+ .help = "Do not add a Master Boot Record on this disk",
+ },
{ /* end of list */ }
},
};
@@ -1092,6 +1099,7 @@ static void vvfat_parse_filename(const char *filename, QDict *options,
int fat_type = 0;
bool floppy = false;
bool rw = false;
+ bool partitioned = true;
int i;
if (!strstart(filename, "fat:", NULL)) {
@@ -1116,6 +1124,10 @@ static void vvfat_parse_filename(const char *filename, QDict *options,
rw = true;
}
+ if (strstr(filename, ":unpartitioned:")) {
+ partitioned = false;
+ }
+
/* Get the directory name without options */
i = strrchr(filename, ':') - filename;
assert(i >= 3);
@@ -1131,6 +1143,7 @@ static void vvfat_parse_filename(const char *filename, QDict *options,
qdict_put_int(options, "fat-type", fat_type);
qdict_put_bool(options, "floppy", floppy);
qdict_put_bool(options, "rw", rw);
+ qdict_put_bool(options, "partitioned", partitioned);
}
static int vvfat_open(BlockDriverState *bs, QDict *options, int flags,
@@ -1196,7 +1209,10 @@ static int vvfat_open(BlockDriverState *bs, QDict *options, int flags,
if (!s->fat_type) {
s->fat_type = 16;
}
- s->offset_to_bootsector = 0x3f;
+ /* Reserver space for MBR */
+ if (qemu_opt_get_bool(opts, "partitioned", true)) {
+ s->offset_to_bootsector = 0x3f;
+ }
cyls = s->fat_type == 12 ? 64 : 1024;
heads = 16;
secs = 63;
@@ -3246,6 +3262,7 @@ static const char *const vvfat_strong_runtime_opts[] = {
"floppy",
"label",
"rw",
+ "partitioned",
NULL
};
diff --git a/qapi/block-core.json b/qapi/block-core.json
index b82af74256..8a479ba090 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -3464,8 +3464,8 @@
#
# @fat-type: FAT type: 12, 16 or 32
#
-# @floppy: whether to export a floppy image (true) or partitioned hard
-# disk (false; default)
+# @floppy: whether to export a floppy image (true) or hard disk
+# (false; default)
#
# @label: set the volume label, limited to 11 bytes. FAT16 and FAT32
# traditionally have some restrictions on labels, which are
@@ -3474,11 +3474,15 @@
#
# @rw: whether to allow write operations (default: false)
#
+# @partitioned: whether a hard disk will be partitioned
+# (default: true)
+# (since 10.2)
+#
# Since: 2.9
##
{ 'struct': 'BlockdevOptionsVVFAT',
'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
- '*label': 'str', '*rw': 'bool' } }
+ '*label': 'str', '*rw': 'bool', '*partitioned': 'bool' } }
##
# @BlockdevOptionsGenericFormat:
--
2.43.0
Clément Chigot <chigot@adacore.com> writes:
> This option tells whether a hard disk should be partitioned or not. It
> defaults to true and have the prime effect of preventing a master boot
> record (MBR) to be initialized.
>
> This is useful as some operating system (QNX, Rtems) don't
> recognized FAT mounted disks (especially SD cards) if a MBR is present.
>
> Signed-off-by: Clément Chigot <chigot@adacore.com>
[...]
> diff --git a/qapi/block-core.json b/qapi/block-core.json
> index b82af74256..8a479ba090 100644
> --- a/qapi/block-core.json
> +++ b/qapi/block-core.json
> @@ -3464,8 +3464,8 @@
> #
> # @fat-type: FAT type: 12, 16 or 32
> #
> -# @floppy: whether to export a floppy image (true) or partitioned hard
> -# disk (false; default)
> +# @floppy: whether to export a floppy image (true) or hard disk
> +# (false; default)
> #
> # @label: set the volume label, limited to 11 bytes. FAT16 and FAT32
> # traditionally have some restrictions on labels, which are
> @@ -3474,11 +3474,15 @@
> #
> # @rw: whether to allow write operations (default: false)
> #
> +# @partitioned: whether a hard disk will be partitioned
How does "partitioned" combine with "floppy": true?
Is it silently ignored?
Is it an error if present?
Is it an error if true?
Does it add a partition table if true?
> +# (default: true)
Hmm, this suggests it's silently ignored.
Silently ignoring nonsensical configuration is usually a bad idea.
> +# (since 10.2)
> +#
Not sure I like "partitioned". Is a disk with an MBR and a partition
table contraining a single partition partitioned? Call it "mbr"?
> # Since: 2.9
> ##
> { 'struct': 'BlockdevOptionsVVFAT',
> 'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
> - '*label': 'str', '*rw': 'bool' } }
> + '*label': 'str', '*rw': 'bool', '*partitioned': 'bool' } }
>
> ##
> # @BlockdevOptionsGenericFormat:
On Mon, Nov 10, 2025 at 11:07 AM Markus Armbruster <armbru@redhat.com> wrote:
>
> Clément Chigot <chigot@adacore.com> writes:
>
> > This option tells whether a hard disk should be partitioned or not. It
> > defaults to true and have the prime effect of preventing a master boot
> > record (MBR) to be initialized.
> >
> > This is useful as some operating system (QNX, Rtems) don't
> > recognized FAT mounted disks (especially SD cards) if a MBR is present.
> >
> > Signed-off-by: Clément Chigot <chigot@adacore.com>
>
> [...]
>
> > diff --git a/qapi/block-core.json b/qapi/block-core.json
> > index b82af74256..8a479ba090 100644
> > --- a/qapi/block-core.json
> > +++ b/qapi/block-core.json
> > @@ -3464,8 +3464,8 @@
> > #
> > # @fat-type: FAT type: 12, 16 or 32
> > #
> > -# @floppy: whether to export a floppy image (true) or partitioned hard
> > -# disk (false; default)
> > +# @floppy: whether to export a floppy image (true) or hard disk
> > +# (false; default)
> > #
> > # @label: set the volume label, limited to 11 bytes. FAT16 and FAT32
> > # traditionally have some restrictions on labels, which are
> > @@ -3474,11 +3474,15 @@
> > #
> > # @rw: whether to allow write operations (default: false)
> > #
> > +# @partitioned: whether a hard disk will be partitioned
>
> How does "partitioned" combine with "floppy": true?
>
> Is it silently ignored?
>
> Is it an error if present?
>
> Is it an error if true?
>
> Does it add a partition table if true?
>
> > +# (default: true)
>
> Hmm, this suggests it's silently ignored.
>
> Silently ignoring nonsensical configuration is usually a bad idea.
True, but that would mean "unpartitioned" must always be passed when
"floppy" is requested. That would make such command lines a bit more
verbose, but otherwise I don't think there is any issue to that.
Note that I didn't add "partition" as a keyword in the command line.
Currently, it's either the default (thus partitioned) or
"unpartitioned" being requested. Do you think it makes sense to add it
as well, even if it's redundant ?
> > +# (since 10.2)
> > +#
>
> Not sure I like "partitioned". Is a disk with an MBR and a partition
> table contraining a single partition partitioned? Call it "mbr"?
It used to be called "mbr/no-mbr" but Kevin suggested renaming it in
V1. Honestly I'm fine with both options:
- Technically, the option prevents MBR which has a side effect for
preventing partition tables
- Even it has a single partition, I think it makes sense to call a
disk "partitioned" as long as it has a partition table
But I'm not that familiar with disk formats, etc. I'll let you decide
with Kevin, which one you prefer.
> > # Since: 2.9
> > ##
> > { 'struct': 'BlockdevOptionsVVFAT',
> > 'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
> > - '*label': 'str', '*rw': 'bool' } }
> > + '*label': 'str', '*rw': 'bool', '*partitioned': 'bool' } }
> >
> > ##
> > # @BlockdevOptionsGenericFormat:
>
On Mon, 10 Nov 2025, Clément Chigot wrote:
> On Mon, Nov 10, 2025 at 11:07 AM Markus Armbruster <armbru@redhat.com> wrote:
>>
>> Clément Chigot <chigot@adacore.com> writes:
>>
>>> This option tells whether a hard disk should be partitioned or not. It
>>> defaults to true and have the prime effect of preventing a master boot
>>> record (MBR) to be initialized.
>>>
>>> This is useful as some operating system (QNX, Rtems) don't
>>> recognized FAT mounted disks (especially SD cards) if a MBR is present.
>>>
>>> Signed-off-by: Clément Chigot <chigot@adacore.com>
>>
>> [...]
>>
>>> diff --git a/qapi/block-core.json b/qapi/block-core.json
>>> index b82af74256..8a479ba090 100644
>>> --- a/qapi/block-core.json
>>> +++ b/qapi/block-core.json
>>> @@ -3464,8 +3464,8 @@
>>> #
>>> # @fat-type: FAT type: 12, 16 or 32
>>> #
>>> -# @floppy: whether to export a floppy image (true) or partitioned hard
>>> -# disk (false; default)
>>> +# @floppy: whether to export a floppy image (true) or hard disk
>>> +# (false; default)
>>> #
>>> # @label: set the volume label, limited to 11 bytes. FAT16 and FAT32
>>> # traditionally have some restrictions on labels, which are
>>> @@ -3474,11 +3474,15 @@
>>> #
>>> # @rw: whether to allow write operations (default: false)
>>> #
>>> +# @partitioned: whether a hard disk will be partitioned
>>
>> How does "partitioned" combine with "floppy": true?
>>
>> Is it silently ignored?
>>
>> Is it an error if present?
>>
>> Is it an error if true?
>>
>> Does it add a partition table if true?
>>
>>> +# (default: true)
>>
>> Hmm, this suggests it's silently ignored.
>>
>> Silently ignoring nonsensical configuration is usually a bad idea.
>
> True, but that would mean "unpartitioned" must always be passed when
> "floppy" is requested. That would make such command lines a bit more
> verbose, but otherwise I don't think there is any issue to that.
>
> Note that I didn't add "partition" as a keyword in the command line.
> Currently, it's either the default (thus partitioned) or
> "unpartitioned" being requested. Do you think it makes sense to add it
> as well, even if it's redundant ?
>
>>> +# (since 10.2)
>>> +#
>>
>> Not sure I like "partitioned". Is a disk with an MBR and a partition
>> table contraining a single partition partitioned? Call it "mbr"?
>
> It used to be called "mbr/no-mbr" but Kevin suggested renaming it in
> V1. Honestly I'm fine with both options:
> - Technically, the option prevents MBR which has a side effect for
> preventing partition tables
> - Even it has a single partition, I think it makes sense to call a
> disk "partitioned" as long as it has a partition table
>
> But I'm not that familiar with disk formats, etc. I'll let you decide
> with Kevin, which one you prefer.
I'd also vote for mbr or similar shorter name; unpartitioned is awkward to
type out in a command line. Maybe it can default to false for floppy and
true for disk to preserve current behaviour but allow controlling it.
Regards,
BALATON Zoltan
>>> # Since: 2.9
>>> ##
>>> { 'struct': 'BlockdevOptionsVVFAT',
>>> 'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
>>> - '*label': 'str', '*rw': 'bool' } }
>>> + '*label': 'str', '*rw': 'bool', '*partitioned': 'bool' } }
>>>
>>> ##
>>> # @BlockdevOptionsGenericFormat:
>>
>
>
BALATON Zoltan <balaton@eik.bme.hu> writes: > On Mon, 10 Nov 2025, Clément Chigot wrote: >> On Mon, Nov 10, 2025 at 11:07 AM Markus Armbruster <armbru@redhat.com> wrote: >>> >>> Clément Chigot <chigot@adacore.com> writes: >>> >>>> This option tells whether a hard disk should be partitioned or not. It >>>> defaults to true and have the prime effect of preventing a master boot >>>> record (MBR) to be initialized. >>>> >>>> This is useful as some operating system (QNX, Rtems) don't >>>> recognized FAT mounted disks (especially SD cards) if a MBR is present. >>>> >>>> Signed-off-by: Clément Chigot <chigot@adacore.com> >>> >>> [...] >>> >>>> diff --git a/qapi/block-core.json b/qapi/block-core.json >>>> index b82af74256..8a479ba090 100644 >>>> --- a/qapi/block-core.json >>>> +++ b/qapi/block-core.json >>>> @@ -3464,8 +3464,8 @@ >>>> # >>>> # @fat-type: FAT type: 12, 16 or 32 >>>> # >>>> -# @floppy: whether to export a floppy image (true) or partitioned hard >>>> -# disk (false; default) >>>> +# @floppy: whether to export a floppy image (true) or hard disk >>>> +# (false; default) >>>> # >>>> # @label: set the volume label, limited to 11 bytes. FAT16 and FAT32 >>>> # traditionally have some restrictions on labels, which are >>>> @@ -3474,11 +3474,15 @@ >>>> # >>>> # @rw: whether to allow write operations (default: false) >>>> # >>>> +# @partitioned: whether a hard disk will be partitioned >>> >>> How does "partitioned" combine with "floppy": true? >>> >>> Is it silently ignored? >>> >>> Is it an error if present? >>> >>> Is it an error if true? >>> >>> Does it add a partition table if true? >>> >>>> +# (default: true) >>> >>> Hmm, this suggests it's silently ignored. >>> >>> Silently ignoring nonsensical configuration is usually a bad idea. >> >> True, but that would mean "unpartitioned" must always be passed when >> "floppy" is requested. That would make such command lines a bit more >> verbose, but otherwise I don't think there is any issue to that. >> >> Note that I didn't add "partition" as a keyword in the command line. >> Currently, it's either the default (thus partitioned) or >> "unpartitioned" being requested. Do you think it makes sense to add it >> as well, even if it's redundant ? >> >>>> +# (since 10.2) >>>> +# >>> >>> Not sure I like "partitioned". Is a disk with an MBR and a partition >>> table contraining a single partition partitioned? Call it "mbr"? >> >> It used to be called "mbr/no-mbr" but Kevin suggested renaming it in >> V1. Honestly I'm fine with both options: >> - Technically, the option prevents MBR which has a side effect for >> preventing partition tables Yes, because the partition table is part of the MBR. I'd rather name the option after the entire thing it controls, not one of its parts. >> - Even it has a single partition, I think it makes sense to call a >> disk "partitioned" as long as it has a partition table >> >> But I'm not that familiar with disk formats, etc. I'll let you decide >> with Kevin, which one you prefer. Kevin is the maintainer, I just serve as advisor here. > I'd also vote for mbr or similar shorter name; unpartitioned is awkward to type out in a command line. Maybe it can default to false for floppy and true for disk to preserve current behaviour but allow controlling it. I'm not a fan of conditional defaults, but I think it's better than a nonsensical default that gets ignored. [...]
Am 10.11.2025 um 14:20 hat Markus Armbruster geschrieben:
> BALATON Zoltan <balaton@eik.bme.hu> writes:
>
> > On Mon, 10 Nov 2025, Clément Chigot wrote:
> >> On Mon, Nov 10, 2025 at 11:07 AM Markus Armbruster <armbru@redhat.com> wrote:
> >>>
> >>> Clément Chigot <chigot@adacore.com> writes:
> >>>
> >>>> This option tells whether a hard disk should be partitioned or not. It
> >>>> defaults to true and have the prime effect of preventing a master boot
> >>>> record (MBR) to be initialized.
> >>>>
> >>>> This is useful as some operating system (QNX, Rtems) don't
> >>>> recognized FAT mounted disks (especially SD cards) if a MBR is present.
> >>>>
> >>>> Signed-off-by: Clément Chigot <chigot@adacore.com>
> >>>
> >>> [...]
> >>>
> >>>> diff --git a/qapi/block-core.json b/qapi/block-core.json
> >>>> index b82af74256..8a479ba090 100644
> >>>> --- a/qapi/block-core.json
> >>>> +++ b/qapi/block-core.json
> >>>> @@ -3464,8 +3464,8 @@
> >>>> #
> >>>> # @fat-type: FAT type: 12, 16 or 32
> >>>> #
> >>>> -# @floppy: whether to export a floppy image (true) or partitioned hard
> >>>> -# disk (false; default)
> >>>> +# @floppy: whether to export a floppy image (true) or hard disk
> >>>> +# (false; default)
> >>>> #
> >>>> # @label: set the volume label, limited to 11 bytes. FAT16 and FAT32
> >>>> # traditionally have some restrictions on labels, which are
> >>>> @@ -3474,11 +3474,15 @@
> >>>> #
> >>>> # @rw: whether to allow write operations (default: false)
> >>>> #
> >>>> +# @partitioned: whether a hard disk will be partitioned
> >>>
> >>> How does "partitioned" combine with "floppy": true?
> >>>
> >>> Is it silently ignored?
> >>>
> >>> Is it an error if present?
> >>>
> >>> Is it an error if true?
> >>>
> >>> Does it add a partition table if true?
> >>>
> >>>> +# (default: true)
> >>>
> >>> Hmm, this suggests it's silently ignored.
> >>>
> >>> Silently ignoring nonsensical configuration is usually a bad idea.
> >>
> >> True, but that would mean "unpartitioned" must always be passed when
> >> "floppy" is requested. That would make such command lines a bit more
> >> verbose, but otherwise I don't think there is any issue to that.
> >>
> >> Note that I didn't add "partition" as a keyword in the command line.
> >> Currently, it's either the default (thus partitioned) or
> >> "unpartitioned" being requested. Do you think it makes sense to add it
> >> as well, even if it's redundant ?
> >>
> >>>> +# (since 10.2)
> >>>> +#
> >>>
> >>> Not sure I like "partitioned". Is a disk with an MBR and a partition
> >>> table contraining a single partition partitioned? Call it "mbr"?
> >>
> >> It used to be called "mbr/no-mbr" but Kevin suggested renaming it in
> >> V1. Honestly I'm fine with both options:
> >> - Technically, the option prevents MBR which has a side effect for
> >> preventing partition tables
>
> Yes, because the partition table is part of the MBR. I'd rather name
> the option after the entire thing it controls, not one of its parts.
>
> >> - Even it has a single partition, I think it makes sense to call a
> >> disk "partitioned" as long as it has a partition table
> >>
> >> But I'm not that familiar with disk formats, etc. I'll let you decide
> >> with Kevin, which one you prefer.
>
> Kevin is the maintainer, I just serve as advisor here.
I figured that the meaning of "partitioned" is easier to understand for
a casual user than having or not having an MBR ("I don't want to boot
from this disk, why would I care about a boot record?").
But if people think that "mbr" is better, that's fine with me.
The only thing I really didn't want is the negative "no-mbr" and the
double negation in "no-mbr=off" that comes with it.
> > I'd also vote for mbr or similar shorter name; unpartitioned is
> > awkward to type out in a command line. Maybe it can default to false
> > for floppy and true for disk to preserve current behaviour but allow
> > controlling it.
>
> I'm not a fan of conditional defaults, but I think it's better than a
> nonsensical default that gets ignored.
I think in this case a conditional default makes sense, not only for
compatibility reasons. Hard disks almost always have a partition, floppy
disks with partitions are basically unheard of.
Kevin
Kevin Wolf <kwolf@redhat.com> writes:
> Am 10.11.2025 um 14:20 hat Markus Armbruster geschrieben:
>> BALATON Zoltan <balaton@eik.bme.hu> writes:
>>
>> > On Mon, 10 Nov 2025, Clément Chigot wrote:
>> >> On Mon, Nov 10, 2025 at 11:07 AM Markus Armbruster <armbru@redhat.com> wrote:
>> >>>
>> >>> Clément Chigot <chigot@adacore.com> writes:
>> >>>
>> >>>> This option tells whether a hard disk should be partitioned or not. It
>> >>>> defaults to true and have the prime effect of preventing a master boot
>> >>>> record (MBR) to be initialized.
>> >>>>
>> >>>> This is useful as some operating system (QNX, Rtems) don't
>> >>>> recognized FAT mounted disks (especially SD cards) if a MBR is present.
>> >>>>
>> >>>> Signed-off-by: Clément Chigot <chigot@adacore.com>
[...]
>> >>> Not sure I like "partitioned". Is a disk with an MBR and a partition
>> >>> table contraining a single partition partitioned? Call it "mbr"?
>> >>
>> >> It used to be called "mbr/no-mbr" but Kevin suggested renaming it in
>> >> V1. Honestly I'm fine with both options:
>> >> - Technically, the option prevents MBR which has a side effect for
>> >> preventing partition tables
>>
>> Yes, because the partition table is part of the MBR. I'd rather name
>> the option after the entire thing it controls, not one of its parts.
>>
>> >> - Even it has a single partition, I think it makes sense to call a
>> >> disk "partitioned" as long as it has a partition table
>> >>
>> >> But I'm not that familiar with disk formats, etc. I'll let you decide
>> >> with Kevin, which one you prefer.
>>
>> Kevin is the maintainer, I just serve as advisor here.
>
> I figured that the meaning of "partitioned" is easier to understand for
> a casual user than having or not having an MBR ("I don't want to boot
> from this disk, why would I care about a boot record?").
Fair point.
Possible counter-points:
* The default is almost always right for the casual user. The
exception, as far as I understand, is certain guest OSes refuse to
play ball with certain devices when they have an MBR.
* The configuration interface isn't exactly casual-user-friendly to
begin with. @fat-type, what's that, and why do I care? @floppy,
what's that, and why do I care?
Anyway, you decide.
> But if people think that "mbr" is better, that's fine with me.
>
> The only thing I really didn't want is the negative "no-mbr" and the
> double negation in "no-mbr=off" that comes with it.
Yes, negative names should definitely be avoided for boolean options.
[...]
On Mon, 10 Nov 2025, Kevin Wolf wrote:
> Am 10.11.2025 um 14:20 hat Markus Armbruster geschrieben:
>> BALATON Zoltan <balaton@eik.bme.hu> writes:
>>
>>> On Mon, 10 Nov 2025, Clément Chigot wrote:
>>>> On Mon, Nov 10, 2025 at 11:07 AM Markus Armbruster <armbru@redhat.com> wrote:
>>>>>
>>>>> Clément Chigot <chigot@adacore.com> writes:
>>>>>
>>>>>> This option tells whether a hard disk should be partitioned or not. It
>>>>>> defaults to true and have the prime effect of preventing a master boot
>>>>>> record (MBR) to be initialized.
>>>>>>
>>>>>> This is useful as some operating system (QNX, Rtems) don't
>>>>>> recognized FAT mounted disks (especially SD cards) if a MBR is present.
>>>>>>
>>>>>> Signed-off-by: Clément Chigot <chigot@adacore.com>
>>>>>
>>>>> [...]
>>>>>
>>>>>> diff --git a/qapi/block-core.json b/qapi/block-core.json
>>>>>> index b82af74256..8a479ba090 100644
>>>>>> --- a/qapi/block-core.json
>>>>>> +++ b/qapi/block-core.json
>>>>>> @@ -3464,8 +3464,8 @@
>>>>>> #
>>>>>> # @fat-type: FAT type: 12, 16 or 32
>>>>>> #
>>>>>> -# @floppy: whether to export a floppy image (true) or partitioned hard
>>>>>> -# disk (false; default)
>>>>>> +# @floppy: whether to export a floppy image (true) or hard disk
>>>>>> +# (false; default)
>>>>>> #
>>>>>> # @label: set the volume label, limited to 11 bytes. FAT16 and FAT32
>>>>>> # traditionally have some restrictions on labels, which are
>>>>>> @@ -3474,11 +3474,15 @@
>>>>>> #
>>>>>> # @rw: whether to allow write operations (default: false)
>>>>>> #
>>>>>> +# @partitioned: whether a hard disk will be partitioned
>>>>>
>>>>> How does "partitioned" combine with "floppy": true?
>>>>>
>>>>> Is it silently ignored?
>>>>>
>>>>> Is it an error if present?
>>>>>
>>>>> Is it an error if true?
>>>>>
>>>>> Does it add a partition table if true?
>>>>>
>>>>>> +# (default: true)
>>>>>
>>>>> Hmm, this suggests it's silently ignored.
>>>>>
>>>>> Silently ignoring nonsensical configuration is usually a bad idea.
>>>>
>>>> True, but that would mean "unpartitioned" must always be passed when
>>>> "floppy" is requested. That would make such command lines a bit more
>>>> verbose, but otherwise I don't think there is any issue to that.
>>>>
>>>> Note that I didn't add "partition" as a keyword in the command line.
>>>> Currently, it's either the default (thus partitioned) or
>>>> "unpartitioned" being requested. Do you think it makes sense to add it
>>>> as well, even if it's redundant ?
>>>>
>>>>>> +# (since 10.2)
>>>>>> +#
>>>>>
>>>>> Not sure I like "partitioned". Is a disk with an MBR and a partition
>>>>> table contraining a single partition partitioned? Call it "mbr"?
>>>>
>>>> It used to be called "mbr/no-mbr" but Kevin suggested renaming it in
>>>> V1. Honestly I'm fine with both options:
>>>> - Technically, the option prevents MBR which has a side effect for
>>>> preventing partition tables
>>
>> Yes, because the partition table is part of the MBR. I'd rather name
>> the option after the entire thing it controls, not one of its parts.
>>
>>>> - Even it has a single partition, I think it makes sense to call a
>>>> disk "partitioned" as long as it has a partition table
>>>>
>>>> But I'm not that familiar with disk formats, etc. I'll let you decide
>>>> with Kevin, which one you prefer.
>>
>> Kevin is the maintainer, I just serve as advisor here.
>
> I figured that the meaning of "partitioned" is easier to understand for
> a casual user than having or not having an MBR ("I don't want to boot
> from this disk, why would I care about a boot record?").
>
> But if people think that "mbr" is better, that's fine with me.
I think partitioned is both inconvenient and not specific enough as there
could be other partitioning schemes.
> The only thing I really didn't want is the negative "no-mbr" and the
> double negation in "no-mbr=off" that comes with it.
Having mbr=true|false would be clear enough IMO so no need for the
negated version.
If we're already bikeshedding this I also thought fat-size may not be the
best name as I think about 12,16,32 as fat-size so maybe it could be
called vfat-size or similar. But why can't it just be size and when
specified for raw vfat would use the same size (so raw truncates image to
size and only that part is used by vfat like we have a larger disk with an
MBR set to smaller size with unused space at the end) and when size is
specified for vvfat it would error out if the underlying raw image does
not match that size? Then no need for a separate option but I don't know
if there's a problem with getting raw size from vvfat to check this or if
that could be solved.
Regards,
BALATON Zoltan
>>> I'd also vote for mbr or similar shorter name; unpartitioned is
>>> awkward to type out in a command line. Maybe it can default to false
>>> for floppy and true for disk to preserve current behaviour but allow
>>> controlling it.
>>
>> I'm not a fan of conditional defaults, but I think it's better than a
>> nonsensical default that gets ignored.
>
> I think in this case a conditional default makes sense, not only for
> compatibility reasons. Hard disks almost always have a partition, floppy
> disks with partitions are basically unheard of.
>
> Kevin
© 2016 - 2025 Red Hat, Inc.