0

Right now, I have an external hard drive that has its own power supply. When I first installed the system, it was able to recognize the hard drive, which I mounted and then added to the fstab. Every reboot after that however, the pi will not detect it at all. It doesn't show up at all through sudo fdisk -l. I initially thought that it was the SD but the same thing happened with another SD and a clean installing.

1

Hep; It sounds almost like a loose micro-usb as it works pretty well out of the box:

pi@raspberrypi ~ $ sudo fdisk -l

Disk /dev/mmcblk0: 7822 MB, 7822376960 bytes
4 heads, 16 sectors/track, 238720 cylinders, total 15278080 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: 0x000b5098

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

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 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: 0xe8900690

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1              63  1953520064   976760001   83  Linux

As you can see above sudo fdisk -l works fine.

With this we need a mount point:

pi@raspberrypi ~ $ sudo mkdir /media/usbhdd

From here we can open and edit the /etc/fstab, using:

pi@raspberrypi ~ $ sudo nano /etc/fstab

So you can add the last line of the fstab for your usb hdd. Your result should look like shown below (consult man fstab if you are in doubt about your filesystem).

pi@raspberrypi ~ $ cat /etc/fstab
proc            /proc           proc    defaults          0       0
/dev/mmcblk0p1  /boot           vfat    defaults          0       2
/dev/mmcblk0p2  /               ext4    defaults,noatime  0       1
# a swapfile is not a swap partition, so no using swapon|off from here on, use  dphys-swapfile swap[on|off]  for that
**/dev/sda1       /media/usbhdd   ext4    defaults          0       0**

The last line (above) is my fstab that automounts the external usb HDD at boot.

Now you can see the hdd using: df -h

pi@raspberrypi ~ $ df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs          7.1G  2.5G  4.3G  37% /
/dev/root       7.1G  2.5G  4.3G  37% /
devtmpfs        215M     0  215M   0% /dev
tmpfs            44M  236K   44M   1% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs            88M     0   88M   0% /run/shm
/dev/mmcblk0p1   56M  9.5M   47M  17% /boot
/dev/sda1       917G  366M  870G   1% /media/usbhdd

I hope this helps for checking that you didn't miss anything :-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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