Electrical-Forenics Home ray@RayFranco.com                       601.529.7473

   Updated February 29, 2024

   © Dr. Ray Franco, PhD, PE  :  2021-2024

Cifs Mount via fstab - Works for "All" Users

You can enter the parameters for mounting a shared drive into /etc/fstab with the noauto,users options. Noauto will prevent the share from being mounted on startup, and users will allow any user (regular or sudoer) to mount the drive [1].

Example fstab entry:

//NAS_IP/Shared_Folder /media/mounting-point-directory cifs username=NAS_user_name,noauto,users,vers=3.0,rw

With this code in the /etc/fstab file, any user can mount the drive with:

mount /media/mounting-point-directory

Similarly, to unmount the drive:

umount /media/mounting-point-directory

On Debian LXDE and the Raspberry Pi OS, you can set the "Desktop Preferences" to show mounted drives on the desktop.

The methods below for mounting a share are for sudoer users only and are not as good as this method.

Fedora 39

For this to work with Federa 39, you have to set the setuid flag on "mount.cifs:.

sudo chmod u+s /usr/sbin/mount.cifs

On Debian and the Raspbery PI OS, the setuid flag is alreadt set.

References:

  1. Mount Files Systems Without Root Privileges
  2. user” CIFS mounts not supported”. / fix mount permissions
  3. mount and umount for user not allowed
  4. fedora 12. mount -t cifs on a server doesn't work
  5. Suddenly, ‘“user” CIFS mounts not supported”

CIFS - Mount Synology Network Attached Storage (NAS)

The Common Internet File System (cifs) is a Linux implementation of the Server Message Block (SMB) protocol developed by Microsoft. It is a secure protocol.

If cifs-utils is not installed, install it:

sudo apt install cifs-utils

The command line for mounting a Synology NAS with cifs is:

sudo mount -t cifs -o username=NAS_user_name,domain=WORKGROUP,password=NAS_passwd,vers=3.0,rw,uid=1000,gid=1000 //192.168.xxx.xxxx/shared_folder /home/user_name/mounting_point_directory

Umount

umount NOT unmount .

To unmount a drive:

sudo umount mounting-point-directory

NFS - Mount Synology NAS

The Network File System (nfs) was developed by Sun Microsystems. It is very popular with Linux community. However, it is not a secure protocol. It does not require a username and password. The command line for mounting a Synology NAS with nfs is:

sudo mount 192.168.xxx.xxxx:/volume1/shared_folder /home/user_name/mounting_point_directory

Note that in the mount statement for nfs, there is a colon after the IP address, and that volume1 is included in the full address of the shared Folder.

Umount drive_name

If you know the drives name, you can unmount the drive via:

sudo umount drive_name

To determine the drive_name, see next section.

List Block Devices

Many Linux distros do not have lsblk installed. To install on Debian or Ubuntu:

sudo apt install util-linux

list block is not listing network drives mounted with cifs (Microsoft SMB).

fdisk -l (list partitions)

format disk list is not listing network drives mounted with cifs (Microsoft SMB).

findmnt

findmnt DOES list drives mounted with cifs (Microsoft SMB).

lsusb list usb drives

References

  1. Mount Share Cifs Folder Without Sudo
  2. YouTube: Setting Up Synology Drive Team Folders
  3. YouTube: Sync Files To and From a Synology NAS using Synology Drive Server
  4. YouTube: New Features in Synology Drive in DSM 7.0 - Ready to replace Google Drive?
  5. YouTube: Top 8 Synology Features for Home Users (DSM7)
  6. YouTube: How to Setup a Synology NAS for the first time in DSM 7 (Complete Guide for 2021+)
  7. YouTube: SMB vs NFS vs AFP vs iSCSI - What are they and which should you use
  8. YouTube: Is MacOS Finally getting Synology's Active Backup in DSM7 (2022) & more features in work
  9. YouTube: How to Secure your Synology NAS
  10. YouTube: YOU NEED TO BACKUP YOUR NAS - Backing up a Synology NAS for home users