[prev in list] [next in list] [prev in thread] [next in thread] 

List:       grub-devel
Subject:    Re: workaround for MS Windows' insanity (ignores partition types / hidden flag since 2018)
From:       "Vladimir 'phcoder' Serbinenko" <phcoder () gmail ! com>
Date:       2019-11-14 1:49:47
Message-ID: CAEaD8JNSwbB-W+w=ug+PFqVs61ObNWXs68zLCbJ+1NP-63X_uA () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Wed, 13 Nov 2019, 17:12 Marcel Partap, <mpartap@gmx.net> wrote:

> Dear grub devs,
> as we have just last week released a hundred of our debian-based
> https://github.com/fsfw-dresden/usb-live-linux/ sticks .. and at the
> moment are rolling out a version for primary schools, I have stumbled over
> the pure stupidity that is Windows 10's handling of partitioned usb drives.
> As seems abundantly documented, windows changed its behaviour sometime last
> year and now blatantly ignores the hidden flag, displaying partitions
> regardless of type and prominently offering to format non-windows
> filesystems. I was somewhat shocked at this ridiculous demeanour.. After an
> hour of investigating this I found the very sole workaround was to set the
> partition type to 0 - empty/none. This was the only way to windows not show
> and offer to format partitions beyond the exchange FAT partition.
> Rejoicing, on restart I found out that grub would not proceed booting from
> a partition of type "empty". Now semantically, that is totally correct.
> However, in order to provide us with a coping mechanism for such live linux
> use scenarios, I propose to add a flag that overrides this code:
> >   static inline int
> >   grub_msdos_partition_is_empty (int type)
> >   {
> >     return (type == GRUB_PC_PARTITION_TYPE_NONE);
> >   }
> to allow booting from partitions of type 0 empty/none.
>
Type 0 means that entry is empty and changing this is to expose bunch of
garbage partition and this is behavior followed by other consumers like
Linux and BSD.
However we can assist you in finding a better solution. Did you already
consider alternative partition maps? I'd try msdos+gpt or msdos+BSD or
msdos+sunpc. Dinner other schemes might also work. Another workaround is to
put some fake FAT structures that will end up as showing as a FS. You can
even put some explanation files there

> This should cause less confusion to the hundreds of young students atm
> wondering about "what the hell is formatting" ..
>
> Best Regards,
> #marcel
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
>

[Attachment #5 (text/html)]

<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" \
class="gmail_attr">On Wed, 13 Nov 2019, 17:12 Marcel Partap, &lt;<a \
href="mailto:mpartap@gmx.net">mpartap@gmx.net</a>&gt; wrote:<br></div><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">Dear grub devs,<br> as we have just last week released a \
hundred of our debian-based <a href="https://github.com/fsfw-dresden/usb-live-linux/" \
rel="noreferrer noreferrer" \
target="_blank">https://github.com/fsfw-dresden/usb-live-linux/</a> sticks .. and at \
the moment are rolling out a version for primary schools, I have stumbled over the \
pure stupidity that is Windows 10&#39;s handling of partitioned usb drives. As seems \
abundantly documented, windows changed its behaviour sometime last year and now \
blatantly ignores the hidden flag, displaying partitions regardless of type and \
prominently offering to format non-windows filesystems. I was somewhat shocked at \
this ridiculous demeanour.. After an hour of investigating this I found the very sole \
workaround was to set the partition type to 0 - empty/none. This was the only way to \
windows not show and offer to format partitions beyond the exchange FAT partition. \
Rejoicing, on restart I found out that grub would not proceed booting from a \
partition of type &quot;empty&quot;. Now semantically, that is totally correct. \
However, in order to provide us with a coping mechanism for such live linux use \
scenarios, I propose to add a flag that overrides this code:<br> &gt;     static \
inline int<br> &gt;     grub_msdos_partition_is_empty (int type)<br>
&gt;     {<br>
&gt;        return (type == GRUB_PC_PARTITION_TYPE_NONE);<br>
&gt;     }<br>
to allow booting from partitions of type 0 \
empty/none.<br></blockquote></div></div><div dir="auto">Type 0 means that entry is \
empty and changing this is to expose bunch of garbage partition and this is behavior \
followed by other consumers like Linux and BSD.  </div><div dir="auto">However we can \
assist you in finding a better solution. Did you already consider alternative \
partition maps? I&#39;d try msdos+gpt or msdos+BSD or msdos+sunpc. Dinner other \
schemes might also work. Another workaround is to put some fake FAT structures that \
will end up as showing as a FS. You can even put some explanation files \
there</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" \
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> This should \
cause less confusion to the hundreds of young students atm wondering about &quot;what \
the hell is formatting&quot; ..<br> <br>
Best Regards,<br>
#marcel<br>
_______________________________________________<br>
Grub-devel mailing list<br>
<a href="mailto:Grub-devel@gnu.org" target="_blank" \
rel="noreferrer">Grub-devel@gnu.org</a><br> <a \
href="https://lists.gnu.org/mailman/listinfo/grub-devel" rel="noreferrer noreferrer" \
target="_blank">https://lists.gnu.org/mailman/listinfo/grub-devel</a><br> \
</blockquote></div></div></div>


[Attachment #6 (text/plain)]

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic