Raspberry Pi - USB disk

Power Supply

The Raspberry Pi provides only very low power to the USB port (up to 0.5A). All my 2.5" hard disks failed on the raspberry, although, I'm useing a 2.8A power supply for the raspberry pi.
Sometimes, the hard disk can be mounted, but fails when using it.
Therefore, I suggest to either use a USB cable providing a second USB plug for additional current supply or a hard disk with a own power supply.





Check if hard disk is conencted to the raspberry pi

I attached a 2TB Samsung STBV2000200 to a USB port. The hard disk is NTFS formated.
Unfortunately, the NTFS partion showed some issues with the raspberry pi.

 ssh -l root 192.168.X.X
 blkid
 /dev/mmcblk0p1: SEC_TYPE="msdos" LABEL="boot" UUID="140A-14B7" TYPE="vfat"
 /dev/mmcblk0p2: UUID="f24a4949-f4b2-4cad-a780-a138695079ec" TYPE="ext4"
 /dev/sda1: LABEL="Seagate Expansion Drive" UUID="E6EC499CEC4967BF" TYPE="ntf 

If required:


Format with EXT4 or HFS Plus

Format the disk with EXT4 (linux) or HFS Plus (mac osx).

Format with EXT4 (linux only)

Format the disk with EXT4

 mkfs.ext4 /dev/sda1 -L videos

Check:

 blkid
 /dev/mmcblk0p1: SEC_TYPE="msdos" LABEL="boot" UUID="140A-14B7" TYPE="vfat"
 /dev/mmcblk0p2: UUID="f24a4949-f4b2-4cad-a780-a138695079ec" TYPE="ext4"
 /dev/sda1: UUID="f4531af7-6355-4422-87ca-3e57ae6ead40" TYPE="ext4" 

Format with HFS Plus (works with MAC OSX)

Format the disk with HFS Plus

 apt-get install hfsutils hfsprogs hfsutils
 mkfs.hfsplus /dev/sda1 -v videos

Check:

 blkid
 /dev/mmcblk0p1: SEC_TYPE="msdos" LABEL="boot" UUID="140A-14B7" TYPE="vfat"
 /dev/mmcblk0p2: UUID="f24a4949-f4b2-4cad-a780-a138695079ec" TYPE="ext4"
 /dev/sda1: UUID="bc96c1bc-70ec-3eae-8b12-acc88dec0a0b" LABEL="videos" TYPE="hfsplus"

Partitions

Some more details about the partitions (HFS Plus)

 fdisk -l
 Device Boot      Start         End      Blocks   Id  System
 /dev/sda1               2   488378644  1953514572   af  HFS / HFS+  

Mount test (optional)

Mount hard disk and try to create a file

 mkdir /mnt/videos
 mount /dev/sda1 /mnt/videos
 chmod -R 775 /mnt/videos
  cd /mnt/videos
 echo "Hallo" > testfile
 cat testfile
 rm testfile

Automounting

Automounting with an "/etc/fstab" entry is not working.

But usbmount is working:

 apt-get install usbmount

Reboot and test automounting. Disk will be at /media/usb

 reboot
 # logged out -> reconnect after reboot
 ssh -l root 192.168.X.X
 ls -l /media
 lrwxrwxrwx  1 root root    4 Feb 27 13:47 usb -> usb0
 drwxrwxr-x  1 root root    8 Feb 27 13:17 usb0
 drwxr-xr-x  2 root root 4096 Feb 27 13:47 usb1
 drwxr-xr-x  2 root root 4096 Feb 27 13:47 usb2
 drwxr-xr-x  2 root root 4096 Feb 27 13:47 usb3
 

FSTAB Mounting

vi /etc/fstab
UUID=575c75d7-fbca-4ec8-a031-519b99c1c419 none            swap    sw              0       0
/dev/sdb1      /media/usb0           vfat    defaults        0       0