Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Saturday, September 15, 2018 10:29 AM | 1 vote
A USB stick has a GPT partition table and several partitions. The first partition is a FAT32 Microsoft basic data partition, which has always worked fine and still works fine. Windows used to see only the first partition, which was great.
Something changed. Now when the USB stick is inserted, Windows asks if the user wants to format all their Linux partitions. Of course it's easy to know that the answer is no, but it's also easy to make mistakes which lose all the data, and it's also easy for users to complain that they have to answer a bunch of popups. Also it's easy for the Computer Management utility (mmc.exe) to confuse itself and stop responding.
Each partition in a GPT table has a partition type and some attribute bits. Windows should see partition type 0FC63DAF-8483-4772-8E79-3D69D8477DE4 and avoid asking if the user wants to format it. Windows should see the attribute bit for "hidden" and avoid asking if the user wants to format it. Windows should see the attribute bit for "don't automatically assign a drive letter" and avoid asking if the user wants to format it.
But no, this is Windows. Windows assigns drive letters to all the "hidden" "don't automatically assign a drive letter" Linux partitions, and Windows asks the user for each partition if the user wants to format it.
Is there anything that can be set in the partition attributes to make Windows shut up and just ignore the partitions that it's supposed to ignore?
To clarify, I want to set these partitions (except the first one) so that every Windows system on the planet will stop asking the unwanted questions. If I make some setting in the registry of my Windows PC, that might fix my PC but it won't stop other users from getting the unwanted questions from their Windows PCs.
All replies (20)
Monday, September 17, 2018 12:24 AM ✅Answered | 1 vote
SOLVED, for the moment.
I have to set my Linux partitions to type code EBD0A0A2-B9E5-4433-87C0-68B6B72699C7, Microsoft basic data partition.
Linux does not care. When I tell Linux to mount the partitions, Linux sees the ISO9660 file system in one partition and the ext4 file system in the other partition. I haven't fully tested them yet but I think Linux handles them properly.
Windows finally obeys. Windows sees them as Microsoft basic data partitions, but Windows sees the attribute bits 0xC000000000000001 and finally Windows obeys the bits. Windoes doesn't assign drive letters and Windows doesn't try to trick the user into formatting and losing the contents.
Now that this solution is known, I wonder how long Microsoft will take to break it.
Sunday, September 16, 2018 2:20 AM
"To clarify, I want to set these partitions (except the first one) so that every Windows system on the planet will stop asking the unwanted questions. If I make some setting in the registry of my Windows PC, that might fix my PC but it won't stop other users from getting the unwanted questions from their Windows PCs."
'Use MiniTool partition wizard it is better and tutorial'
It is better than what?
On one Windows 10 PC, it removed one drive letter from one Linux partition. It could not remove the other drive letter from the other Linux partition. Windows 10 still wanted to format the partition that still had a drive letter.
I moved the USB stick to a different Windows 10 PC. On that PC, Windows 10 still assigned drive letters to both Linux partitions and wanted to format both Linux partitions.
I think MiniTool Partition Wizard did not set any attribute bits in the partitions of the USB stick itself. I think this tool does not know how to set partition attributes to make Windows shut up and just ignore the "hidden" "don't automatically assign a drive letter" Linux partitions.
MiniTool Partition Wizard looks like a useful program for some users but it has no relationship with my question.
Sunday, September 16, 2018 4:48 AM
A screenshot of an unwanted question from Windows 10 trying to format a partition which is used by Linux, not intended to get used by Windows, and makes it too easy for a user to delete all the files in the partition when they don't want to do so:
http://www.geocities.jp/hitotsubishi/screenshots/unwanted-question-about-formatting.png
A screenshot of MiniTool Partition Wizard:
http://www.geocities.jp/hitotsubishi/screenshots/unwanted-drive-letters.png
Partition Wizard is capable of hiding partition F from Windows on the PC where Partition Wizard is executing, by removing the drive letter from the partition in this PC's registry. But Partition Wizard doesn't set attribute bits in the partition table in the USB stick, so when the USB stick is moved to another PC, Windows assigns drive letters to two partitions, E and F, and tries to make the user lose all the files in both partitions.
Partition Wizard is incapable of hiding partition E from Windows even on the PC where Partition Wizard is executing. If the USB stick is reinserted in this PC, Windows assigns drive letter E again and tries to make the user lose all the files in one partition.
'I don't know what you mean'
No kidding. Here, for the third time:
"To clarify, I want to set these partitions (except the first one) so that every Windows system on the planet will stop asking the unwanted questions. If I make some setting in the registry of my Windows PC, that might fix my PC but it won't stop other users from getting the unwanted questions from their Windows PCs."
Windows used to be quite happy just presenting the first partition to the user, i.e. drive letter D, and keep its damn dirty paws off of the Linux data partitions. I want to set the Linux partitions so that Windows will ignore them instead of disturbing the user and trying to persuade the user to lose their data.
Sunday, September 16, 2018 6:22 AM
>http://www.geocities.jp/hitotsubishi/screenshots/unwanted-question-about-formatting.png
"This is normal if your partition is not recognized by windows."
馬鹿。 No kidding. But it's NOT SUPPOSED TO BE normal when the partition's attribute bits include the HIDDEN bit and the partition type is one that is supposed to contain data (a Linux partition) which Windows shouldn't try to destroy.
"just click on cancel and it is better to let windows pop that message."
Again. You need help reading my first message in this thread? Here, I'll try again:
'Something changed. Now when the USB stick is inserted, Windows asks if the user wants to format all their Linux partitions. Of course it's easy to know that the answer is no, but it's also easy to make mistakes which lose all the data, and it's also easy for users to complain that they have to answer a bunch of popups.'
Maybe your level of English skill is the same as my level of Japanese skill. If you can't understand this, keep out of the way of people who do.
"If you buy the full version you will be able to do everything you want."
Pardon me while I disbelieve you.
"You can use disk management to remove the partition drive letter that will hide it from Windows."
No, Windows 10's built-in Disk Manager is incapable of removing both of those unwanted drive letters. Your tool could remove one of them, so you're better than Windows, but not good enough. Besides, it STILL doesn't mark the partition to prevent OTHER Windows 10 PCs from still trying to trick the user into losing data. HERE, YOU NEED THIS A FOURTH TIME:
'To clarify, I want to set these partitions (except the first one) so that every Windows system on the planet will stop asking the unwanted questions. If I make some setting in the registry of my Windows PC, that might fix my PC but it won't stop other users from getting the unwanted questions from their Windows PCs.'
大馬鹿。
Now, anyone who understands this problem, does anyone know how to solve it? Assigning a Linux partition type and setting the HIDDEN bit isn't enough to make Windows listen. Does anyone know what further settings to make to the partition structure in the device?
Sunday, September 16, 2018 7:08 AM
Now, anyone who understands this problem, does anyone know how to solve it? Assigning a Linux partition type and setting the HIDDEN bit isn't enough to make Windows listen. Does anyone know what further settings to make to the partition structure in the device?
You said in your OP that something changed. It seems from your other comments that this may be in the partition table of the USB drive but I cannot see anywhere that you have inspected the table. The only way to find out and fix is to manually edit the partition table on the USB drive. Programs like Partition Table Doctor are mostly used to automatically fix a broken drive but many have a manual mode which lets you change each parameter individually. You seem to know the bit that may need changing so it should be relatively simple to check and change it if necessary.
Sunday, September 16, 2018 7:20 AM
Another idea.
Take a spare USB stick and from Linux wipe it, create two new partitions (FAT32 and ext3 or whatever you prefer for Linux), rebuild the partition table. Then try it in a Windows 10 PC and see what happens.
Sunday, September 16, 2018 7:29 AM
"You said in your OP that something changed. It seems from your other comments that this may be in the partition table of the USB drive"
No, something changed in Windows. Windows used to ignore all except the first partition in a USB stick. From internet searches, I get the impression that Windows changed in Windows 10 version 1703, starting to become aware of other partitions besides the first.
"but I cannot see anywhere that you have inspected the table."
If you will really help, I will try to connect the USB stick to a virtual PC and capture screenshots from the host Windows PC, so that you can see Linux commands in the virtual PC. It isn't obvious if this will work because I have to plug the USB stick into the host Windows PC and Windows will get all confused again before I can tell VMware to connect the USB stick to the guest PC.
Meanwhile, please be aware that the gdisk command is really easy to use, the sgdisk command is hard to use but powerful (and convenient in scripting where I will want to put the commands), and I could set and view the partition type (0FC63DAF-8483-4772-8E79-3D69D8477DE4 and I also tried other tyes used for Linux partitions); and I could set and view the HIDDEN bit, bit 63 in the attributes, 0x8000000000000000 in the bitmask.
"The only way to find out and fix is to manually edit the partition table on the USB drive."
Yes, perfect. Now, which bit should I set in the attributes since Windows is ignoring the HIDDEN bit, and what partition type should I use so that Windows will stop asking the user to format it?
"You seem to know the bit that may need changing"
Well, I know which bit is SUPPOSED TO need changing. Microsoft says it in
and probably other places. But my reason for asking the question is that I don't know which bit will REALLY WORK, or which partition type will work.
Sunday, September 16, 2018 7:31 AM
"Take a spare USB stick and from Linux wipe it, create two new partitions (FAT32 and ext3 or whatever you prefer for Linux), rebuild the partition table. Then try it in a Windows 10 PC and see what happens."
That's exactly what I did. Then I did some Google searches trying to find out how to make Windows behave, and then I posted my question that originated this thread.
Sunday, September 16, 2018 8:05 AM
Here's the Windows 10 version of the gpt command, which was harder to find, missing from the table of contents in the documents:
https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/gpt
Belatedly I noticed that Microsoft has its own HIDDEN bit besides the standard GPT hidden flag. I set it (bit 62, 0x4000000000000000 in the bitmask. It still didn't help. I inserted the USB stick into a PC running Japanese Windows 10 (because someone else was using the other PC that has Windows in English). Windows 10 still assigned drive letters and wanted to format the two Linux partitions.
In Windows, the gpt command can display the attributes bits. As mentioned this is in Japanese, but I think you'll be able to recognize the attributes string:
http://www.geocities.jp/hitotsubishi/screenshots/attributes-ignored-by-windows.png
Sunday, September 16, 2018 10:01 AM
Microsoft says that Windows ignores those two partitions:
https://docs.microsoft.com/en-us/previous-versions/windows/hardware/design/dn640535(v=vs.85)
"The preferred option is for system manufacturers to place value-add contents in an OEM-specific partition. Just like MBR OEM partitions, the contents of GPT OEM (or other unrecognized) partitions are not exposed (given drive letters or returned in volume lists). Users are warned that deleting the partition can cause the system to fail to operate."
I still need to find out how to mark the partitions to obtain that behaviour.
Sunday, September 16, 2018 10:35 PM
Now that Microsoft's forums display timestamps as variables instead of constants, these timestamps will no longer be accurate when you read this, but this is how Microsoft is displaying them now.
"Meanwhile, please be aware that the gdisk command is really easy to use, the sgdisk command is hard to use but powerful (and convenient in scripting where I will want to put the commands), and I could set and view the partition type (0FC63DAF-8483-4772-8E79-3D69D8477DE4 and I also tried other tyes used for Linux partitions); and I could set and view the HIDDEN bit, bit 63 in the attributes, 0x8000000000000000 in the bitmask.
14 hours 42 minutes ago Norman Diamond"
'Please follow this link and I would like to add this other link about sgdisk utility then windows users can be able to follow you.
7 hours 34 minutes ago mominta from Calgary'
Do you think I know about the sgdisk utility? 馬鹿。
The other link you gave is:
https://askubuntu.com/questions/959522/prevent-windows-10-from-formatting-ext4-partition-on-pendrive
Yes, that is one of the pages that I found in Google searches before starting this thread. How much of that page did you read?
"I used to create two partitions on pendrives that would be used either on Windows or GNU/Linux.
The first partition I'd format with ntfs, the second one with ext4. This way Windows would not see the second partition and would not ask to format when plugged in.
Since one of the last updates to Windows 10, this trick does not work anymore.
[...]
I have tried to hide the second partition with parted, but I don't find the right switch.
What should I do in order to hide/protect the ext4 partition on the pendrive from Windows 10?"
'It seems Microsoft is really trying hard to make it difficult for linux.'
etc.
Now, later in that page there are suggestions to use UDF.
". The problem is that Windows 10 has changed from ignoring a second partition with the linux ext4 file system to prompting the user the format it.
. Windows 10 does not prompt the user to format UDF, the Universal Disk Format."
'My UDF flash drive seems to work in Windows10 but has not been visible in Ubuntu since was first created?'
"Creating the partition in Linux would not automount it when plugging in the device, so I opted to format it in Windwos with "format <driveLetter>: /fs:UDF /q" which automounted automaticcaly in Manjaro and Ubuntu."
I'm creating these partitions while Linux is running, i.e. when the USB stick is not connected to a Windows PC and cannot be formatted using Windows. Besides, I want to PREVENT Windows from assigning drive letters to the Linux partitions when the USB stick gets moved to a Windows PC. The first partition is FAT32 because that's the one that should be seen by Windows and should let the user read the files that the Linux system writes to the FAT32 partition.
Now as mentioned before, it looks like MiniTool Partition Wizard is a useful tool for some people in some situations, it just doesn't have any relationship to what I need to do, some way to mark the partition in the USB stick before the user moves the USB stick to a Windows PC. I'm a bit curious, since MiniTool's web site looks like a Japanese company but the offices are in Vancouver and Hong Kong (in high rent districts too) but none in Japan (which has had around 25 years of deflation). I bet MiniTool could add functionality to do the same as sgdisk does, but it wouldn't solve the problem. Windows is attacking where even Microsoft says Windows doesn't attack.
Monday, September 17, 2018 1:43 AM
>Windows finally obeys
Ok then it was not a windows issue but Linux issue because you have to set Linux partitions to type code EBD0A0A2-B9E5-4433-87C0-68B6B72699C7.
Momominta
This time you know you're lying. Several gpt partition types are defined for Linux, and when Linux uses them properly, Windows attacks them. When I have to use Linux tools to tell lies, to use a partition type that is defined for Windows, to defend Linux filesystems from attacks by Windows, it is a Windows issue. Even though a way can be found for Linux to defend against Windows's malice, the issue is a Windows issue.
Monday, September 17, 2018 3:37 AM
Ok let say you did not know how to setup the partition with Linux before seeing the solution you provided. But windows is not the issue we all know that only you wouldn't accept the fact. Read again the link I have provided above.
Momominta
ば~~か~~や~~ろう~~~~~~~~~。
I did not know how to setup the partition (regardless of which OS is setting it up) before DISCOVERING the solution I provided. Trial and error is not the best way. It would be better if Microsoft obeyed their own documentation.
WINDOWS IS THE ISSUE.
https://docs.microsoft.com/en-us/previous-versions/windows/hardware/design/dn640535(v=vs.85)
"The preferred option is for system manufacturers to place value-add contents in an OEM-specific partition. Just like MBR OEM partitions, the contents of GPT OEM (or other unrecognized) partitions are not exposed (given drive letters or returned in volume lists)."
Oh wait, I already quoted that before.
https://docs.microsoft.com/ja-jp/previous-versions/windows/hardware/design/dn640535(v=vs.85)
Still English. Sorry, I can't help you.
Monday, September 17, 2018 4:53 AM
Well in this article you pointed out, nowhere they compare windows and linux partition. By the way have a great week and thank you for using Windows.
Momominta
Here's an article discussing partition types for Windows, Linux, and others. It's not a Microsoft site so you won't trust it.
https://en.wikipedia.org/wiki/GUID_Partition_Table
Monday, September 17, 2018 1:58 PM
Hi,
I’m so glad that your issue has been solved.
As always, if there is any issue in future, we warmly welcome you to post in this forum again. We are happy to assist you!
Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact [email protected].
Monday, September 17, 2018 8:54 PM | 1 vote
A final word for any readers who having reached this point in the thread are somewhat confused by all the excitement.
The "partition not formatted" issue noted by the OP is not new and is not the result of some sort of anti Linux plot by Microsoft. There is a very readable explanation dating from 2012 to be found here: http://www.rodsbooks.com/linux-fs-code/
In a nutshell, to quote from the above article:
The Microsoft Basic Datatype code (EBD0A0A2-B9E5-4433-87C0-68B6B72699C7) identifies a filesystem that Windows can understand, such as FAT or NTFS. Unfortunately, for years Linux has used this same type code to identify its filesystem partitions on GPT disks; however, Windows can't read Linux filesystems without extra drivers. This means that Windows shows Linux filesystem partitions as unformatted disks in its file manager, and if you attempt to access one, Windows asks you if you want to format it.
As pointed out in the same article, MBR drives are not affected by this, only GPT. This is one reason why some Windows users report the "partition not formatted" issue with a USB disk or stick which has been used with Linux whilst others do not. Also some Linux distributions now adopt a different type code (since it is not used anyway by Linux).
For information of any dual Linux/Windows users who are experiencing this problem, the article above also describes a utility to change the type code of their partitions and avoid the conflict.
Tuesday, September 18, 2018 11:32 PM
Misar1946 also lied.
The problem is that when I DID use Linux partition type codes and set attribute bits to hide and not mount, Windows tried to trick the user into formatting the partitions and losing all their data.
The solution is that when I set the Linux partitions to the Microsoft Basic Data type code and again set attribute bits to hide and not mount, Windows finally obeyed the attribute bits.
In order to persuade Windows to obey, you have to do the exact opposite of what Microsoft's documents say to do.
Rod's document appears to have been written before Microsoft worsened things in Windows 10, I think in version 1703. Windows used to ignore partitions other than the first (on USB sticks not on hard drives). If the user tried to access the first partition and it was a Linux partition then Windows would ask to format when the user tried to access it, but now Microsoft is in full attack mode and Windows asks to format ever partition as soon as the user inserts the USB stick.
Thursday, January 10, 2019 7:26 AM | 1 vote
This is normal if your partition is not recognized by windows. just click on cancel and it is better to let windows pop up that message.
Momominta
No, this problem has existed for a very long time and appears to affect any unrecognized partitions, even those NOT formatted by or associated with Linux. It also occurs with TrueCrypt/VeraCrypt partitions/drives and the problem is not the pop up; the problem is the default selection of that pop up.
Imagine the catastrophe that occurs if a user is typing into a Word document and then plugs in a VeraCrypt-encrypted USB drive in order to save or transfer the file. The popup comes up and the user, who may still be editing the file, presses [Enter] as a normal paragraph break, thus formatting the drive and likely wiping ALL of its data. This is not theoretical, as it has happened to me on multiple occasions over many years, though I have always managed to stop the process before data was lost.
(Yes, I'm aware of how to stop Windows from requesting a format by removing the drive letter in the drive management window, but the issue can still occur on different machines and for newly-created volumes.)
Under NO circumstance would any sane developer design such a popup, which obviously steals focus in Windows regardless of user behavior, default to "Format" so that user input can easily start the format process. Any window asking to format a disk should focus "Cancel" as the default, even if the user manually chose to format that drive.
I personally don't think that such a popup should be allowed to take focus from user programs, but that's not really the problem as Windows offers no controls for focus-stealing permissions.
Setting "Format" as the default action for that popup has to be one of the most asinine and unjustifiable decisions I've seen within the Windows GUI and is downright dangerous. Linux is generally careful to deploy drive modification actions only after user confirmation and sometimes requires two user confirmations. The "Format" action should ALWAYS be the non-default option.
This situation persists regardless of partition type conflicts and the default action of this popup should be considered a bug in Windows.
Thanks for reading.
Friday, February 14, 2020 6:47 PM
Under NO circumstance would any sane developer design such a popup, which obviously steals focus in Windows regardless of user behavior, default to "Format" so that user input can easily start the format process. Any window asking to format a disk should focus "Cancel" as the default, even if the user manually chose to format that drive.
Absolutely right. I have a server with perhaps a dozen iSCSI LUNs plumbed into it, a total of 300TB of data that it dynamically mounts snapshots and volumes for backup purposes. As backups happen, its mounting / unmounting the disk devices, so perhaps hundreds of these a night. Every time I go to the server's console I get 7000 pending "You need to format the disk in drive" popups, any one of which is a potential fricken disaster.
And as you say, since its convinced there is no data there, it just merrily destroys everything without an "Are your really, really sure" It like putting the proverbial detonator in a cage full of squirrels.
It truly is the stupidest design possible. Is it to much to ask for a dialog with 7000 instances "Never show this ever again!" checkbox or a reg key "AvoidContinuouslyPromptingUserToDelete300TBOfData = 0x00000001"
-- Bob
Sunday, February 16, 2020 10:29 PM
@Bob: +1, even though all I have is a MicroSD card with two partitions (Ext4/Swap) of Linux on it, and one NTFS for a dual boot scenario. The two Linux are assigned drive letters, and so far, I cannot find a way to "un-assign" these drive letters, both Diskpart and DM MMC have no visibility into the drive letters assigned by the OS earlier and then hidden (F:/G:). And this disk shows as MBR, so not sure if the workaround above will do anything. Guess we just live with it, but very high on the "wonk" meter, to be sure. Even in 2015, when EFI was beginning to replace MBR, and W10 was young, I'm sure nobody in Redmond foresaw a 1TB SD card or USB stick with 5-7 OSes on it. :)
http://www.rodsbooks.com/linux-fs-code/ gave a good bit of clarity to me FWIW on what the issue really is, not clear there is a solution, although I plan to try his approach of using gparted since my Linux version (ubuntu 18.04) is pretty recent. Easy enough to blame Linux, but Microsoft has been saying (since W7 even?) that anything we can't read should get a drive letter first, then offer up a quick format so we can read the nothingness that ensues :).
Found a "solution" https://sourceforge.net/projects/ext2fsd/ which at least hides unrecognized ext2/3/4 and prevents Windows from assigning a drive letter to an alien drive, and worked on swap partition also. Half the battle IMHO!
--Alex