I have a freeNAS box serving out files over cifs/smb and want to automatically mount those shares when the pi boots.
I am able to mount a share using the following command via ssh:
Code: Select all
sudo mount -t cifs //192.168.2.119/0.5TB\ SG\ HDD\ 1 /var/0.5tbsghdd1 -o user=matthewso...
after looking at several hundred recommendations from others...
reading many, many pages of fstab syntax tutorials...
and trying many, many, many... seriously like really a lot... of different fstab configurations...
my best guess for the fstab line should be:
Code: Select all
//192.168.2.119/0.5TB\ SG\ HDD\ 1 /var/0.5tbsghdd1 cifs user=matthew,pass=pass,uid=1001,_netdev 0 0run command
Code: Select all
sudo mount -a
[mntent]: line 4 in /etc/fstab is bad
So rather than fiddling with credentials and trying to chown everything, I quickly created a user account on my NAS, which matches the default Raspbian user credentials.
Better test it out first to make sure it works manually...
Code: Select all
sudo mount -t cifs //192.168.2.119/0.5TB\ SG\ HDD\ 1 /var/0.5tbsghdd1 -o user=pi
Password: raspberryCode: Select all
pi@raspberrypi ~ $ df -a
Filesystem 1K-blocks Used Available Use% Mounted on
rootfs 1828696 1465252 270568 85% /
/dev/root 1828696 1465252 270568 85% /
devtmpfs 94488 0 94488 0% /dev
tmpfs 18912 200 18712 2% /run
tmpfs 5120 0 5120 0% /run/lock
proc 0 0 0 - /proc
sysfs 0 0 0 - /sys
tmpfs 37820 0 37820 0% /run/shm
devpts 0 0 0 - /dev/pts
/dev/mmcblk0p1 57288 16896 40392 30% /boot
//192.168.2.119/0.5TB SG HDD 1 480708340 212949452 229302224 49% /var/0.5tbsghdd1
pi@raspberrypi ~ $Having done that, I tried a new fstab line using the new credentials...
Code: Select all
//192.168.2.119/0.5TB\ SG\ HDD\ 1 /var/0.5tbsghdd1 cifs user=pi,pass=raspberry,uid=1006,_netdev 0 0Code: Select all
sudo mount -a
[mntent]: line 4 in /etc/fstab is bad
Code: Select all
sudo mount /var/0.5tbsghdd1
mount: can't find /var/0.5tbsghdd1 in /etc/fstab or /etc/mtabCode: Select all
proc /proc proc defaults 0 0
/dev/mmcblk0p1 /boot vfat defaults 0 2
/dev/mmcblk0p2 / ext4 defaults,noatime 0 1
//192.168.2.119/0.5TB\ SG\ HDD\ 1 /var/0.5tbsghdd1 cifs user=pi,pass=raspberry,uid=1006,_netdev 0 0
The mount point absolutely exists within /var/...
Dedicated IP for the NAS...
The share mounts 100% correctly when done manually using either set of credentials...
I am completely lost...
Someone please help me...
ps. if i have broken any forum rules I apologize in advance. Just point out my error and I'll move the post.
pss. I have already read hundreds of search results regarding samba, cifs, fstab, mtab, mount, mount.cifs, and moun -t on this forum alone... google provided me with many thousands of others... I have done lots of homework and am now asking for help. Thankyou.
psss. If this turns out to be some stupidly easy fix I will probably eat my raspberry pi