USB Storage Router attached

Write tutorials here
There are more tutorials here
Forum rules
Please don't add support questions to tutorials,start your own thread in the appropriate sub-forum instead. Before you post please read this
Post Reply
User avatar
Level 1
Level 1
Posts: 23
Joined: Wed Feb 05, 2014 10:12 am

USB Storage Router attached

Post by patrice4419 » Wed May 27, 2015 10:00 am

Network Attached Storage – NAS
Having looked at all the prices of nas boxes and slowly recovered, I decided to try an attached USB drive to the router as a cheap nas (it has a USB slot). Unfortunately most of the forums' advice only consider Windows and not Linux and specifically not Linux Mint. Not sure why that would be so, as it can be a cheap solution to storage. I purchased a 1Tb Seagate Expansion portable drive (only £55.00), stuck it in the USB slot and nothing happened. Although if attached to a USB slot of the computer itself it registered nicely. Researching the subject, some forums mentioned the fstab file had to change, a mount point had to be provided and some software to be installed. Most of the advice was pretty dated and some no longer viable as solutions.
I have a D-Link DSL3580L Router having its own USB installation procedure but this only makes the drive accessible via smb (Samba) and not writeable.
Also it will not allow a name to be given – in my router it seems to be 'anonymous' without the possibility of changing it. However, typing Ctrl L then smb:// the network USB drive will open for read only access.
In order to use read/write you'll need a directory (folder) under /media, call it what you want, mine is /public, so sudo mkdir /media/public. This will be your mountpoint. Next, open the fstab file – sudo gedit /etc/fstab (or use nano if you will) and add this line at the end of the file:
// /media/public cifs guest 0 0 – this will not need passwords but is accessible by others as well, something to be remembered if you are paranoid about security (like me). You will want to secure the set-up, you do that with a credentials file. Set up the credentials file containing a password and username as follows:
Create the file - /home/user/credentials and type two lines –
username=linuxlover or your name choice,
password=12345 or your password choice,
Save it (this will be a hidden file (.credentials)).
Now alter the fstab file line as follows:
// /media/public cifs, credentials=/home/user/.credentials 0 0
By the way, /user can be any name, whatever you decide and don't forget the full stop before credentials.
Next you will have to download and install a few very small progs – only because a lot of modern USB drives are configured with NTFS although you could reformat to FAT32, except I wouldn't bother, install NTFS Configuration Tool (from the Software Manager) it is self-explanatory. And you'll need cifs-utils (most distros already have it but you'll need it as smbfs is no longer used).
If rw does not automatically start you put this command before .credentials separated by a comma.
Like so: // /media/public cifs rw,credentials=/home/user/.credentials 0 0 is the most widely used IP address in use by routers but it can be different, just check it by typing 'route -n' in the terminal, you'll find it marked under gateway.

Tested only on Mint 17 and 17.1 (Cinnamon) – Don't forget to reboot!

(Penguin PocketWee running Mint 17.1 Cinnamon, Intel Dual Core i5-4250U 1.3Ghz (2.6 Turbo), 8Gb DDR3, mSATA SSD 250Gb, wireless dual band.
The router (D-Link DS3580L) with USB slot.

Post Reply

Return to “Tutorials”