Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
[Solved] Mount permissions HDD
[Solved] Mount permissions HDD
Hello,
currently I installed mpd on my Debian 9. Mpd works fine, except that it cannot play music from my HDD I share with Windows. The HDD is ntfs formatted and owned by root. To solve the resulting permission problem for mpd, I thought to automatically mount the HDD with user permissions. In the moment I have created the respective folder for the mounting in /media
I wanted to extend fstab by the following line:
UUID=MediaUUID /media/Volume ntfs-3g defaults, auto, uid=Myuid, gid=????, umask=??? 0 0
Now I have the problem that I don't know which ID I have to use for the group. Which group should one normally use as group owner for mounted HDDs? I have all my data on this HDD, not only music. Thus, audio is maybe not the right group.
And finally, which permissions should I assign? Here I thought about 023, but I am not sure if this is appropriate.
Thanks for your help!
currently I installed mpd on my Debian 9. Mpd works fine, except that it cannot play music from my HDD I share with Windows. The HDD is ntfs formatted and owned by root. To solve the resulting permission problem for mpd, I thought to automatically mount the HDD with user permissions. In the moment I have created the respective folder for the mounting in /media
I wanted to extend fstab by the following line:
UUID=MediaUUID /media/Volume ntfs-3g defaults, auto, uid=Myuid, gid=????, umask=??? 0 0
Now I have the problem that I don't know which ID I have to use for the group. Which group should one normally use as group owner for mounted HDDs? I have all my data on this HDD, not only music. Thus, audio is maybe not the right group.
And finally, which permissions should I assign? Here I thought about 023, but I am not sure if this is appropriate.
Thanks for your help!
Last edited by Lamios on 2018-01-26 20:18, edited 1 time in total.
Re: Mount permissions HDD
If you share a HDD with Windows, why set the owner to root, and not to your user ID?
why not simply
chown -R lambios:lambios /media/Volume
Then you won't have permission problems.
Your user is probably a member of the groups needed, as you say Mpd works fine.
why not simply
chown -R lambios:lambios /media/Volume
Then you won't have permission problems.
Your user is probably a member of the groups needed, as you say Mpd works fine.
-
- Global Moderator
- Posts: 3049
- Joined: 2017-09-17 07:12
- Has thanked: 5 times
- Been thanked: 132 times
Re: Mount permissions HDD
Because that does not work with NTFS. The NTFS format ignores Unix permissions so they have to be set at mount time with mount options as in the OP's post.dotlj wrote:why not simply
chown -R lambios:lambios /media/Volume
Re: Mount permissions HDD
Thank you for your answers.
I had been able to find the the group for my user.
Now the only question is, which permissions should I set to maintain privacy?
I had been able to find the the group for my user.
Now the only question is, which permissions should I set to maintain privacy?
Re: Mount permissions HDD
I don't understand why you're having trouble, when I mount an ntfs partition I am able to access everything on it with a simple mount command:
I can read and write files as a regular user just fine. I do have pkg ntfs-3g installed.
Code: Select all
# mount /dev/sdb1 /mnt
# mount | grep mnt
/dev/sdb1 on /mnt type fuseblk (rw,relatime,user_id=0,group_id=0,allow_other,blksize=4096)
What privacy? They are music files. Who do you want privacy from?which permissions should I set to maintain privacy?
Be sure no spaces in your string of options, but I would think just defaults should work for fstab entry. Just get it working first and worry about fine-tuning later. Don't make it complicated unless you have to.UUID=MediaUUID /media/Volume ntfs-3g defaults, auto, uid=Myuid, gid=????, umask=??? 0 0
resigned by AI ChatGPT
Re: Mount permissions HDD
Thanks.
I mounted the HDD. The mounting worked fine. However, mpd is not able to read music from the HDD (but is able to read some from /home). In the moment umask=023, but I also changed it to 000 once, which did not change anything.
The first time I accidentally copied the line with the spaces and than mpd had been playing music from the HDD, but I got some problems during unmounting. Thanks for the hint with the spaces, I wouldn't have seen that. Did I make a mistake in the string of options?
I mounted the HDD. The mounting worked fine. However, mpd is not able to read music from the HDD (but is able to read some from /home). In the moment umask=023, but I also changed it to 000 once, which did not change anything.
The first time I accidentally copied the line with the spaces and than mpd had been playing music from the HDD, but I got some problems during unmounting. Thanks for the hint with the spaces, I wouldn't have seen that. Did I make a mistake in the string of options?
Code: Select all
UUID=MyUUID /media/Volume ntfs-3g defaults,auto,uid=Myuid,gid=Mygid,umask=023 0 0
Re: Mount permissions HDD
You're just making it too hard, and it's really not that complicated. I think you should study more about linux with ntfs before you really wreck something. Please don't type in any commands you find on the internet.
have you tried with just the default mount options? Who told you that you needed all this complicated stuff?
Is this some kind of code because you don't want to copy and paste, or you think people on here will hack your UUID, UID, and GID or what? What's the umask=23 supposed to do?UUID=MyUUID /media/Volume ntfs-3g defaults,auto,uid=Myuid,gid=Mygid,umask=023 0 0
have you tried with just the default mount options? Who told you that you needed all this complicated stuff?
resigned by AI ChatGPT
Re: Mount permissions HDD
can you access the ntfs partition normally? through filemanager, terminal?
did you look at the search results i provided?
did you look at the search results i provided?
Re: Mount permissions HDD
I did read your search results. Most of them I had read during my research before my post.
The ntfs is accessible and I am able to write on it or play music with another player.
Permissions and ownership for the test music library I created in /home are identical to the ones from my music folder on the HDD.
ls -al on the HDD gives the following (I am not sure if it is helpful):
Could it be caused by the second line, which ends with .. and has root as owner?
I also tried to run mpd as user. I than only got the following error after reboot: Connection to "Default" (localhost:6600) failed
But I think that does not reflect the problem that mpd cannot play music from HDD when set to user mpd?
The ntfs is accessible and I am able to write on it or play music with another player.
Permissions and ownership for the test music library I created in /home are identical to the ones from my music folder on the HDD.
ls -al on the HDD gives the following (I am not sure if it is helpful):
Code: Select all
:/media/Volume# ls -al
total 784
drwxr-xr-- 1 user user 8192 Jan 23 12:20 .
drwxr-xr-x 5 root root 4096 Jan 21 16:19 ..
drwxr-xr-- 1 user user 4096 Jan 21 18:41 Pictures
drwxr-xr-- 1 user user 32768 Jan 16 14:18 Documents
drwxr-xr-- 1 user user 65536 Jan 13 23:08 Music
I also tried to run mpd as user. I than only got the following error after reboot: Connection to "Default" (localhost:6600) failed
But I think that does not reflect the problem that mpd cannot play music from HDD when set to user mpd?
Re: Mount permissions HDD
No, it's not because of the second line.Lamios wrote:
drwxr-xr-- 1 user user 65536 Jan 13 23:08 Music
<snip>
Could it be caused by the second line, which ends with .. and has root as owner?
<snip>
...the problem that mpd cannot play music from HDD when set to user mpd?
resigned by AI ChatGPT
Re: Mount permissions HDD
0k. Is there anything I could post that might help to find the cause for the problem?
Re: Mount permissions HDD
It's because you have removed the search bit for the directories. I didn't even know you could do this on ntfs, how you managed it? You don't need to change permissions and ownership without understanding what it does. I really don't know how to fix it on ntfs. I never used chmod or chown on ntfs before. I always mount ntfs with default options and owner is root:root with 777 permissions and that works fine for me. I have never seen an ntfs part mounted on linux that had two different owners on the files/dirs.Lamios wrote:0k. Is there anything I could post that might help to find the cause for the problem?
If that really is an ntfs partition, then you are probably doing something odd to mount it? Maybe you installed some kind of add-on that you forgot to mention?
Code: Select all
$ mkdir foodir
$ ls -al
total 12
drwxr-xr-x 3 me me 4096 Jan 23 18:13 .
drwxr-xr-x 20 me me 4096 Jan 23 18:13 ..
drwxr-xr-x 2 me me 4096 Jan 23 18:13 foodir
$ su
Password:
# chown vnstat:vnstat foodir
# chmod 754 foodir
# exit
exit
$ ls -al
total 12
drwxr-xr-x 3 me me 4096 Jan 23 18:13 .
drwxr-xr-x 20 me me 4096 Jan 23 18:13 ..
drwxr-xr-- 2 vnstat vnstat 4096 Jan 23 18:13 foodir
$ ls -al foodir
ls: cannot access 'foodir/.': Permission denied
ls: cannot access 'foodir/..': Permission denied
total 0
d????????? ? ? ? ? ? .
d????????? ? ? ? ? ? ..
resigned by AI ChatGPT
Re: Mount permissions HDD
In don't know. All I did (as far as I know) is adding this line to /etc/fstab and creating the folder Volume in /media.
What does it mean to
Code: Select all
UUID=0BE7094A0BE7094A /media/Volume ntfs-3g defaults,auto,uid=Myuid,gid=Mygid,umask=023 0 0
What does it mean to
and how do you see it?have removed the search bit for the directories
Re: Mount permissions HDD
Code: Select all
defaults,auto,uid=Myuid,gid=Mygid,umask=023 0 0
^ ^ ^ ^ ^
good| | | | |
why? -| | | |
why? -| | |
why? -| |
wtf? -|
drwxrwxrwx
^ ^ ^
| | |
|________ dir srch bits
resigned by AI ChatGPT
Re: Mount permissions HDD
0k, thanks. I used the guide on https://ubuntuforums.org/showthread.php?t=1604251 Maybe it had not been the best way to do it.
Re: Mount permissions HDD
To say the least, following advice from 2010 of a different distro than Debian isn't likely to be the best way to proceed.Lamios wrote:0k, thanks. I used the guide on https://ubuntuforums.org/showthread.php?t=1604251 Maybe it had not been the best way to do it.
Tell bw123 what you have entered for uid and gid, there is no reason for you to keep that information secret, especially if you want help fixing the problem. bw123 is trying to help you and the rest of us watching would warn you if you didn't get good advice.
At the same time, open a terminal and enter
Code: Select all
id
- sunrat
- Administrator
- Posts: 6497
- Joined: 2006-08-29 09:12
- Location: Melbourne, Australia
- Has thanked: 118 times
- Been thanked: 476 times
Re: Mount permissions HDD
I'll show you mine. I have an external drive where I back up and sync between 2 computers and use ntfs as it needs to be accessible in Windows too.
uid and gid is needed to keep consistency with sync. You can use name or numerical id, curiously mine is
so I just put name. You don't need umask and don't need rw or noatime or noauto (or auto) if you just use defaults.
Try
"Removing the search bits" is what the umask does. It's called "execute" bit and you can't enter a directory without it.
Code: Select all
LABEL=green-media /mnt/green-media auto noauto,user,uid=roger,gid=roger,rw,noatime 0 0
Code: Select all
$ id roger
uid=1000(roger) gid=1004(roger)
Try
Code: Select all
UUID=0BE7094A0BE7094A /media/Volume ntfs-3g defaults,uid=<whatever>,gid=<whatever> 0 0
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
Re: Mount permissions HDD
Yes, it had not been the best idea to follow and outdated tutorial from another distro
Sorry for not having shared this content in before. I thought it is better not to make things public, when I am not sure if one should make it public
Here is the line I wrote at the end of /etc/fstab
and this is the output from id
So I basically just have to delete umask? And follow the code from sunrat.
Thanks for your help!
Sorry for not having shared this content in before. I thought it is better not to make things public, when I am not sure if one should make it public
Here is the line I wrote at the end of /etc/fstab
Code: Select all
UUID=0BE7094A0BE7094A /media/Volume ntfs-3g defaults,auto,uid=1000,gid=1000,umask=023 0 0
Code: Select all
uid=1000(Lamios) gid=1000(Lamios) groups=1000(Lamios),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),108(netdev),114(bluetooth),115(lpadmin),119(scanner)
Thanks for your help!
Re: Mount permissions HDD
I deleted the umask part and now everything works again
Can I let auto where it is? I think it is for automatic mount during booting?
Can I let auto where it is? I think it is for automatic mount during booting?