1

I'm not even sure if my question is correct, but I got the following problem. I have an encrypted USB drive (via veracrypt) which I decrypt on boot with crypttab and which is automatically mounted for Nextcloud which required that the directories are only accessible for www-data, but I also need access for other applications like Zoneminder. Can I just add a second line to fstab and mount the LVM again with a different setting on a different location? I'm not sure if this is the right way to do this. Or, is it possible to just mount a specific directory form the /dev/mapper?

Greetings Orko

2 Answers 2

1

I did not get what you are trying to do and why, but to mount the same device on two different locations, you can use bind mounts, the content will be the same on both locations and CRUD operations will reflect on both :

/<original_mount_point> /<replicated_mount_point> none <options>,bind 0 0 

EDIT :

Since your last comment, to give pi user privilege to access the filesystem the same as www-data then you have to make pi user part of www-data group by adding it as a secondary group :

usermod -aG www-data pi 
3
  • As I mentioned I'm not even sure if I am asking the right question. So let me try again. At the moment my fstab looks something like this. '/dev/mapper/Storage /mnt/Storage ntfs defaults,nls=utf8,uid=www-data,gid=www-data,dmask=007,windows_names 0 0' So the Data is only accessible for "www-data". Right? So can I do this in the next Line? '/dev/mapper/Storage /mnt/StorageB -o uid=pi,gid=pi' I can not test this today and also even if this works i want to know if this is a good way to do this? Commented Jan 6, 2021 at 20:30
  • Why would you have NTFS inside an LVM volume? Windows cannot access LVM and Linux cannot correctly maintain NTFS as you periodically need chkdsk or defrag from Windows or Windows repair disk. Commented Jan 6, 2021 at 21:44
  • I have edited the answer, Now i did understand what do you need exactly, so no need for a secondary mount point. It's the same as @Rabin answer. Commented Jan 6, 2021 at 22:11
0

Don't mount the file system twice, you WILL corrupt it !!!

What you need to do is just add the zoneminer user (or any other user) which need write access to the group www-data and give the group write permission on the folder

# usermod -aG www-data zoneminder 
1
  • Sry I didn't see your Answer. I will try that. I didn't know that www-data is a group I thought that it's a user. So I guess there is no way to mount only one folder for one group and another folder for a different group? To be clear both folder are on the same device. Commented Jan 6, 2021 at 21:18

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.