2014年3月26日 星期三

Hide GPT partitions from Windows

You want to hide Linux GPT partitions from Windows.

Under Ubuntu:
1. Install GPT tool : gdisk
> sudo apt-get install gdisk

2. Set interested GPT partition attributes to Windows hide and no automount:
> sudo sgdisk -A <part>:set:62 <disk>
> sudo sgdisk -A <part>:set:63 <disk>
(62: hide ; 63: no automount)

As a note, use "-A <part>:clear:<attribute_bit_pos>" to clear a attribute bit.

robert$ sudo sgdisk /dev/sdc -A 5:set:62
The operation has completed successfully.

robert$ sudo sgdisk /dev/sdc -A 5:set:63
The operation has completed successfully.

3. Print the partition#<part> attributes:
> sudo sgdisk -A <part>show <disk>

robert$ sudo sgdisk -A 5:show /dev/sda
5:62:1 (hidden)
5:63:1 (do not automount)