G Drive mounting script


A (bash?) script needs to be made for mounting users home drives from the Universities system. The script on launch will ask for the users university username and password.

This script needs to work in userspace so no sudo/root privilidges required!

Tried using this command but it didn’t want to authenticate against the university servers.

gio mount 'smb://domain;username@IPaddress/sharedfolder'

Sharepoint info for mounting drives:


You’ll definitely want to investigate FUSE for this. I’ve mounted SAMBA / CIFS shares from the CLI before, so I might be able to cook something up if / when I gain access to the room. Remind me :stuck_out_tongue:


The desktops have SSH setup if you want to have a go at it now?


Erm can do? Could you PM me the details on discord? I don’t currently have VPN access to the university setup.



Ok, I’ve investigated mounting university shares.

Basically, we need the gio mount command. So I could do this:

gio mount smb://486016@data.adir.hull.ac.uk/satahome4/486/486016

…but it won’t let me, because it claims Failed to mount Windows share: Function not implemented. Apparently the solution to this is to mount with sec=ntlm, but the man page for gio mount doesn’t detail how I can specify this.

So currently you’ve gotta be root to mount your G: & Z: drives.

I found the following script in my ~/bin folder. These commands work for me on Ubuntu:

sudo mount -t cifs -o username=486016,rw,nounix,iocharset=utf8,file_mode=0775,dir_mode=0775,uid=1000 //data.adir.hull.ac.uk/~486016 /media/sbrl/486016-G
sudo mount -t cifs -o username=486016,rw,nounix,iocharset=utf8,file_mode=0775,dir_mode=0775,uid=1000 //data.adir.hull.ac.uk/satahome4/486/486016 /media/sbrl/486016-Z

(Link to original file in my bin folder)

I’d forgotten I wrote that script :stuck_out_tongue:

If anyone has further issues with that, you can add sec=ntlm to the end of the comma-separate list of options I’ve specified there with -o.



I think it’s an issue on a samba level

smbclient //data.adir.hull.ac.uk//satahome5//505//505618 -U 'ADIR\505618'
Enter ADIR\505618's password:
tree connect failed: NT_STATUS_BAD_NETWORK_NAME


Hrm. Not sure then!


Figured something out. Requires smbnetfs

cp /usr/share/doc/smbnetfs-0.6.1/smbnetfs.conf ~/.smb/smbnetfs.conf
smbnetfs ~/mnt
cd ~/mnt/username:password@cna-cifs.adir.hull.ac.uk/home5/5xx/username

Should be possible to put the password in ~/.smb/smbnetfs.auth should probably make that file delete on logoff?


Yay! That looks like it’d work. We could write a .desktop file that starts a yad-powered GUI that calls those commands.

[Desktop Entry]
Name=University Documents Mounter
Comment=Mounts your University G: drive.