[Solved] Mount permissions HDD

New to Debian (Or Linux in general)? Ask your questions here!

Re: Mount permissions HDD

Postby Lamios » 2018-01-24 00:09

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.
Lamios
 
Posts: 31
Joined: 2017-12-09 23:26

Re: Mount permissions HDD

Postby Thorny » 2018-01-24 09:10

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.

To say the least, following advice from 2010 of a different distro than Debian isn't likely to be the best way to proceed.

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
then copy and paste that information into a code box in your reply. If you are the user that installed Debian then it is likely to be 1000 anyway, just like mine.
User avatar
Thorny
 
Posts: 542
Joined: 2011-02-27 13:40

Re: Mount permissions HDD

Postby sunrat » 2018-01-24 12:40

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.
Code: Select all
LABEL=green-media    /mnt/green-media    auto   noauto,user,uid=roger,gid=roger,rw,noatime   0   0

uid and gid is needed to keep consistency with sync. You can use name or numerical id, curiously mine is
Code: Select all
$ id roger
uid=1000(roger) gid=1004(roger)

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
Code: Select all
UUID=0BE7094A0BE7094A /media/Volume ntfs-3g defaults,uid=<whatever>,gid=<whatever> 0 0


"Removing the search bits" is what the umask does. It's called "execute" bit and you can't enter a directory without it.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!
User avatar
sunrat
 
Posts: 2263
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Re: Mount permissions HDD

Postby Lamios » 2018-01-24 23:30

Yes, it had not been the best idea to follow and outdated tutorial from another distro :oops:
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


and this is the output from id
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)


So I basically just have to delete umask? And follow the code from sunrat.

Thanks for your help!
Lamios
 
Posts: 31
Joined: 2017-12-09 23:26

Re: Mount permissions HDD

Postby Lamios » 2018-01-25 13:46

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?
Lamios
 
Posts: 31
Joined: 2017-12-09 23:26

Re: Mount permissions HDD

Postby pendrachken » 2018-01-25 18:00

You can mask the NTFS ACL permissions with Linux / POSIX permissions:

Code: Select all
Linux compatible permissions
Permissions on a Linux system are normally set to 755 for folders and 644 for files. It is recommended to keep these permissions in use for the NTFS partition as well if you use the partition on a regular basis. The following example assigns the above permissions to a normal user:

# Mount internal Windows partition with linux compatible permissions, i.e. 755 for directories (dmask=022) and 644 for files (fmask=133)
/dev/NTFS-partition(or UUID=....)  /mnt/windows  ntfs-3g uid=username,gid=users,dmask=022,fmask=133 0 0



You need dmask and fmask, not umask.

Good place to find most config options[1] for nearly anything is the arch wiki. You may have to dig around for slight variations with where Debian stores config files ETC., but the actual configuration is usually the exact same. Gentoo wiki is also, or at least was also, a good place to look for config options.


[1] As always, use common sense when looking for config options. ARCH names may not align 100% with Debian naming conventions. You can't install ARCH packages directly on Debian without recompiling and Debianizing the sources, etc. etc. etc.


EDIT: also read the next few lines down from this on https://wiki.archlinux.org/index.php/NTFS-3G to see how you can set up mounting under one user and allowing all users of a specific group access too.
fortune -o
Your love life will be... interesting.
:twisted: How did it know?

The U.S. uses the metric system too, we have tenths, hundredths and thousandths of inches :-P
pendrachken
 
Posts: 1315
Joined: 2007-03-04 21:10
Location: U.S.A. - WI.

Re: Mount permissions HDD

Postby Thorny » 2018-01-25 18:09

From the manual page for fstab
defaults
use default options: rw, suid, dev, exec, auto, nouser, and async.

So, that "auto" is redundant but it won't stop it from working.

When you have a question, it is always a good idea to refer to the man page.
User avatar
Thorny
 
Posts: 542
Joined: 2011-02-27 13:40

Re: Mount permissions HDD

Postby Lamios » 2018-01-25 18:42

Thank you for all these helpful informations!

I altered the line to the following:
Code: Select all
UUID=0BE7094A0BE7094A /media/Volume ntfs-3g defaults,uid=1000,gid=1000,dmask=022,fmask=133 0 0

Now it is not possible, to write to the HDD anymore. What did I do wrong?
Lamios
 
Posts: 31
Joined: 2017-12-09 23:26

Re: Mount permissions HDD

Postby bw123 » 2018-01-25 19:08

I altered the line...[in fstab]...
...Now it is not possible, to write to the HDD anymore. What did I do wrong?


Sometimes it is easier to understand the effect of an fstab entry (or mount command) by looking at the output of the mount command and see what the options look like.

Code: Select all
man mount
man grep
mount | grep Volume


What you did wrong? You used something on the internet without understanding it. This is just a bad habit to get into.

Experimenting is good, but do it on a "safe" or test partition/data/fs first. Debian seems to have really good defaults for a lot of things. Permissions and ownership are things you can spend years figuring out. There's really no need to make things complicated.

When you get old and your memory start to fail, you won't remember these complicated setups you did when you were young. If you do make changes, put notes to yourself in the files you change, like fstab. Drop a little README into a directory, or a link to a place you keep notes for yourself.
User avatar
bw123
 
Posts: 2993
Joined: 2011-05-09 06:02
Location: TN_USA

Re: Mount permissions HDD

Postby Lamios » 2018-01-25 19:46

mount | grep Volume gives the following:
Code: Select all
/dev/sda1 on /media/Volume type fuseblk (ro,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)


I already started to make nodes :wink:
Lamios
 
Posts: 31
Joined: 2017-12-09 23:26

Re: Mount permissions HDD

Postby pendrachken » 2018-01-25 20:50

Lamios wrote:mount | grep Volume gives the following:
Code: Select all
/dev/sda1 on /media/Volume type fuseblk (ro,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)


I already started to make nodes :wink:




That says the owner and group for that mount is root: user_id=0.

It also says it is mounted read only: ro.


Also, where in the Arch wiki did it say to include "defaults", or use UID / GID numbers ( even though they SHOULD be interchangeable )? I haven't played with ntfs-3g in forever so I can't say for sure that using a UID number in fstab is OK or not ( although I think this would break POSIX compliance if you can't ).
You MUST follow instructions fully in Linux, and remember that everything is also CaSeSeNsiTive.

Try writing and re-mounting the drive with the options given, and then we can go from there. Remember to replace "username" with the name of your user. And as a bonus hint the name of the default group in Debian is also your username - hence why your groupname / username both resolve to 1000.
fortune -o
Your love life will be... interesting.
:twisted: How did it know?

The U.S. uses the metric system too, we have tenths, hundredths and thousandths of inches :-P
pendrachken
 
Posts: 1315
Joined: 2007-03-04 21:10
Location: U.S.A. - WI.

Re: Mount permissions HDD

Postby bw123 » 2018-01-25 21:24

Lamios wrote:mount | grep Volume gives the following:
Code: Select all
/dev/sda1 on /media/Volume type fuseblk (ro,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)


I already started to make nodes :wink:


ok, you're obviously being difficult. The option default_permissions is likely from some type of user mapping you have neglected to mention. I'm not going to waste any more time with someone intentionally trying to infest the forum with misinformation and confusing information.

ntfs on debian is super-easy and does not require any complicated setup. The defaults for both mount command and fstab entry result in a mount that looks like the one I posted before. The defaults allow access to everything by everybody.
User avatar
bw123
 
Posts: 2993
Joined: 2011-05-09 06:02
Location: TN_USA

Re: Mount permissions HDD

Postby Lamios » 2018-01-25 21:57

Sorry, I did not intend to
infest the forum with misinformation and confusing information
and I am sorry, if something may have been mistakable.
I also don't know about any user mapping.
Lamios
 
Posts: 31
Joined: 2017-12-09 23:26

Re: Mount permissions HDD

Postby sunrat » 2018-01-25 22:25

[quote="Lamios"]mount | grep Volume gives the following:
Code: Select all
/dev/sda1 on /media/Volume type fuseblk (ro,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)

That appears to be the default, same as mine. Check the permissions of the files, should be owned by your user if fstab entry is correct.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!
User avatar
sunrat
 
Posts: 2263
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Re: Mount permissions HDD

Postby Lamios » 2018-01-25 23:28

I checked the permissions an I am the owner of the files, together with my group.
According to the properties entry, I should have rw permissions, the owning group and others only r permissions. Also if the entry states I have write permissions, I am nevertheless not able to write to the HDD.

I also tried to get some working code with the Arch Wiki, but it did not work out until yet.
This is the actual piece I am using, with my id changed to my username, as it had been suggested.
Code: Select all
UUID=0BE7094A0BE7094A /media/Volume ntfs-3g defaults,uid=lamios,gid=lamios,dmask=022,fmask=133 0 0
Lamios
 
Posts: 31
Joined: 2017-12-09 23:26

PreviousNext

Return to Beginners Questions

Who is online

Users browsing this forum: bdtc1 and 5 guests

fashionable