glensc / plex-fuse

Plex FUSE Filesystem: Mount Plex Media Server as local filesystem
BSD 3-Clause "New" or "Revised" License
7 stars 1 forks source link

Contrib: Add remount-fuse.c source code #100

Closed glensc closed 6 months ago

glensc commented 6 months ago

This can be used to remount docker container volume from host.

Let's assume plex container is bind mounted with:

volumes:
- /run/user/1000/plexfuse/Plex:/media/plexfuse/Plex

you remount /run/user/1000/plexfuse/Plex in the host, but plex container remains with detached fuse connection.

To solve this need to update mount in container.

Build and install the tool:

gcc contrib/remount-fuse.c -o remount-fuse
sudo install -s remount-fuse /usr/local/bin/remount-fuse

To remount the volume in running container:

pid=$(pidof 'Plex Media Server')
sudo remount-fuse "$pid" /run/user/1000/plexfuse/Plex /media/plexfuse/Plex

Source from: