Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
My linux user account needs root privilage to delete files from the pendrive(/mnt/auto/sda1) or to move contents to it.How should I give root privilage as far as accessing the pendrive is concerned?
My linux user account needs root privilage to delete files from the pendrive(/mnt/auto/sda1) or to move contents to it.How should I give root privilage as far as accessing the pendrive is concerned?
Rather than doing so, you should be asking how to mount the device with the correct privileges so users can write on it. This depends in a number of things, starting with the type of file system and how you mount it.
Well, the first thing is, how do you mount the drive?
The second thing is what file system did you use to mount it?
If you are not sure, post the contents of /etc/fstab, however that might not help if the system automounts the pen drive using some non-standard odd thing, like most do nowadays.
System auto mounts the pendrive at /mnt/auto/sda1.Can I edit fstab manually?
Sure. But the whole thing comes down at one single problem: how is your OS mounting your drive?
If it's specified in /etc/fstab, then you should be able to edit /etc/fstab and be done with it. If it's a FAT32 file system, you need to look at the umask option (you probably want umask=000). For other fs's, the thing can be different. Check the mount man page:
Code:
man mount
Other common ways to mount stuff are ivman and udev rules. But first, let's check that fstab.
Assuming that your pen drive is formatted with fat32. Fat32 volumes can't store linux permissions because they simply lack the structures to do so. So all the permissions are emulated at mount time, that's what umask does. A mask of 000 means that all the files will have permissions set to 777 (all permissions for all users).
As said, this is all related to vfat (and maybe ntfs, check the mount man page).
For the two commands I get the following error message..........
Code:
(exo-mount:8576): Gtk-WARNING **: Locale not supported by C library.
Using the fallback 'C' locale.
mount: only root can mount /dev/sda1 on /mnt/auto/sda1
For the two commands I get the following error message..........
Code:
(exo-mount:8576): Gtk-WARNING **: Locale not supported by C library.
Using the fallback 'C' locale.
mount: only root can mount /dev/sda1 on /mnt/auto/sda1
I am not sure what are you doing. Did you already modify /etc/fstab? Either way, what exact command are you using to mount the drive?
If you want to be able to manually mount/umount stuff you might be interested in reading about the "users" mount option. In that case, your line in fstab would become:
Code:
/dev/sda1 /mnt/auto/sda1 auto rw,noauto,umask=000,users 0 0
My pendrive is automatically mounted. The above error message is found after editing fstab as said by you..........
I added the current user to the group ROOT. But that groupd didnt have the write permission on pendrive. WHat should be done on the group to give write permission on pendrive...........
My pendrive is automatically mounted. The above error message is found after editing fstab as said by you..........
In your fstab line, try changing "user" by "user". I assume you also added the umask stuff. Then try this and see if it works as a normal user:
Code:
umount /mnt/auto/sda1
mount /mnt/auto/sda1
If it works, check if you can write something to the drive, for example:
Code:
touch /mnt/auto/sda1/test
If it works, then it should continue working on the next mounts. If it doesn't work then, please, give me the output of this command:
Code:
mount | grep sda1
Maybe it's not in fat32 after all.
Quote:
I added the current user to the group ROOT. But that groupd didnt have the write permission on pendrive. WHat should be done on the group to give write permission on pendrive...........
As said, it depends on the type of file system that you have. In fat32 you set the permissions at mount time, using umask. With linux file systems you set the permissions on the fs once it's mounted, using chmod/chown like with any other directory or regular file.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.