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

New to Debian (Or Linux in general)? Ask your questions here!
Message
Author
Lamios
Posts: 37
Joined: 2017-12-09 23:26

Re: Mount permissions HDD

#16 Post by Lamios »

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.

User avatar
Thorny
Posts: 542
Joined: 2011-02-27 13:40

Re: Mount permissions HDD

#17 Post by Thorny »

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
sunrat
Administrator
Administrator
Posts: 6412
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 462 times

Re: Mount permissions HDD

#18 Post by sunrat »

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!

Lamios
Posts: 37
Joined: 2017-12-09 23:26

Re: Mount permissions HDD

#19 Post by Lamios »

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: 37
Joined: 2017-12-09 23:26

Re: Mount permissions HDD

#20 Post by Lamios »

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?

pendrachken
Posts: 1394
Joined: 2007-03-04 21:10
Location: U.S.A. - WI.

Re: Mount permissions HDD

#21 Post by pendrachken »

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

User avatar
Thorny
Posts: 542
Joined: 2011-02-27 13:40

Re: Mount permissions HDD

#22 Post by Thorny »

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.

Lamios
Posts: 37
Joined: 2017-12-09 23:26

Re: Mount permissions HDD

#23 Post by Lamios »

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?

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

Re: Mount permissions HDD

#24 Post by bw123 »

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.
resigned by AI ChatGPT

Lamios
Posts: 37
Joined: 2017-12-09 23:26

Re: Mount permissions HDD

#25 Post by 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)
I already started to make nodes :wink:

pendrachken
Posts: 1394
Joined: 2007-03-04 21:10
Location: U.S.A. - WI.

Re: Mount permissions HDD

#26 Post by pendrachken »

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

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

Re: Mount permissions HDD

#27 Post by bw123 »

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.
resigned by AI ChatGPT

Lamios
Posts: 37
Joined: 2017-12-09 23:26

Re: Mount permissions HDD

#28 Post by Lamios »

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.

User avatar
sunrat
Administrator
Administrator
Posts: 6412
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 462 times

Re: Mount permissions HDD

#29 Post by sunrat »

[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!

Lamios
Posts: 37
Joined: 2017-12-09 23:26

Re: Mount permissions HDD

#30 Post by Lamios »

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

User avatar
sunrat
Administrator
Administrator
Posts: 6412
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 462 times

Re: Mount permissions HDD

#31 Post by sunrat »

You said it worked without masks. You have to work out if you need masks (I don't use them) and what effect they have if you do.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

pendrachken
Posts: 1394
Joined: 2007-03-04 21:10
Location: U.S.A. - WI.

Re: Mount permissions HDD

#32 Post by pendrachken »

My bet is there was an unclean umount while working on getting everything. If I remember correctly ntfs-3g will only mount NTFS partitions that are flagged dirty as RO.


Easiest way to check this is to manually umount and remount the partition and see if it either spits out an error to console or in dmesg.
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

Lamios
Posts: 37
Joined: 2017-12-09 23:26

Re: Mount permissions HDD

#33 Post by Lamios »

Deleting the masks does not really solve the problem (also if it worked before I used the dmask and fmask). But it is now possible to open the 'create new' entry, but not to write it. That had not been possible in before. Trying to create a folder as root states that it is an read-only file system. Due to deleting the masks, everyone now has read, write and execute permissions.

An unclean unmount could be possible. I did try the un- and remounting twice. The first time it had been possible and in dmesg I could not find any warnings or errors.The second time it gave me the following:

Code: Select all

The device is currently busy: Error unmounting /dev/sda1: Command-line `umount  "/dev/sda1"' exited with non-zero exit status 32: umount: /media/Volume: target is busy
        (In some cases useful info about processes that
         use the device is found by lsof(8) or fuser(1).)
I remember to have had this error in before, but thought it is unimportant because it is only due to some open processes in the background and will solve out after a reboot.
dmesg did not give me the complete output (I think it had been to long and therefore shortened in the beginning?) I only could find an firewall error, which occured after the failed unmount:

Code: Select all

[ 2038.688746] nf_conntrack: default automatic helper assignment has been turned off for security reasons and CT-based  firewall rule not found. Use the iptables CT target to attach helpers instead.
But I think this is maybe not related to the HDD mount (and another topic if it reoccurs)...

pendrachken
Posts: 1394
Joined: 2007-03-04 21:10
Location: U.S.A. - WI.

Re: Mount permissions HDD

#34 Post by pendrachken »

You can try running

Code: Select all

ntfsfix /dev/sdXX
where you replace XX with the disk and partition number E.G. /dev/sda1 - you will have to figure out which partition is the NTFS filesystem.


You will also have to make sure fastboot is disabled in Windows and that Windows does not have a hibernation file present on that partition if you use it as a Windows boot device.
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

Lamios
Posts: 37
Joined: 2017-12-09 23:26

Re: Mount permissions HDD

#35 Post by Lamios »

It had been the fastboot from Windows, which caused the problems! Even though Windows runs on a separated disk. I am sure I deactivated fastboot before I installed Debian. Anyway... Thank you for your help! :D

Post Reply