3

I have a 500GB Toshiba 2.5' HD, which I formated using Debian Wheezy 64bit. I created 2 partitions (180GB and 320GB).
RPi would only recognize the first partition.

So, I tried creating the partitions using the raspberrypi. Here are my surprising findings:

root@raspberrypi:/home/ozn# fdisk -l

Disk /dev/mmcblk0: 4025 MB, 4025483264 bytes
4 heads, 16 sectors/track, 122848 cylinders, total 7862272 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: 0x000dbfc6

        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1            8192      122879       57344    c  W95 FAT32 (LBA)
/dev/mmcblk0p2          122880     7862271     3869696   83  Linux

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 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: 0x950e3b8d

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048   625142447   312570200   83  Linux
/dev/sda2       625142448   976773167   175815360   83  Linux

First, /dev/sda is NOT recognized correctly! This disk is 500GB.

Second, mounting /dev/sda2 is not possible:

root@raspberrypi:/home/ozn# mount -t ext4 /dev/sda2 /media/usbhdd1/
mount: special device /dev/sda2 does not exist
# although fdisk -l showed this device !

Third, trying to format the disk, it really sees only the sectors until 320GB: When I start fdisk I am warned:

Building a new DOS disklabel with disk identifier 0x6784fc4b.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

I have other USB hard drives with 320GB and they really mount fine.

  • Is this a limitation of RPi? Or a problem with this specific Hard Drive?
  • How can I use this large disk with my RPi?

update: solved the issue with help of the commentators here...

here is what I did ...

  1. I thought I have some weired issue with Debian Wheezy & gparted. So, I reformatted the hard drive to NTFS. Before that I ERASED the partition table. And created a new single NTFS partition.
  2. Bingo! RPi, identified the partition. However, it claimed my Drive is now 2TB big, and recommended I will use GPT:

    root@raspberrypi:/home/ozn# fdisk -l /dev/sda
    
    Disk /dev/sda: 2199.0 GB, 2199023255552 bytes
    255 heads, 63 sectors/track, 267349 cylinders, total 4294967296 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: 0xf720f720
    
    Disk /dev/sda doesn't contain a valid partition table
    root@raspberrypi:/home/ozn# fdisk  /dev/sda
    Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
    Building a new DOS disklabel with disk identifier 0xb7032c3f.
    Changes will remain in memory only, until you decide to write them.
    After that, of course, the previous content won't be recoverable.
    
    Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
    
    WARNING: The size of this disk is 2.2 TB (2199023255552 bytes).
    DOS partition table format can not be used on drives for volumes
    larger than (2199023255040 bytes) for 512-byte sectors. Use parted(1) and GUID 
    partition table format (GPT).
    

whoops! That is WRONG!

So, I disconnected the hard drive again. re-connented it to my laptop. I erased the partition table again, and re-created the partition table using fdisk on RPi! not on my laptop! This time, I took a short cut, and created the disk partition with ext4 directly. I plugged the hard-drive to RPi and BINGO!

root@raspberrypi:/home/ozn# fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes
81 heads, 63 sectors/track, 191411 cylinders, total 976773168 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: 0x000505b8

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048   976773167   488385560   83  Linux

Disk /dev/mmcblk0: 4025 MB, 4025483264 bytes
4 heads, 16 sectors/track, 122848 cylinders, total 7862272 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: 0x000dbfc6

Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1            8192      122879       57344    c  W95 FAT32 (LBA)
/dev/mmcblk0p2          122880     7862271     3869696   83  Linux

Disk /dev/sda: 500.1 GB, 500107862016 bytes
81 heads, 63 sectors/track, 191411 cylinders, total 976773168 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: 0x000505b8

Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048   976773167   488385560   83  Linux

The disk is now identified correctly on my laptop with Debian.

ozdeb@yenitiny:~$ sudo fdisk -l /dev/sdb

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
81 heads, 63 sectors/track, 191411 cylinders, total 976773168 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: 0x000505b8

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048   976773167   488385560   83  Linux

conclusion (?)

My guess is that gparted in Debian Wheezy includes some nasty bug which is sometimes showing it's ugly face. I would report a bug if I had more solid evidence. But ... since I have only one 500GB hard drive, and I don't want to risk the health of this hard drive reformatting it so many time, I will settle this with it. If you happen to bump into this post, and you have had similar problems with large SATA drives and partitioning on wheezy, I would be happy to know.

12
  • Can you see the where the disk is detected in dmesg at boot? Is it the correct brand/type/size/geometry there? Any funny messages?
    – XTL
    Dec 12, 2012 at 7:29
  • Are you saying that only this drive is the problem? As far as I understand it, there should not be a limitation with the RPi.
    – Vincent P
    Dec 12, 2012 at 8:50
  • @VincentP, I have other USB drives I plugged in, and I had no problem. Also, I have no problem reading the first 320GB. Everything after that is simply ignored by RPi(/RaspbianOS ?)
    – oz123
    Dec 12, 2012 at 9:08
  • @Oz123 Have you tried another 500gb drive? I'm thinking it's most likely RaspbianOS.
    – Vincent P
    Dec 12, 2012 at 9:37
  • @VincentP, Sadly, I am also suspecting that. Further ... I don't have another 500GB drive for testing.
    – oz123
    Dec 12, 2012 at 9:38

4 Answers 4

1

The comments on the original post are getting too long, so here is my answer. I suspect that it's the drive itself. Maybe try update your Raspberry Pi and then try again.

To update sudo apt-get update && sudo apt-get upgrade

Then try to access the drive. If this does still not work. I'd recommend trying to find someone with a HDD at least the same size or bigger and test that.

1
  • Like I wrote before the hard drive is mounting totally fine on CentOS6.3 (i386) and Debian Wheezy (x86_64).
    – oz123
    Dec 12, 2012 at 13:49
3

I have a 500Gb HDD formatted with ext3. I've connected it to my RPi using a USB->SATA enclosure and everything works just fine. Using ArchLinuxARM though. So I don't think there are any limitations on disk size for RPi.

5
  • 1
    @Alexader, you are using a different OS. Can you try with Raspbian?
    – oz123
    Dec 12, 2012 at 13:48
  • @Oz123 it will be weird if it is raspbian issue, but I'll give it a try if I'll find a spare SD card Dec 12, 2012 at 14:37
  • 1
    I have a ~1.5 Tb external hard drive in a USB->SATA enclosure, with one NTFS partition on it. Works fine in raspbian, however writing to a NTFS system is not very fast.
    – Frepa
    Dec 12, 2012 at 14:49
  • @Frepa, any idea if it works with EXT4?
    – oz123
    Dec 12, 2012 at 16:28
  • @Oz123 I haven't tried, since I need the data on the disk and don't want to reformat. But I don't know any reason for why it would not work. The problem seems to be below the file system level. -- I see now that the problem was solved.
    – Frepa
    Dec 13, 2012 at 11:26
1

I mounted a 750gb drive - FAT32 Able to read and write to it

sudo mount -t vfat /dev/sda1 /mnt/usb
0

Basically instead of fdisk -l, you should use parted -l (install parted if you do not have it installed) to see the actual data partition and then mount the actual data partition (/dev/sdb2, etc) directly.

I wrote a short tutorial on how to do this:

http://www.zayblog.com/computer-and-it/2013/07/22/mounting-gpt-partitions-on-raspberry-pi/

I was able to mount 2 8TB partitions directly, without wiping the data/reformat the drive.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.