Hooking up an external usb hard drive to the Raspberry pi is fairly easy.  A hard drive plugged into a raspberry pi is /dev sdb.

You may want to format your external hard disk to be an ext4 filesystem instead of formatting it for windows.

Use fdisk and set it to make the whole disk as a primary ext4 partition.  This will make your USB hard disk incompatible with Windows.

Format the disk

mkfs -t ext4 /dev/sdb

Make the mount point:

mkdir /mnt/disk1

Add this line to your /etc/fstab file with sudo vi /etc/fstab

/dev/sdb1               /mnt/disk1              ext4    defaults        0 0

mount the disk

mount -t ext4  /dev/sdb /mnt/disk1

Install Samba

sudo apt-get install samba

Add this to /etc/samba.conf

   comment = Samba server
   read only = no
   locking = no
   path = /mnt/disk1
   guest ok = yes


Reboot the RPI

You should now see the external hard disk on your windows network.


Published on  January 24th, 2013