mount under /mnt made by snap apps is invisible outside snap
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd |
Confirmed
|
Wishlist
|
Unassigned |
Bug Description
There is a test case regarding automount when inserting sd card. I did something like `mount -t ext4 -o $mopts /dev/mmcblk1 /mnt/sdcard` inside the test snap command, triggered by udev rule, for example, put a new rule as below:
$ cat /etc/udev/
KERNEL=
KERNEL!
LABEL="
ACTION=="add", IMPORT{
ACTION=="add", ENV{ID_
ACTION=="add", RUN+="/usr/bin/snap run test-snap.
ACTION=="remove", RUN+="/usr/bin/snap run test-snap.
KERNEL=
LABEL="
So when the sd card is detected, the script media-automount tries to mount it into /mnt/sdcard in the snap namespace, but it's invisible in the system:
$ mountpoint /mnt/sdcard
/mnt/sdcard is not a mountpoint
Ian's comment: /mnt should be shared such that mounts to /mnt made inside the snap mount namespace will propagate to the root mount namespace
Note:the test snap I did was installed with devmode.
description: | updated |
summary: |
- mountpoint made by snap apps is invisble outside snap + mountpoint made by snap apps is invisible outside snap |
Changed in snapd: | |
importance: | Undecided → Wishlist |
/media is set up with shared propagation, so mount events done under /media within the snap mount namespace will be visible outside. /mnt is not. Can the rule be updated to use a path under /media instead?