1

I dual boot Windows and Ubuntu, and I recently decided to experiment with gaming on Linux. It works quite well for most of the games I try. However, for some reason, some of the games demand to be on an NTFS file system. This wouldn't be a problem, except Windows automatically mounts all NTFS file systems it sees and won't let them go without turning off hibernate.

I don't want Windows to see or touch the partition, but I do have another partition on the same drive that Windows has to see. Is there a way I can get Windows to ignore a specific partition?

7
  • I should note that I managed to stop Windows from assigning it a drive letter and stop the user from being able to see it, but Windows is still mounting it, so Ubuntu can't mount it.
    – Zarquan
    Commented Aug 10, 2019 at 15:36
  • Mac & nix use fstab which Win doesn't seem to have an equivalent of - maybe this could be useful for ref… superuser.com/questions/338969/etc-fstab-equivalent-in-windows
    – Tetsujin
    Commented Aug 10, 2019 at 15:42
  • Is the partition on a GPT disk? Commented Aug 10, 2019 at 15:53
  • The partition is on a GPT disk
    – Zarquan
    Commented Aug 10, 2019 at 16:09
  • 1
    @Tetsujin I did the same thing.
    – Zarquan
    Commented Aug 10, 2019 at 17:17

1 Answer 1

2

The fstab equivalent on Windows is the "Mount Manager", which you control via DiskMgmt.msc, or DISKPART, or the MOUNTVOL command.

It may be enough to remove the drive letter, either via DiskMgmt.msc, or using remove within DISKPART. Additionally you can set the GPT attribute field to "No automount" (bit 63) to prevent the partition from ever automatically receiving a drive letter.

If that still doesn't help, set the GPT attribute "Hidden" (bit 62) to make the Mount Manager completely ignore this partition, and/or "Read-only" (bit 60) to tell Windows it should be read-only.

If that doesn't help, change the partition's GPT type GUID to something else than "Microsoft Basic Data". For example, use one of the Linux partition types.

(All of the above are completely ignored by Linux and will not prevent you from using the partition.)

Windows (DiskPart)

  1. Use list disk and sel disk <num> to select the physical disk.
  2. Use list part and sel part <num> to select the partition you want to change.
  3. Use remove to unassign the current drive letter.
  4. Set GPT attributes to "Hidden" using gpt attributes=0x4000000000000000.

    • No automount = 0x8000000000000000
    • Hidden = 0x4000000000000000
    • Read-only = 0x1000000000000000
    • all of the above = 0xD000000000000000

Linux (sfdisk)

sfdisk takes a comma-separated list of bits to set:

sfdisk --part-attrs /dev/sda <partnum> 63

For "Microsoft Basic Data" partitions, bit 63 is "No GPTautomount"; bit 62 is "Hidden"; bit 60 is "Read-only".

Linux (gdisk)

Run gdisk /dev/sda.

  • To change partition type GUID: Use t and choose whatever type looks least Windows-friendly.

  • To change partition flags: Use x to enter "Expert" menu, then a to select "Set attributes". Enter partition number and enable bits 60/62/63. Afterwards use m to return to the main menu.

Don't forget to use w to write the updated partition table.

2
  • The DiskPart worked like a charm! I have a hibernated Windows and Linux can mount the drive. Thanks!
    – Zarquan
    Commented Aug 11, 2019 at 0:03
  • Actually, it only worked for one day. Now it doesn't seem to be working anymore, and I am getting messages about it being a mounted partition again.
    – Zarquan
    Commented Aug 12, 2019 at 18:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .