[Trilug-ontopic] raspberry pi - mounting a sshfs drive at startup

Greg Brown gwbrown1 at gmail.com
Mon Jul 29 21:52:30 EDT 2013


This is frustrating.  I have sshfs working (I can manually mount a drive
very easily using keys without passwords).  I've tried to execute a script
in /etc/rc.local to mount the drive at restart and that didn't work.  I've
tried putting something in fstab and that didn't work. Last I tried to put
a line in root's crontab starting with (@reboot) and that didn't work yet
if I run the command from the command line as root or pi both will work.

sudo crontab -l
@reboot sshfs gwbrown1 at 192.168.16.2:/Users/gwbrown1/motion/blue /mount -o
allow_other

(upon reboot)
/dev/root on / type ext4 (rw,noatime,data=ordered)
devtmpfs on /dev type devtmpfs
(rw,relatime,size=183620k,nr_inodes=45905,mode=755)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=38376k,mode=755)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=76740k)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620)
/dev/mmcblk0p1 on /boot type vfat
(rw,relatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=ascii,shortname=mixed,errors=remount-ro)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)

As you can see, no "mount" mounted

pi at raspberrypi ~ $ sudo sshfs gwbrown1 at 192.168.16.2:/Users/gwbrown1/motion/blue
/mount -o allow_other
pi at raspberrypi ~ $
pi at raspberrypi ~ $ mount
(deleted)
gwbrown1 at 192.168.16.2:/Users/gwbrown1/motion/blue on /mount type fuse.sshfs
(rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)

Ta-Da!  Ok, well how do I get that to happen at startup each time?

Greg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.trilug.org/pipermail/trilug-ontopic/attachments/20130729/b5d50b98/attachment.html>


More information about the Trilug-ontopic mailing list