## Step 1: Create a Mount Point
First, let's create a directory where we'll mount the TrueNAS share:
```bash
sudo mkdir -p /mnt/media
```
## Step 2: Install Required Packages
Make sure you have the necessary tools installed:
```bash
sudo apt install cifs-utils
```
## Step 3: Create SMB Credentials File
Create a secure credentials file to avoid exposing your password in commands:
```bash
sudo bash -c 'cat > /root/.smbcred << EOL
username=gyoung
password=icxcnika
EOL'
```
Now secure the credentials file so only root can read it:
```bash
sudo chmod 600 /root/.smbcred
```
## Step 4: Test the Connection
Before making it permanent, let's test that you can connect to the share:
```bash
smbclient //192.168.1.233/media -U eyoung
```
You can also test mounting it temporarily:
```bash
sudo mount -t cifs //192.168.1.233/media /mnt/media -o username=eyoung,password=3646,vers=3.0,file_mode=0777,dir_mode=0777,noperm
```
If successful, you should be able to see the share contents:
```bash
ls /mnt/media
```
Don't forget to unmount it before making it permanent:
```bash
sudo umount /mnt/nas_media
```
## Step 5: Make the Mount Permanent
Now let's set it up to mount automatically at boot:
1. **Back up your fstab file** (always a good practice):
```bash
sudo cp /etc/fstab /etc/fstab.backup
```
1. **Edit the fstab file**:
```bash
sudo nano /etc/fstab
```
1. **Add this line** to the end of the file:
```
//192.168.1.233/media /mnt/media cifs credentials=/root/.smbcred,uid=1000,gid=1000,dir_mode=0777,file_mode=0777,vers=3.0,cache=loose,actimeo=60,soft,noperm,_netdev 0 0
```
1. **Reload systemd** to recognize the changes:
```bash
sudo systemctl daemon-reload
```
1. **Test the fstab entry** without rebooting:
```bash
sudo mount -a
```
### Mount Options Explained
- `credentials=/root/.smbcred` — uses the secure credentials file instead of inline passwords
- `uid=1000,gid=1000` — files appear owned by your user, not root
- `vers=3.0` — use SMB3 for multi-channel I/O and kernel caching
- `cache=loose` — don't revalidate the cache on every file access. Safe when this machine is the only client writing to the share. Without this, Nautilus and file picker dialogs freeze under heavy I/O because every `stat` call round-trips to the NAS
- `actimeo=60` — cache file/directory attributes for 60 seconds. The default (`actimeo=1`) forces revalidation every second, which makes file managers unresponsive when the share is under load (e.g. active torrent downloads)
- `soft` — prevents hard hangs when the NAS goes down
- `noperm` — skip local permission checks (the NAS handles permissions via ACLs)
- `_netdev` — tells systemd to wait for the network before mounting at boot
If everything works correctly, your TrueNAS media share should now be mounted at `/mnt/nas_media` and will automatically mount at boot.
## Verify the Setup
Check that the mount is working:
```bash
df -h | grep nas_media
ls /mnt/nas_media
```
That's it! Your TrueNAS share is now permanently accessible at `/mnt/nas_media`. The credentials are stored securely, and the share will automatically mount when your system boots up.
Now, you can read [[Moving Files to SMB Shares]].
## Troubleshooting
Follow instructions at [[How to Create TrueNAS SMB Shares]].
- If you get "Permission" or "Access denied" errors:
- Verify SMB service is running on TrueNAS
- Check user permissions in TrueNAS (enable SMB access)
- Verify Share ACL settings (add entry for new user)
- Ensure credentials are correct
- If you get "Operation not supported" for symlinks:
- This is normal for SMB shares
- Consider using alternative backup methods for system files
- If mount fails:
- Check network connectivity
- Verify IP address is correct
- Ensure share name matches exactly
- Check credentials file permissions
- If Nautilus or file picker dialogs freeze when browsing the share:
- Check mount options: `mount | grep /mnt/media`
- Look for `cache=strict` or `actimeo=1` — these cause excessive round-trips to the NAS
- Remount with `cache=loose,actimeo=60` (see Step 5 above)
- A VPN running over WiFi compounds this — VPN traffic competes with SMB on the same wireless link. Use a wired connection or disconnect the VPN for local file access