Social Icons

USB drive not mounted before transmission daemon startup - Raspberry Pi

Many Raspbian users face a common issue of transmission daemon (service) getting started before their USB HDD is auto mounted by the Raspberry Pi or Raspbian where as for some the issue simply doesn't exists.

The issue lies in the auto mount feature with Raspbian Wheezy, which automatically mounts the USB drives when X-mode (GUI mode) is enabled on bootup. Primarily I would suggest to keep that mode disabled unless you are using RasPi with a head (Read: Monitor / Display), as it otherwise unnecessarily wastes system resources. In case you don't want to disable it for your daily use, just disable it for the time being of this fix but running "sudo raspi-config" and selecting appropriate option then rebooting your pi.

Now, lets see the steps to configure the mount point for USB Drive and set it to be done after every reboot automatically.

Step 0.
Make sure the GUI (X-mode) is turned off
Plug in your USB HDD / Drive to RasPi

Step 1.
Log on pi using ssh terminal and execute:
ls -l /dev/disk/by-uuid/

You will see something like the following:

lrwxrwxrwx 1 root root 10 Jan  1  1970 0AC4D607C4D5F543 -> ../../sda1

Note down the value of the UUID --> 0AC4D607C4D5F543

Step 2.
Create a location for mount point:
sudo mkdir /media/NASDRIVE

Give proper permission:
sudo chmod 775 /media/NASDRIVE

Step 3.
Mount the USB Drive and then check if it is accessible at /media/NASDRIVE
sudo mount -t ntfs-3g -o uid=pi,gid=pi /dev/sda1 /media/NASDRIVE

ntfs-3g for NTFS Drives
vfat for FAT32 Drives
ext4 for ext4 Drives

Also, if ntfs-3g is not installed u might have to install it by:
sudo apt-get install ntfs-3g

Step 4.
Now, we will configure RasPi to do this after every reboot:

Take a backup of current fstab
sudo cp /etc/fstab /etc/fstab.backup

Add the mount information in the fstab file:
UUID=0AC4D607C4D5F543 /media/NASDRIVE ntfs-3g rw,defaults 0 0

Step 5.
Turn on the GUI mode by sudo raspi-config, only if required.

You should see your USB drive automatically mounted at /media/NASDRIVE

Now, even your transmission should also be able to get your drive in mounted state while the service starts.