Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fstab not mounting bindfs mapping #60

Open
jrussell88 opened this issue Nov 10, 2017 · 8 comments
Open

Fstab not mounting bindfs mapping #60

jrussell88 opened this issue Nov 10, 2017 · 8 comments

Comments

@jrussell88
Copy link

jrussell88 commented Nov 10, 2017

In order to access the hard drive from my out-of-action MacBook, I attached my 'Home' partition via a USB connection to another machine. Both running Ubuntu 17.04 As I'm the second user on that PC, that machine's first user has ownership rights over my files, and I have not (due to Ubuntu using the UID- and GID-numbers to define file ownership).

Ubuntu automounts the USB drive at: /media/me/Home.

To fix the permissions to give me temporary access, I added a duplicate mount point: /media/Home and tested the command:

sudo bindfs --map=other_user/me --create-for-user=other_user --create-for-group=other_user /media/me/Home /media/Home

which, although the gid remains the other user's, gives me ownership of my files as the second user on the current system, and default ownership of any new files by uid 1000.

I added a line in fstab to achieve the same thing:

/media/me/Home /media/Home fuse.bindfs map=other_user/me,create-for-user=other_user,create-for-group=other_user 0 0

The fstab entry doesn't work - I don't have access to the mount point and my partition isn't mounted.

In Nautilus, the bindfs /media/Home partition displays the error: 'This partition could not be displayed. You do not have the permissions necessary to view the contents of "Home".
In the command line, ls -la returns:

ls: cannot open directory '/media/Home/': Permission denied

sudo ls -la returns:

total 0

Is there something else I should do?

@mpartel
Copy link
Owner

mpartel commented Nov 11, 2017

Strange, I'm not able to reproduce the issue with a similar fstab line, although I'm just mounting an ordinary directory, not an external disk.

  • Does it work if you mount from an ordinary directory instead?
  • If you do sudo mount /media/Home, what does it say?

@jrussell88
Copy link
Author

I get the same result from /Home and from /home/me/Documents/Home.

sudo mount /media/Home

works as expected. Could it be a timing issue with the mounting of USB drives?

@mpartel
Copy link
Owner

mpartel commented Nov 11, 2017

I get the same result from /Home and from /home/me/Documents/Home

So, just to be clear, here you're mounting an ordinary directory to an ordinary directory, and neither has anything to do with any USB drives? And fstab still doesn't work?

Could it be a timing issue with the mounting of USB drives?

Good idea, it might be. What happens if you manually mount them in the wrong order?

Another possibility is that whatever reads fstab just can't handle the same path occurring twice.

@jrussell88
Copy link
Author

jrussell88 commented Nov 11, 2017

My misunderstanding. I switched the USB drive to mount from different folders. I've tried replacing the USB partition with a local folder, and mounting it in /media/Home with the same options and that works as expected.

The USB drives automount during boot; fstab mounts the bindfs drive.
I added rootdelay=20 to Grub's boot line
I added the options noauto,x-systemd.automount to fstab, to delay mounting

Neither had any effect

@jrussell88
Copy link
Author

jrussell88 commented Nov 11, 2017

Drives is set to default automount options, and the USB partitions are mounted on boot. I tried setting nofail,noauto for the partition and the same options for Bindfs, but the system wouldn't boot.

@jrussell88
Copy link
Author

I altered the fstab to delay the mount until the network was up:

/media/john/Home /media/Home fuse.bindfs map=panadda/john,create-for-user=panadda,create-for-group=panadda,_netdev 0 0

And until I accessed the mount point:

/media/john/Home /media/Home fuse.bindfs map=panadda/john,create-for-user=panadda,create-for-group=panadda,nofail,noauto,x-gvfs-show 0 0

But neither worked.

@mpartel
Copy link
Owner

mpartel commented Nov 15, 2017

Did you try adding the fstab lines after boot and doing the mounting manually (without rebooting)? This might give us some information.

@kdub0154
Copy link

Was this ever figured out? I can't seem to get this to work either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants