[GH-ISSUE #5620] How to use /media in --chroot? #3046

Closed
opened 2026-05-05 09:41:39 -06:00 by gitea-mirror · 0 comments
Owner

Originally created by @azurvii on GitHub (Jan 26, 2023).
Original GitHub issue: https://github.com/netblue30/firejail/issues/5620

Or how to use portable hard disks in chroots? I'm on Debian bullseye, firejail version 0.9.64.4.

I tried whitelist /media and whitelist /media/* in the chroot profile, but it did not seem to have the expected effect in the chroot. In chroot it's empty while in host it contains the mounted portable disk partitions.

In a different try, I was able to find the device in the chroot's /dev/sdb together with its partitions, so it seems it could see the hard disk. I tried mount -o ro -t ntfs /dev/sdb1 /home/me/mnt/ as root, and it did get mounted. However, this path /home/me/mnt/ is only mounted for the user root. If I use the regular user me in chroot, the exact same path /home/me/mnt/ is not mounted (no content, with the folder's user and group as me:me, as it was created). I cannot invoke mount as a regular user due to permission. I guess this might be chroot in play, but I don't quite understand this behavior.

Originally created by @azurvii on GitHub (Jan 26, 2023). Original GitHub issue: https://github.com/netblue30/firejail/issues/5620 Or how to use portable hard disks in chroots? I'm on Debian bullseye, `firejail version 0.9.64.4`. I tried `whitelist /media` and `whitelist /media/*` in the chroot profile, but it did not seem to have the expected effect in the chroot. In chroot it's empty while in host it contains the mounted portable disk partitions. In a different try, I was able to find the device in the chroot's `/dev/sdb` together with its partitions, so it seems it could see the hard disk. I tried `mount -o ro -t ntfs /dev/sdb1 /home/me/mnt/` as root, and it did get mounted. However, this path `/home/me/mnt/` is only mounted for the user root. If I use the regular user `me` in chroot, the exact same path `/home/me/mnt/` is not mounted (no content, with the folder's user and group as me:me, as it was created). I cannot invoke `mount` as a regular user due to permission. I guess this might be chroot in play, but I don't quite understand this behavior.
gitea-mirror 2026-05-05 09:41:39 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#3046
No description provided.