## Step 1: Create a Mount Point
First, let's create a directory where we'll mount the TrueNAS share:
```bash
sudo mkdir -p /mnt/nas_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 gyoung
```
You can also test mounting it temporarily:
```bash
sudo mount -t cifs //192.168.1.233/media /mnt/media -o username=gyoung,password=icxcnika,vers=3.0,file_mode=0777,dir_mode=0777,noperm
```
If successful, you should be able to see the share contents:
```bash
ls /mnt/nas_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/nas_media cifs credentials=/root/.smbcred,vers=3.0,file_mode=0777,dir_mode=0777,noperm 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
```
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