Auto mount folders with CIFS at startup
Introduction
Setup shared folders with CIFS and mount automatically at startup. This worked for me within Ubuntu. For example, the shared folder can be on a NAS or a file server.
Setup with fstab
-
Install
CIFS Utils
Run the following command:
-
Create the folder to which you want to point the mount
This can be a shared folder from your NAS of fileserver. Run the following commands:
Instructions:
- Required Replace
fileserver/archive
with your own folder
- Required Replace
-
Add to
/etc/fstab
Instructions:
- Required Replace
//fileserver/archive
with your shared folder, for example the folder on your NAS or fileserver - Required Replace
/mnt/fileserver/archive/
with the local folder you created earlier to point the mount to
- Required Replace
-
Save the credentials to a separate
.smbcred
fileInstructions:
- Required Replace
<username>
with your username of the shared folder (on the file server or NAS) - Required Replace
<password>
with your password of the shared folder (on the file server or NAS)
- Required Replace
-
Test if it works
Run the following command:
No comments found for this note.
Join the discussion for this note on Github. Comments appear on this page instantly.