You are not logged in.
Pages: 1
I'm trying to mount an sshfs share when arch boots using the rc.local file.
So far, my efforts have failed -- the drive will not mount in rc.local, but it mounts just fine when I run the same command after logging in.
I thought at first that it might be my rc.local file that wasn't being read correctly or had incorrect permissions, but I added an extra line that touches a new file in my home directory, and that works just fine.
Any ideas on what I might be doing wrong?
Offline
Can't you use fstab?
Offline
You have to mount it as the user whose public key is accepted by ssh server. rc.local file is mounted by root. Did you try to mount sshfs as root? Paste your rc.local file plz and try to enter the same command after booting.
You may be interested in my rc.local file:
sudo -u ambi mount /mnt/gamma
and fstab entry:
sshfs#stankowskip@gamma.mini.pw.edu.pl: /mnt/gamma fuse comment=sshfs,noauto,users,uid=1000,reconnect,transform_symlinks,BatchMode=yes
Ambi's uid is 1000. I have turned automouting off because root cannot log to my ssh server.
More info about sshfs in fstab: http://ubuntuforums.org/showthread.php?t=430312
And the simpler way (without fstab) is to enter in rc.conf:
sudo -u ambi stankowskip@gamma.mini.pw.edu.pl: /mnt/gamma
Last edited by Ambi (2008-05-20 19:48:21)
Offline
lucke: I tried fstab with the following entry and it did not mount. Then, after logged in, I ran command "sudo mount -a" and the drive mounted
sshfs#user@server.org:/media/raid0 /media/netdrive1 fuse defaults 0 0
You have to mount it as the user whose public key is accepted by ssh server. rc.local file is mounted by root. Did you try to mount sshfs as root? Paste your rc.local file plz and try to enter the same command after booting.
You may be interested in my rc.local file:
sudo -u ambi mount /mnt/gamma
and fstab entry:
sshfs#stankowskip@gamma.mini.pw.edu.pl: /mnt/gamma fuse comment=sshfs,noauto,users,uid=1000,reconnect,transform_symlinks,BatchMode=yes
Ambi's uid is 1000. I have turned automouting off because root cannot log to my ssh server.
More info about sshfs in fstab: http://ubuntuforums.org/showthread.php?t=430312And the simpler way (without fstab) is to enter in rc.conf:
sudo -u ambi stankowskip@gamma.mini.pw.edu.pl: /mnt/gamma
I think the entry in my rc.local file accounts for the need to mount as the correct user, but I may be wrong. Here is my rc.local file:
su - noah -c "sshfs nchase.homelinux.org:/media/raid0 /media/netdrive1"
I will try using your fstab and rc.local file to see what I can come up with.
edit: my rc.local file and fstab entry are pretty much the same as yours now, I think, and I am still not getting results. Here they are in full:
sudo -u noah mount /media/netdrive1
sshfs#noah@nchase.homelinux.org:/media/raid0 /media/netdrive1 fuse comment=sshfs,noauto,users,uid=1000,reconnect,transform_symlinks,BatchMode=yes
Do I need to add a module or daemon to /etc/rc.conf to get this to work on startup?
Last edited by nchase (2008-05-20 20:15:58)
Offline
not sure, there is fuse module in my rc.conf.
Try to execute "sudo -u noah mount /media/netdrive1" as root and paste the output.
Offline
If you put auto in the 4th column of fstab, it should mount on boot.
Offline
not sure, there is fuse module in my rc.conf.
Try to execute "sudo -u noah mount /media/netdrive1" as root and paste the output.
fusermount: failed to open current directory: permission denied
I think I assumed this was working before, because I had used the 'su' command to change to root.
Does this mean my permissions are not properly set up? What now?
Last edited by nchase (2008-05-20 20:35:28)
Offline
If you put auto in the 4th column of fstab, it should mount on boot.
changed noauto to auto -- didn't work
Offline
the permissions for the netdrive1 directory, could they be any more open? here is the output of 'ls':
drwxrwxrwx 2 root root 4096 2008-05-18 22:04 netdrive1
Offline
I used a hack to fix this. If I add a 'modprobe fuse' line before I mount the share in rc.local, it works.
Offline
I used a hack to fix this. If I add a 'modprobe fuse' line before I mount the share in rc.local, it works.
That's what MODULES field in /etc/rc.conf is for - just add 'fuse' there, and you don't have to do any extra modprobbing in rc.local.
Offline
nchase wrote:I used a hack to fix this. If I add a 'modprobe fuse' line before I mount the share in rc.local, it works.
That's what MODULES field in /etc/rc.conf is for - just add 'fuse' there, and you don't have to do any extra modprobbing in rc.local.
I know, but it was there before and it didn't work. For some reason it works this way, but not as part of the module list in rc.conf.
Last edited by nchase (2008-05-22 23:18:56)
Offline
Pages: 1