Trouble mounting external ntfs hd on pi

Hi all

I know this question has been asked a lot but I’ve search around and I’m totally stuck…

I’m using a 1st gen Pi and OSMC won’t recognise my external (powered) HDD. It’s 3tb and is GPT NTFS formatted.

It’s not showing up in /media…

Here is the printout from fdisk -l

    Disklabel type: dos
Disk identifier: 0x000cb6fa

Device         Boot  Start      End  Sectors  Size Id Type
/dev/mmcblk0p1        2048   499711   497664  243M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      501760 30703615 30201856 14.4G 83 Linux

Disk /dev/sda: 746.5 GiB, 801569726464 bytes, 1565565872 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
Disklabel type: gpt
Disk identifier: BBA9CBCE-F513-4123-A61A-7BF5D84CBFA2

Device      Start        End    Sectors  Size Type
/dev/sda1      34     262177     262144  128M Microsoft reserved
/dev/sda2  264192 5860532223 5860268032  2.7T Microsoft basic data

GPT might be an issue, I don’t think our automounter has been tested with GPT partition tables…

Can you post the output of the system journal after booting with the drive connected ?

sudo journalctl | paste-log

http://paste.osmc.io/navekexoti

Thanks!

The kernel only seems to be seeing the first partition, which I think is a dummy “protective” partition that systems that don’t recognise GPT formatted disks will see:

Nov 05 14:03:48 raspi kernel: sd 0:0:0:0: [sda] 1565565872 512-byte logical blocks: (801 GB/746 GiB)
Nov 05 14:03:48 raspi kernel: sd 0:0:0:0: [sda] Write Protect is off
Nov 05 14:03:48 raspi kernel: sd 0:0:0:0: [sda] Mode Sense: 21 00 00 00
Nov 05 14:03:48 raspi kernel: sd 0:0:0:0: [sda] No Caching mode page found
Nov 05 14:03:48 raspi kernel: sd 0:0:0:0: [sda] Assuming drive cache: write through
Nov 05 14:03:48 raspi kernel:  sda: sda1
Nov 05 14:03:48 raspi kernel: sd 0:0:0:0: [sda] Attached SCSI disk

No trace of sda2 in the partition list reported by the kernel. Likewise udisks-glue (the automounter) is only detecting the one partition:

Nov 05 14:03:55 raspi udisks-glue[265]: Device file /dev/mmcblk0 inserted
Nov 05 14:03:55 raspi udisks-glue[265]: Device file /dev/sda inserted
Nov 05 14:03:55 raspi udisks-glue[265]: Device file /dev/sda1 inserted
Nov 05 14:03:55 raspi udisks-glue[265]: Device /dev/sda1 did not match any rules.
Nov 05 14:03:55 raspi udisks-glue[265]: brw-rw---- 1 root disk 8, 1 Nov  5 14:03 /dev/sda1
Nov 05 14:03:56 raspi udisks-glue[265]: blkid: /dev/sda1: PARTLABEL="Microsoft reserved partition" PARTUUID="f1913321-8ee0-4871-bdf1-2c242e5d36a4"

I’ve never actually used a GPT disk on Linux before so I don’t know whether our Kernel may be missing support for GPT or not.

CC @sam_nazarko

Try

sudo apt-get update
sudo apt-get install gptsync
sudo gptsync /dev/sda

Also see if you can upload the output of

sudo dd if=/dev/sda bs=512 count=1 of=layout.img
osmc@raspi:~$ sudo dd if=/dev/sda bs=512 count=1 of=layout.img
1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.00472488 s, 108 kB/s

Here is the output

I couldn’t install gptsync, do I need to add another repo?

Reading package lists... Done
osmc@raspi:~$ sudo apt-get install gptsync
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package gptsync

Can you upload the layout.img?

gptsync was dropped after wheezy in Debian, so may need compiling from source: Debian -- Error.

(I think your MBR and GPT partition tables are not synchronised). Does manually mounting the partition to mount /mnt work?

Device         Boot  Start      End  Sectors  Size Id Type
/dev/mmcblk0p1        2048   499711   497664  243M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      501760 15523839 15022080  7.2G 83 Linux

Disk /dev/sda: 3.7 TiB, 4000787029504 bytes, 7814037167 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 809F619A-13A8-487E-A172-5E4135313609

Device     Start        End    Sectors  Size Type
/dev/sda1   2048 7814037133 7814035086  3.7T Linux filesystem

Seems to be working fine for me.

I get this:

osmc@raspi:~$ sudo mount /dev/sda2 /mnt
mount: special device /dev/sda2 does not exist

(drop the .ico extension, I had to add it on to get it to upload!)
layout.img.ico (512 Bytes)

Hi,

I was unable to infer your partition structure from that file so I suspect OSMC is having a problem with this too.

I’ve compiled gptsync for your Pi and it would be good if you could try this:

sudo wget http://collaborate.osmc.tv/index.php/s/BRw2Ggr09XE6fAh/download -O /usr/bin/gptsync
sudo chmod +x /usr/bin/gptsync
gptsync /dev/sda
Current GPT partition table:
 #      Start LBA      End LBA  Type
 1             34       262177  MS Reserved
 2         264192   5860532223  Basic Data

Current MBR partition table:
 # A    Start LBA      End LBA  Type
 1              1   4294967295  ee  EFI Protective

Status: MBR table must be updated.

Proposed new MBR partition table:
 # A    Start LBA      End LBA  Type
 1              1           33  ee  EFI Protective
 2             34       262177  c0  Unknown
 3 *       264192   5860532223  07  NTFS/HPFS

May I update the MBR as printed above? [y/N] y
Yes

Writing new MBR...
Warning: Partition 3 extends beyond 2 TiB limit
MBR updated successfully!

Thanks but its still not recognising it - is this because the partition is over the 2tb limit?

Did you reboot afterwards ?

I did yeah

To make things trickier windows is no longer recognising the disk

Try this:

sudo apt-get update
sudo apt-get install parted
parted -s /dev/sda print (upload output)

Sam

Hi Sam, I got this:

Error: Can't have a partition outside the disk!
Model: Generic External (scsi)
Disk /dev/sda: 802GB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:

Fdisk is still also showing the same:

osmc@raspi:~$ fdisk -l
Disk /dev/sda: 746.5 GiB, 801569726464 bytes, 1565565872 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
Disklabel type: gpt
Disk identifier: BBA9CBCE-F513-4123-A61A-7BF5D84CBFA2

Device      Start        End    Sectors  Size Type
/dev/sda1      34     262177     262144  128M Microsoft reserved
/dev/sda2  264192 5860532223 5860268032  2.7T Microsoft basic data

Do you have any important data on the disk ? Because if you don’t, you’re now at the point where you are probably better off re-partitioning and re-formatting rather than trying to repair what is there.

Its not essential but would mean me downloading a lot of stuff again - could I restore it using layout.bin file?