Skip to content

Instantly share code, notes, and snippets.

@swyngaard
Last active October 16, 2017 16:45
Show Gist options
  • Save swyngaard/eb5f88e09baa1fbe08fd36db6b20cb76 to your computer and use it in GitHub Desktop.
Save swyngaard/eb5f88e09baa1fbe08fd36db6b20cb76 to your computer and use it in GitHub Desktop.
Hide unused Windows partitions when under Linux

Find the UUID of the paritions by running the following command:

sudo blkid

Output from the above command will look similar to the following:

/dev/nvme0n1p1: LABEL="SYSTEM" UUID="9403-16A5" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="02ea9cd5-3978-4c4f-a4ea-b51d9c7ffc37"
/dev/nvme0n1p3: LABEL="Windows" UUID="FC82088E82084F96" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="d66e2825-09c8-4c99-b529-77068113c88c"
/dev/nvme0n1p4: LABEL="WinRE_DRV" UUID="A6E808F4E808C491" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="fd5ff108-9a06-4a2a-a7f4-e74e583a0f3c"
/dev/nvme0n1p5: UUID="1801f4f8-7d90-4d70-b3a3-5d4344a22d6a" TYPE="ext4" PARTUUID="98df8734-8cd9-40db-9300-cba481198c42"
/dev/nvme0n1p6: UUID="5571c190-0f93-42e6-883e-3422aa5cb00e" TYPE="swap" PARTUUID="23ee6ed8-e1f4-4fa1-ab6b-b09513041535"
/dev/nvme0n1: PTUUID="0a14f148-1a11-49d5-996e-0335843a53df" PTTYPE="gpt"
/dev/nvme0n1p2: PARTLABEL="Microsoft reserved partition" PARTUUID="8a23a917-ac9c-4fd6-a0ba-f4abec08a655"

To hide any partitions you have identified add a line for every corresponding UUID to /etc/fstab as follows:

UUID=FC82088E82084F96    none    ntfs    noauto,umask=222    0    0
UUID=A6E808F4E808C491    none    ntfs    noauto,umask=222    0    0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment