Skip to content
This repository has been archived by the owner on Oct 16, 2020. It is now read-only.

Installing Mount Helpers in /sbin #358

Closed
eatnumber1 opened this issue May 10, 2015 · 8 comments
Closed

Installing Mount Helpers in /sbin #358

eatnumber1 opened this issue May 10, 2015 · 8 comments

Comments

@eatnumber1
Copy link

It's not possible to install mount helpers in /sbin due to it being a symlink to the read-only /usr/sbin.

A bit of context. If you create a new filesystem, and want to be able to mount it using mount -t myfs, the way mount works is that you have to install a binary named mount.myfs in /sbin. As far as I'm aware, this cannot be changed; the directory that mount searches in is fixed as /sbin.

In CoreOS, since /sbin is a symlink to /usr/sbin, it's not easily possible to install new filesystem mount helpers. A workaround is to delete the /sbin symlink, make it a directory, and symlink everything from /usr/sbin into /sbin at boot. An example unit file for this workaround follows.

[Unit]
Description=Make /sbin not a symlink
Requires=network-online.target
After=network-online.target

[Service]
ExecStart=/bin/mkdir -p /opt/bin
ExecStart=/usr/bin/curl -s -L -o /opt/bin/renameat2 https://gist.github.com/eatnumber1/f97ac7dad7b1f5a9721f/raw/3db4dbf58afd8d0024bef298806eec4f77c3e448/renameat2.x86_64
ExecStart=/bin/chmod +x /opt/bin/renameat2
ExecStart=/bin/mkdir /sbin.new
ExecStart=/bin/sh -c 'for f in /usr/sbin/*; do ln -s $f /sbin.new; done'
ExecStart=/opt/bin/renameat2 -e /sbin.new /sbin
ExecStart=/bin/rm -rf /sbin.new
RemainAfterExit=yes
Type=oneshot
@marineam
Copy link

What filesystem are you trying to mount?

On Sun, May 10, 2015 at 2:48 PM, Russell Harmon [email protected]
wrote:

It's not possible to install mount helpers in /sbin due to it being a
symlink to the read-only /usr/sbin.

A bit of context. If you create a new filesystem, and want to be able to
mount it using mount -t myfs, the way mount works is that you have to
install a binary named mount.myfs in /sbin. As far as I'm aware, this
cannot be changed, the directory that mount searches in is fixed as /sbin.

In CoreOS, since /sbin is a symlink to /usr/sbin, it's not easily
possible to install new filesystem mount helpers. A workaround is to delete
the /sbin symlink, make it a directory, and symlink everything from
/usr/sbin into /sbin at boot. An example unit file for this workaround
follows.

[Unit]
Description=Make /sbin not a symlink

[Service]
ExecStart=/bin/rm -rf /sbin
ExecStart=/bin/mkdir /sbin
ExecStart=/bin/sh -c 'for f in /usr/sbin/*; do ln -s $f /sbin; done'
RemainAfterExit=yes
Type=oneshot


Reply to this email directly or view it on GitHub
#358.

@eatnumber1
Copy link
Author

A FUSE filesystem, ObjectiveFS. AFAIK, this is the standard way of installing fuse filesystems as first-class filesystems on the machine.

@marineam
Copy link

Hm, looks like umount respects helper= and uhelper= options to change the default path to the helper but mount does not. I'm not sure if extending the meaning of helper= would be acceptable in upstream util-linux or not but perhaps worth investigating.

Certainly you can do this without any problem inside sufficiently privileged containers but I don't have a better suggestion for doing this on the base CoreOS system right now.

@flipchart
Copy link

+1 I've got the same issue with trying to add cifs mount support. Having to fall back to using the mount.cifs binary directly

@miguelangel-nubla
Copy link

+1
Trying to load glusterfs

@owenhaynes
Copy link

+1
trying to load glusterfs as well.

@mischief
Copy link

can you simply mount --bind the helper in /sbin?

@bgilbert
Copy link
Contributor

Thank you for reporting this issue. Unfortunately, we don't think we'll end up addressing it in Container Linux.

As we recently announced, we're working on a successor to Container Linux, and we expect most major development to occur there instead. Meanwhile, Container Linux won't see many new features, but will still be fully maintained into 2020. Stay tuned for more details about that.

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

No branches or pull requests

8 participants