Filesystem mounted by apache invisible to others

outdoorbits

New Member
Joined
Jan 10, 2022
Messages
1
Reaction score
0
Credits
16
For a Raspberry Pi application (https://github.com/outdoorbits/little-backup-box) I work on a web UI. This allows to mount USB-devices and perform backups. By the php-website a bash-script is triggered and this executes finally:

Code:
sudo mount /dev/sda1 /media/storage/ -o umask=0


User www-data is member of sudoers. The relevant filesystem is defined like this:

Code:
sudo mkdir -p "/media/storage"
sudo chown -R www-data:www-data "/media"
sudo chmod -R 777 "/media"
sudo setfacl -Rdm g:www-data:rw "/media"


By the website I can check

Code:
lsblk


and get

Code:
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda           8:0    0 931.5G  0 disk
`-sda1        8:1    0 931.5G  0 part /media/storage
mmcblk0     179:0    0  14.8G  0 disk
|-mmcblk0p1 179:1    0   256M  0 part /boot
`-mmcblk0p2 179:2    0  14.6G  0 part /


Just like expected, /media/storage is mounted. But ...


Via ssh as user pi at the same time lsblk prints:

Code:
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda           8:0    0 931.5G  0 disk
└─sda1        8:1    0 931.5G  0 part
mmcblk0     179:0    0  14.8G  0 disk
├─mmcblk0p1 179:1    0   256M  0 part /boot
└─mmcblk0p2 179:2    0  14.6G  0 part /


/media/storage is not listed and the mountpoint is empty. It is the same with

Code:
sudo -u www-data lsblk


or

Code:
sudo lsblk


Files in /media are available to all, web UI and ssh.

It's the same with samba. I would like to share these mounts by samba, but the folder /media/storage is also empty for samba...

What happens to the mounts?
 

Members online


Latest posts

Top