Why is mount -a not mounting fuse drive properly when executed remotely (via Fabric)?
Posted
by
Jim D
on Server Fault
See other posts from Server Fault
or by Jim D
Published on 2011-03-15T15:40:15Z
Indexed on
2011/03/15
16:12 UTC
Read the original article
Hit count: 317
This is a weird bug and I'm not sure where it's coming from. Here's a quick run down of what I'm doing.
I'm trying to mount a FUSE drive to an Amazon EC2 instance running Ubuntu 10.10 using s3fs (FUSE over Amazon). s3fs is compiled from source according to the instructions etc. I've also added an entry to /etc/fstab so that the drive mounts on boot. Here's what /etc/fstab
looks like:
# /etc/fstab: static file system information.
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
LABEL=uec-rootfs / ext4 defaults 0 0
/dev/sda2 /mnt auto defaults,nobootwait,comment=cloudconfig 0 2
/dev/sda3 none swap sw,comment=cloudconfig 0 0
s3fs#mybucket /mnt/s3/mybucket fuse default_acl=public-read,use_cache=/tmp,allow_other 0 0
So the good news is that this works fine. On reboot the connection mounts correctly. I can also do:
$ sudo umount /mnt/s3/mybucket
$ sudo mount -a
$ mountpoint /mnt/s3/mybucket
/mnt/s3/mybucket is a mountpoint
Great, right?
Well here's the problem. I'm using Fabric to automate the process of building and managing this instance. I noticed I was getting this error message when using Fabric to build s3fs and set up the mount process:
mountpoint: /mnt/s3/mybucket: Transport endpoint is not connected
I isolated it down the the problem and built a fabric task that reproduces the problem:
def remount_s3fs():
sudo("mount -a")
Which does:
[ec2-xx-xx-xx-xx.compute-1.amazonaws.com] Executing task 'remount_s3fs'
[ec2-xx-xx-xx-xx.compute-1.amazonaws.com] sudo: mount -a
[And yes, I was sure to unmount it before running this task.] When I check the mount using mountpoint I get:
$ mountpoint /mnt/s3/mybucket
mountpoint: /mnt/s3/mybucket: Transport endpoint is not connected
Done.
But if I run sudo mount -a
at the command line, it works. Hrm.
Here is that fab task output again, this time in full debug mode:
[ec2-xx-xx-xx-xx.compute-1.amazonaws.com] Executing task 'remount_s3fs'
[ec2-xx-xx-xx-xx.compute-1.amazonaws.com] sudo: sudo -S -p 'sudo password:' /bin/bash -l -c "mount -a"
Again, I get that transport endpoint not connected error. I've also tried copying and pasting the exact command run into my ssh session (i.e. sudo -S -p 'sudo password:' /bin/bash -l -c "mount -a"
) and it works fine.
So...that's my problem. Any ideas?
© Server Fault or respective owner