Mounting gpt partitions on Raspberry Pi

I was pretty excited when I received my Raspberry Pi last week as a replacement for my aging Tonidoplug V1 since due to its lack of support to the newest OS distributions (other than ArchLinux, which I am not too familiar with).

I am using 3.6.11+ Linux, which at the time of writing is the latest Raspbian (Raspberry Pi + Debian) “wheezy” image that is available online.

 cat /proc/version
Linux version 3.6.11+ (dc4@dc4-arm-01) (gcc version 4.7.2 20120731 (prerelease) (crosstool-NG linaro-1.13.1+bzr2458 - Linaro GCC 2012.08) ) #456 PREEMPT Mon May 20 17:42:15 BST 2013

You can always download the latest version of the Raspbian image here.

For storage, I used an old Drobo with four WD Red 3TB drives. Thanks to thin provision in Drobo, I was able to create two 8TB partitions to store my data. As my Drobo has crashed recently, I had to format it with the Drobo tools program to create the partitions.

Raspberry Pi was able to detect partitions using fdisk, however with a warning message:

Disk /dev/sda: 8796.1 GB, 8796093022208 bytes
256 heads, 63 sectors/track, 1065220 cylinders, total 17179869184 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1  4294967295  2147483647+  ee  GPT

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.

Disk /dev/sdb: 8796.1 GB, 8796093022208 bytes
256 heads, 63 sectors/track, 1065220 cylinders, total 17179869184 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1  4294967295  2147483647+  ee  GPT

When I simply tried to use mount, it does not quite work:

mount /dev/sdb /media/Data/
NTFS signature is missing.
Failed to mount '/dev/sdb': Invalid argument
The device '/dev/sdb' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?

Trying to mount sdb1 gave the same results:

mount /dev/sdb1 /media/Data
NTFS signature is missing.
Failed to mount '/dev/sdb1': Invalid argument
The device '/dev/sdb1' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?

Just when I was about to give up, I remembered the warning message, how about I just try to use GNU Parted? Turns out if I use parted -l rather than fdisk -l, I see a much better picture:

 parted -l
Model: TRUSTED Mass Storage (scsi)
Disk /dev/sda: 8796GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system  Name                          Flags
 1      17.4kB  134MB   134MB                Microsoft reserved partition  msftr                                                                                                 es
 2      134MB   8796GB  8796GB  ntfs         Basic data partition

Model: TRUSTED Mass Storage (scsi)
Disk /dev/sdb: 8796GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system  Name                          Flags
 1      17.4kB  134MB   134MB                Microsoft reserved partition  msftr                                                                                                 es
 2      134MB   8796GB  8796GB  ntfs         Basic data partition

As you can see, when Windows formatted the partition, the first partition was marked as Microsoft reserved partition with a weird partition type of msftr and the actual data partition is on the second partition.

Therefore, if I do:

mount /dev/sdb2 /media/Data/

Now I can finally mount everything properly. And df -h is now showing both of my 8TB partitions:

 df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs           30G  2.2G   27G   8% /
/dev/root        30G  2.2G   27G   8% /
devtmpfs        212M     0  212M   0% /dev
tmpfs            44M  856K   43M   2% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs            88M     0   88M   0% /run/shm
/dev/mmcblk0p1   56M   19M   38M  33% /boot
/dev/sdb2       8.0T  891G  7.2T  11% /media/Data
/dev/sda2       8.0T  1.7T  6.4T  21% /media/Backup

In summary, when you are mounting a gpt partition, please use parted –l to check the actual data partition (the one with the huge disk size) and mount that specific partition number to the mount point.