A few days ago I switched my HDD on my Raspberry Pi to a SSD drive. I use the Pi as a NAS serving files at home and I wanted to use a HDD for music with less storage but more reliability. This drive runs 24/7. I also chose exFat for the filesystem. I write this as a future self-reference, but may be useful for somebody else, so here it goes.
Steps:
Find the drive
First you need to find the drive you want to mount. Run:
1
|
|
Which will list disk partitions in the system. In my case the interesting bit is:
1
|
|
And this one:
1 2 3 4 |
|
So note the location of the partition - in my example /dev/sda1.
Mount it manually
Test that you can mount it with mnt command:
1 2 |
|
If you then check the contents they should be visible:
1 2 |
|
ExFat
If you have an exFat drive, mounting will not work, as you need a driver with support for it. On Debian and Raspbian, just install it with the package manager:
1
|
|
Mount it automatically
So you can mount and unmount the USB drive manually. But you can automate it even further so every time you start the Pi, it mounts the drive to the specified location. For this you need the UUID, not just the location, as it could potentially change.
1
|
|
Gives you a list of devices and their UUIDs. Note the one for your partition:
1 2 3 |
|
Then last step is to modify the file in /ect/fstab to mount your partition:
1
|
|
For the meaning of each value run the manual pages, but these are reasonable defaults for home drives.
Now every time the Pi starts it knows how to mount that drive. Also, if you run sudo mount -a command, it will also know how to mount it. Good for quick system maintenance.
EDIT 05/08/2016: I’m seen a lot of traffic coming to this post, so I wanted to give a heads up to anybody reading this: I’m no longer using ExFat for my Raspberry Pi. The reasons are in this post. If you want to try it yourself, you’re very welcome, and the steps are still valid AFAIK.