Solution
As @sudodus has stated correctly:
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.
At the same time, it seems like your standard Windows computer ships with hidden partitions (efi, recovery, ...) by default, so there is definitely some way to mark a partition such that Windows ignores it. Here is what worked for me:
- Create a GPT partition table.
- Set the partition type of your Linux partitions to "Microsoft basic data".
- Add the "hidden" attribute to that partition (as suggested here).
You can do steps two and three in any order, but step two seems to be necessary. From the looks of it, Microsoft chose to ignore attributes on partitions with non-Microsoft partition types.
Commands (using gdisk)
This is how you would partition an empty disk at /dev/sdb
with two partitions. Partition one will be visible to Windows, partition two will be hidden. Note that these are instructions to format the disk. You will loose all data you had previously stored on this particular device.
$ sudo gdisk /dev/sdb # You might want to use a different disk
GPT fdisk (gdisk) version 1.0.8
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Command (? for help): o
This option deletes all partitions and creates a new protective MBR.
Proceed? (Y/N): y
Command (? for help): n
Partition number (1-128, default 1):
First sector (34-123404254, default = 2048) or {+-}size{KMGTP}:
Last sector (2048-123404254, default = 123404254) or {+-}size{KMGTP}: +30G
Current type is 8300 (Linux filesystem)
Hex code or GUID (L to show codes, Enter = 8300): 0700
Changed type of partition to 'Microsoft basic data'
Command (? for help): n
Partition number (2-128, default 2):
First sector (34-123404254, default = 62916608) or {+-}size{KMGTP}:
Last sector (62916608-123404254, default = 123404254) or {+-}size{KMGTP}:
Current type is 8300 (Linux filesystem)
Hex code or GUID (L to show codes, Enter = 8300): 0700
Changed type of partition to 'Microsoft basic data'
Command (? for help): x
Expert command (? for help): a
Partition number (1-2): 2
Known attributes are:
0: system partition
1: hide from EFI
2: legacy BIOS bootable
60: read-only
62: hidden
63: do not automount
Attribute value is 0000000000000000. Set fields are:
No fields set
Toggle which attribute field (0-63, 64 or <Enter> to exit): 62
Have enabled the 'hidden' attribute.
Attribute value is 4000000000000000. Set fields are:
62 (hidden)
Toggle which attribute field (0-63, 64 or <Enter> to exit):
Expert command (? for help): w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/sdb.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
ext4
(or some other linux file system)? Do you need to preserve links or permissions? Maybe it would work withUDF
? You can try according to this link, http://tanguy.ortolo.eu/blog/article93/usb-udf -- an alternative would be to use USB drive with a mechanical switch (microswitch) to make it read-only. – sudodus Sep 26 '17 at 08:39UDF
is accepted by Windows (no prompting to format), and it is possible to modify and store linux style permissions. I was testing it a couple of minutes ago. – sudodus Sep 26 '17 at 09:08/mnt/lp1
, which means that you and an end user can read and write files and directories, just like an ext4 file system in a partition. But Windows does not prompt the user the format it. -- This is described as item 2 at the end of my answer. – sudodus Sep 26 '17 at 18:01