New Year. New Me. Yes, I have made a resolution – setup a drive on my network to share files on.
What I really need for this is a shiny new NAS.
Unfortunately, my abstemous habits at this time of year are less to do with Dry January than they are with “Skint January”.
What I do have however, is a BT Smart Hub 2 Router, which has a usb slot in the back.
I also happen to have a reasonably large capacity thumb drive (128GB) which I found in the back of a drawer.
So, whilst I’m saving my pennies for that all-singing all-dancing NAS, I’m going to attempt to :
connect the thumb drive to my Router and share it on the network
access the drive as a network share with read-write permissions from my Ubuntu 22.04.5 LTS laptop
That sounds pretty simple, right ? Well, turns out that it is. Mostly…
To begin with, I’ve plugged the thumb drive into the Router, observing Shroedinger’s USB in action – any USB device will only be the right way up on the third try.
I can now see that the device is present in my Router Admin Page.
Now, theoretically at least, we should be able to access the USB from Ubuntu by opening Files ( Nautilus), clicking on Other Locations, and entering the following into the Connect to Server field at the bottom of the screen :
Unfortunately, we are likely to be met with :
It appears that my super modern router uses and older version of Samba than Ubuntu.
Therefore, we need to change the Samba configuration on Ubuntu.
So, open a Terminal and…
There should be a line in this file that says something like :
Directly below that line, we want to add :
…and save the file.
Now when we re-open Nautilus and try again, we should be able to see the USB.
You’ll probably be prompted to provide credentials, but just connect as an anonymous user.
Now we’ve established we can connect to the thumb drive, it would be nice to make things a bit more permanent. It would also be useful to ensure that we have read/write privileges on the files on the drive.
Before we do any config, we’ll need to make a note of the uid and gid of our Ubuntu user. By specifying these in the mount command, we can ensure we have full ownership of the files on the thumb drive.
To get these, once again, we need to be in the Terminal.
For the uid (user id) :
…and for the gid (group id) :
Now we can proceed with the configuration.
Still in the Terminal, we need to create a directory to serve as a mount point. For example :
Then we need to mount the drive itself. So…
…and add this line after all the other mounts in the file (in this example, both the uid and gid are 9999) :
We’ve specified “vers=1.0” in the options string to allow for the router running the older Samba version.
After saving the file, we can test by running :
Now we can see the drive in Nautilus, without having to mount it every time we startup :
Finally to check that we have read and write permissions :