Skip to content

Instantly share code, notes, and snippets.

@ErykDarnowski
Last active May 7, 2025 20:18
Show Gist options
  • Save ErykDarnowski/9f569d9d50d9379cd1e2e9ba27e9a842 to your computer and use it in GitHub Desktop.
Save ErykDarnowski/9f569d9d50d9379cd1e2e9ba27e9a842 to your computer and use it in GitHub Desktop.
How to automatically mount a network Samba share on Arch Linux!

How to automatically mount a network Samba share on Arch Linux!

  1. Install the cifs-utils package: sudo pacman –S cifs-utils.
  2. Make a mount folder for the SMB share: sudo mkdir /mnt/<Path>.
  3. Create a backup of the fstab file (just in case): sudo cp /etc/fstab /etc/fstab_backup.
  4. Open the fstab file in your favorite editor: sudo vim /etc/fstab.
  5. Add the mount line: //<Server_address>/<Server_share_and_internal_path> /mnt/<Path> cifs username=<Server_user>,pass=<Server_password> 0 0.
  1. Save the file.
  2. Reload fstab: sudo mount -av.
@Etm571
Copy link

Etm571 commented Nov 23, 2024

good

@TheLeGare
Copy link

TheLeGare commented May 6, 2025

Thanks for this!

I ran into an issue with the drive being Read Only so I wanted to share the solution I found in case anyone else has the same issue. I was able to fix it by adding 'rw' and 'uid=1000,gid=1000' to the mount line. The updated line looked like this
//<Server_address>/<Server_share_and_internal_path> /mnt/<Path> cifs username=<Server_user>,pass=<Server_password>,rw,uid=1000,gid=1000 0 0

The rw term was the key, it seems self explanatory but it was the hardest to figure out since it took a while to find a post that mentioned it. (I wasn't able to go back and find it at the time of writing or I'd link it.) The uid and gid are for getting permissions to work with a Windows file system from what I understand.

@ErykDarnowski
Copy link
Author

Thanks for this!

I ran into an issue with the drive being Read Only so I wanted to share the solution I found in case anyone else has the same issue. I was able to fix it by adding 'rw' and 'uid=1000,gid=1000' to the mount line. The updated line looked like this //<Server_address>/<Server_share_and_internal_path> /mnt/<Path> cifs username=<Server_user>,pass=<Server_password>,rw,uid=1000,gid=1000 0 0

The rw term was the key, it seems self explanatory but it was the hardest to figure out since it took a while to find a post that mentioned it. (I wasn't able to go back and find it at the time of writing or I'd link it.) The uid and gid are for getting permissions to work with a Windows file system from what I understand.

That's awesome, thanks for sharing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment