Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

To finish pulling notes from NAS://tin/Crashplan/

Code Block
===== Setup
# tested on lubuntu 13.10, 16.04.2 desktop edition

#sudo apt-get install smbclient
#smbclient -L //server -U user # list shares, theres is a cifs-utils version now named (?)
#smbclient //server/share -U user # directly connect

# you must have a Linux user account that matches on the NAS
sudo apt-get install cifs-utils
cd ~
mkdir myra
# mounts read-only for read/write add --rw
sudo mount -t cifs //192.168.0.5/myra ~/myra/ -o username=tin.pham,noexec
Settled on,
adding user phantom to folder in synology.

# to mount read write you must have corresponding users on your system and nas
# you must logged in as that user who has sudo
# find the uid and gid using the command id,
id


# now you can mount using the uid, gid and -w to write
sudo mount -t cifs //192.168.0.5/torrents -o username=setupadmin,noexec,uid=1000,gid=1000 -w
===== Initial Connections
 
# From your clent system see what mounts are available on target system (this is the system sharing the data) 
# You can specify a user and verify your password works
smbclient -L //192.168.0.5 -U tin.pham
Enter tin.pham's password: 
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 4.1.18]
	Sharename       Type      Comment
	---------       ----      -------
	IPC$            IPC       IPC Service ()
	tin.archive     Disk      
	tin             Disk      
	rsync           Disk      
	pham            Disk      
	NetBackup       Disk      System default shared folder
	myra            Disk      
	guest.public    Disk      Available to all and guests.
	home            Disk      home
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 4.1.18]
	Server               Comment
	---------            -------
	DISKSTATION          
	Workgroup            Master
	---------            -------
	WORKGROUP            W7KITCHEN

===== Troubleshoot

== Connect Directly using Samba to see if response is workig
# You may need to install smblcient first.
# Directly connect
smbclient //192.168.0.5/guest.public -U tin.pham
smb: \>
 
# Run ls to see results and help to see list of commads
smb: \>ls
 
== Try Using Local Directory
cd ~
mkdir guest.public
sudo mount -t cifs //192.168.0.5/guest.public/ ~/guest.public/ -o username=tin.pham,noexec
===== List of mount
# Backing Up
su - phantom
sudo mount -t cifs //192.168.0.5/guest.public /data/guest.public/ -o username=phantom,noexec
sudo mount -t cifs //192.168.0.5/myra /data/myra/ -o username=phantom,noexec
sudo mount -t cifs //192.168.0.5/pham /data/pham/ -o username=phantom,noexec
sudo mount -t cifs //192.168.0.5/rsync /data/rsync/ -o username=rsync,noexec # remember to use different password
sudo mount -t cifs  //192.168.0.5/tin.archive /data/tin.archive -o username=phantom,noexec

# For writing
su - tin.pham
sudo mount -t cifs //192.168.0.5/guest.public /mnt/guest.public/ -o username=tin.pham,noexec # Torrents

# List samba cifs mounts
sudo mount -t cifs

# List all mounts with more details
sudo mount -v

This CIFS Utils and Samba wikipedia article has lots good points,

  • CIFS is the extension of the SMB protocol.
  • In-kernel CIFS filesystem is generally the preferred method for mounting SMB/CIFS shares on Linux.
  • The cifs-utils package is not part of Samba, although they were originally included with it.

apt-cache policy cifs-utils - see version installed

This is More Personal Just Dumping

Crashplan mounts using user phantom which only has read access,

Code Block
languagebash
sudo mount -t cifs //192.168.0.5/guest.public /data/guest.public/ -o username=phantom,noexec
sudo mount -t cifs //192.168.0.5/myra /data/myra/ -o username=phantom,noexec
sudo mount -t cifs //192.168.0.5/pham /data/pham/ -o username=phantom,noexec
sudo mount -t cifs  //192.168.0.5/rsync /data/rsync -o username=phantom,noexe
sudo mount -t cifs  //192.168.0.5/tin.archive /data/tin.archive -o username=phantom,noexec

CrashPlan Client

Errors

Got this error on a fresh Ubuntu Desktop 16.05.2 LTS system

Code Block
languagebash
sudo mount -t cifs //192.168.0.5/guest.public/ ~/guest.public/ -o username=tin.pham,noexec
mount: //192.168.0.5/guest.public/ is write-protected, mounting read-only
mount: cannot mount //192.168.0.5/guest.public/ read-only

Answer is that you must instal cifs-utils which mount command then hooks into. Not very clear at all.

Auto Mounting Modifying Fstab

Create credential file for id of user of target mount in /root/ using root. Change to remove read by "other".

/etc/fstab

Code Block
//192.168.0.5/guest.public /data/guest.public/ cifs uid=2000,gid=50,credentials=/root/.cifscredentials,ro 0 0

This is what worked for on my server with some finicking... I'll write this up later,

Code Block
languagebash
# Mount NFS drive for Plex serveradmin
192.168.0.5:/volume1/guest.public /opt/mnt/guest.public/ nfs4

Working System Example

And this is now my working system looked,

Make directories in a my own data folder as my normal user,

Code Block
languagebash
cd /data/
mkdir guest.public myra pham tin.archive rsync pham.encrypted

Get the uid and gui of your account which in my case is uid=2000 and gid=50

Code Block
languagebash
cat /etc/passwd | grep 2000
tin.pham:x:2000:50:Support Tin Pham:/home/tin.pham:/bin/bash

/etc/fstab file ended up looking.. I'm using a more privileged account here, but have specified to mount using ro = read only. Thegid= and  uid=,

Code Block
languagebash
//192.168.0.5/guest.public /data/guest.public/ cifs uid=2000,gid=50,credentials=/root/.cifscredentials,ro 0 0
//192.168.0.5/myra /data/myra/ cifs uid=2000,gid=50,credentials=/root/.cifscredentials,ro 0 0
//192.168.0.5/pham /data/pham/ cifs uid=2000,gid=50,credentials=/root/.cifscredentials,ro 0 0
//192.168.0.5/tin.archive /data/tin.archive/ cifs uid=2000,gid=50,credentials=/root/.cifscredentials,ro 0 0
//192.168.0.5/rsync /data/rsync/ cifs uid=2000,gid=50,credentials=/root/.cifscredentials,ro 0 0
//192.168.0.5/pham.encrypted /data/pham.encrypted/ cifs uid=2000,gid=50,credentials=/root/.cifscredentials,ro 0 0

Reboot and if all things work those directories will now be mounted with the NAS data.

References

Automount network drive on startup - https://ubuntuforums.org/showthread.php?t=1806455