Properly Mount USB Storage on Raspberry Pi This guide will show you how to properly mount storage drives on Minibian, Raspbian and Raspbmc.Many guides use a simpler, less robust method that can cause issues if you use multiple USB storage devices.I will walk you through mounting USB sticks and USB hard drives on your Raspberry Pi running Raspbian.This will enable you to use your external USB storage for media, games or whatever your Pis heart desires for Kodi XBMC or a home media server.Updated for Raspbian Jessie with nofail to prevent system halts for systemd so your hard drive being absent will not stop the boot sequence on your Raspberry Pi.Debian Install Usb Stick Windows 10' title='Debian Install Usb Stick Windows 10' />Updated January 5th, 2.If you are trying to figure out which hardware would work best for you, consider reading the Pi benchmarks.I am assuming you only have 1 external hard drive connected to the Pi.If so then it should be attached to devsda.If you have multiple external hard drives you will need separate mount points for each drive e.See hard drive deals on Amazon.We have already seen how to install different Linux OS through CDROMs.Below are the Linux os installations already covered so far.How to install Fedora Linux 17 Using this PPA repository, youll be able to install Oracle Java 8 which includes both JRE8 and JDK8 in Debian for both 32bit and 64bit as well as ARM.Remember you can power a 2.B and Raspberry Pi 2.Prepare the Mount Point.First make a directory in which to mount the USB drivesudo mkdir mntusbstorage.Make pi the owner of the mounted drive and make its permissions read, write and execute for itsudo chown R pi pi mntusbstorage.R 7. 75 mntusbstorage.Set all future permissions for the mount point to pi user and group explanation can be found heresudo setfacl Rdm g pi rwx mntusbstorage.Rm g pi rwx mntusbstorage.Determine the USB Hard Drive Format.You also need to know the file system the drive is formatted withsudo blkid.You will see something like this.Again it is the sda.Note the TYPEexfat at the end, you will need this for the fstab file.It is easiest to copy it now and paste it after running nano in the next step.SECTYPEmsdos LABELboot UUID7.C 2. FD4 TYPEvfat.UUID3d. 81d. 9e. TYPEext.LABELHTPCGuides UUIDBA8.F FFE8 TYPEexfatUpdate your repositories if your hard drive is anything but ext.TYPE abovesudo apt get update.Now mount the usb stick in there.If it is NTFS you will need to install some utilities firstsudo apt get install ntfs 3g y.If the drive is exfat install these utilitiessudo apt get install exfat utils y.For all drive types mount the usb with this command, o insures pi is the owner which should avoid permission issuessudo mount o uidpi,gidpi devsda.If you get an error use this syntaxsudo mount t uidpi,gidpi devsda.If the mount t command returns an error then use this syntaxsudo mount uidpi,gidpi devsda.If you are getting this drive is already mounted errors then you are probably using a distro which automounts the drives which you can either continue using but then you should remove the etcfstab entries. Install Rockbox Ipod Nano 3G Price . You will have to uninstall the automounting software if you want to mount using the method in this guide.Remove the automounting software with this commandsudo apt get remove usbmount purge.Automount the USB Hard Drive on Bootmntusbstorage will be the folder in which you store your media.We want it to be automounted on boot The best way to do this is through the UUID.Get the UUID by using this commmandsudo ls l devdiskby uuidYou will see some output like this.The UUID you want is formatted like this XXXX XXXX for the sda.If the drive is NTFS it can have a longer format like UUIDBABA3.C2. CBA3. BE4. 13.Note this UUID, for me it is BA8.F FFE8total 0. lrwxrwxrwx 1 root root 1.Jan 1 1. 97. 0 3d.Jan 1 1. 97. 0 7.C 2. FD4. mmcblk.Oct 2. 6 2. 1 1. BA8.F FFE8. sda. Now we will edit fstab to mount the USB by UUID on bootsudo nano etcfstab.Add the line in red to the bottom, replace XXXX XXXX with your UUID and exfat with your type if it is different e.You may or may not need the quotation marks wrapped around the UID, you do not need quotation marks wrapped around the file system type ext.NTFS etc. The umask 0.USB drive. To completely eliminate permission issues you can set the umask to 0.Note that 7. 77 permissions are considered a security risk.If you have issues here then try replacing uidpi,gidpi with just the word defaults typical for ext.You can also try replacing the UUID with the devsda.This is an example for exfatdevmmcblk.UUIDXXXX XXXX mntusbstorage exfat nofail,uidpi,gidpi 0 0.NTFS, note that it is ntfs and not ntfs 3gdevmmcblk.UUIDXXXX XXXX mntusbstorage ntfs nofail,uidpi,gidpi 0 0for ext.UUIDXXXX XXXX mntusbstorage ext.If you get any errors you can replace uidpi,gidpi with defaults or remove it entirelydevmmcblk.UUIDXXXX XXXX mntusbstorage ext.For using devsda.UUIDdevmmcblk. 0p.Now test the fstab file workssudo mount a.If you didnt get errors reboot, otherwise try the suggestions above to get it working then mount a again until it succeedssudo reboot.You should be able to access the mounted USB drive and list its contentscd mntusbstorage.Every time you reboot, the drives will be mounted as long as the UUID remains the same.If you delete the partitions or format the USB hard drive or stick the UUID changes so bear this in mind.You can always repeat the process for additional hard drives in the future.Now you can manage the hard drive power using these guides since it will not spin down automatically on Linux.If you have multiple hard drives you will have to make separate mount points e.Fix Raspberry Pi 2 Mounting Issues.Thanks to Jake for bringing this to my attention.Apparently there is a bug in the Pi 2 that messes up automounting.You can fix it by creating a delay.Open up the bootcmdline.Add this line to the bottom, you can increase this delay if necessaryrootdelay5.Hit CtrlX, Y and Enter to save and exit, then reboot to see if it automounts now.If the Raspberry Pi hard drive still does not automount we can use rc.Juliansudo nano etcrc.Add this lines before the exit linesleep 3.CtrlX, Y and Enter to save.Reboot again to testsudo reboot.If you want to now remotely access your Raspberry Pi USB hard drive over a network then use Samba or NFS shares.Treat yo self to a new gadget Get More HTPC Goodness No Spam just Torrent, Usenet, Pi and Media Server Automation.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
November 2017
Categories |