Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi,
I have some external USB drives (WD) which are not considered by system as removable. I have one with NTFS and two with FAT32.
When I try to mount I get error:
rafal@linux-39sr:~> mount /dev/sdb1 /mnt/usb1
mount: only root can do that
I know this was discussed several times, but no solution worked for me.
Here what didn't work:
1)
chmod +s /bin/mount
chmod +s /bin/umount
2)
giving sudo:
In YaST (I am using suse) I added my user option to execute /bin/mount, but it still does not work. maybe its about the access to /dev/sdb1 ?
I don't want to add any entry to /etc/fstab because I have several USB slots and disks. Some are NTFS, some FAT32. If I add entry in fstab then I never sure whether next time my sdb1 will be FAT32 or NTFS. It depends which drive I will connect as first (and maybe only one).
What I have to do in order to give access for my user to mount everything I want.
To resolve the problem where the same drive may have a different device node the next time you boot or plug it in, use the uuid or label instead of the device.
Suppose that the partition to mount is /dev/sdb. Then run "udevinfo -q env -n /dev/sdb". There will be a line like:
FS_UUID=ABC123-123432
Copy the UUID= and the number after it and paste it in the fstab entry in place of /dev/sdb.
For fat32 partitions, to be able to mount them as root, you need the "user" or "users" option and UID= and GID= options as well. Then a regular user can mount and unmount the partition. You can use either your username or your uid number.
The mount command is normally an suid program. It checks the mount options in /etc/fstab to determine whether a regular user will be allowed to use the command or not.
Suppose that the partition to mount is /dev/sdb. Then run "udevinfo -q env -n /dev/sdb". There will be a line like:
FS_UUID=ABC123-123432
Copy the UUID= and the number after it and paste it in the fstab entry in place of /dev/sdb.
Hi
Thanks for advise.
I executed the command and added the line to /etc/fstab:
rafal@linux-39sr:/mnt> mount /mnt/usb1
Error opening '/dev/sdb1': Brak dostępu
Failed to mount '/dev/sdb1': Brak dostępu
Please check '/dev/sdb1' and the ntfs-3g binary permissions,
and the mounting user ID. More explanation is provided at
http://ntfs-3g.org/support.html#unprivileged
"Brak dostępu" means "No access"
Only user 'root' have access to /dev/sdb1
Once I read I should add my user to group "disk' but it is not solution
So what can I do to get access to /dev/sda1.
chmod ?
I tested with "chmod 777" and afterwards get another error:
Code:
rafal@linux-39sr:/mnt> mount /mnt/usb1
ntfs-3g-mount: mount failed: Operacja niedozwolona
User doesn't have privilege to mount. For more information
please see: http://ntfs-3g.org/support.html#unprivileged
'Operacja niedozwolona" means "operation not permitted"
what will be clean solution here?
The reason why I need to mount device manually is that sometimes I'm using "Blackbox" as x-manager.
$ mount /dev/uba1
depending on which device or which usb port I use. Or if it's plugged in at boot time, versus inserted later. Check /proc/partitions to see what it registered as. (if it registered)
Adding a user to the disk group is a bad idea. That is the group owner of the raw devices as well. You want to grant access to one partiton, not all of them and not the raw devices (such as /dev/sdb) as well. Making a typo as a member of the disk group, you can wipe out any partition.
Read the web page that the error message points to. It gives solutions.
You can also use the ntfs filesystem. It might not work if the ntfs partition was formatted in vista and there are volume flags that aren't supported. Using these options, and the ntfs filesystem, I can mount it as a normal user:"rw,user,fmask=117,dmask=007,uid=jschiwal,gid=jschiwal"
However, due to unsupported features, it is mounted read-only.
Sorry but shouldn't the option be user instead of users ?
man mount says:
Quote:
(iii) Normally, only the superuser can mount file systems. However, when fstab contains the user option on a line, then anybody can mount the corresponding system.
Another solution would be to mount your disk via autofs. Then mounting is automatic and you can set an umask to give permission to others.
The "users" option is similar to the "user" option. Using "users" any user can umount it. Maybe "user" would be a better option. There is also the "owner" option. Even if a different user mounts a fat32 partition, the uid=, gid=, fmask= and dmask= options will determine whether that user can read or write.
Use fmask and dmask instead of simply umask. You don't want the files to have the "x" bit set. You need the directories to have the "x" bit set. The "x" bit has different uses for files & directories so you need to use fmask & dmask instead.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.