USB Stick Mount Solution (and Problem) With Linux
So I finally learned how to get my USB memory key to work in linux, for other newbies, it's easier than you might think!
mount -t vfat /dev/sda1 /target-foldername-here You must specify the filesystem of the key to allow linux to use it, but this will allow both reading and writing to the drive.. So, I made a script named "stick" to enter the mount command and echo success or failure, which works fine, except for one problem. What I can't deduce though, is how to use this command when not in root... Other accounts get a message that they are not allowed to use mount... What am I overlooking to allow universal usage of this script/command? I'm only working on my home workstation, so I'm not worried about security problems, just trying to learn what the problem is, and fix it. Anyone know what this mount problem means, and how to fix it, aside from giving the other account root privilege?:confused: |
Hi C0Y0TE,
Goggle or seach on these forums on sudo. -Kristijan |
Another solution would be to ass a line to your fstab:
Code:
/dev/sda1 /media/pendrive vfat noauto,rw,user 0 0 rw - mount the device as read/write user - allow non-root users to mount the device (making them the effective owner of the device) After adding that line, your mount command does not need to be as verbose. A simple "mount /dev/sda1" or "mount /media/pendrive" will work, because mount can get the missing pieces from the /etc/fstab line. |
hi there,
why is necessary to use "vfat" as filesystem? i would suggest "auto". if you have something in the card considering MSWindows stuff and you get problems to mount, then you should try changing to "vfat". regards slackie1000 |
Quote:
Unfortunately, in this case, C0Y0TE already mentioned in the original post that specifying the filesystem was required for the mount command to work. I can also say that I have a similar problem. Even though vfat support is compiled into the kernel (i.e. not a module), I still must specify the filesystem when trying to mount my USB stick. If auto works on someone else's system, then I'd suggest keeping it that way. However, the filesystem is not likely to change on the stick. So there's no loss in leaving it as vfat. |
hi there,
ok! clear now, Dark_Helmet! i misunderstood the first post. i thought he was not happy with the fact that it is necessary the filesystem specification. my bad. regards slackie1000 |
Right on, thanks for the varied responses!
The literal "vfat" filetype specificiation may not necessarily be required, it was a universal solution we worked up for the people in my Linux OS class (who have any number of brands of USB stick, and EVERY one of them worked with this solution.) I'll get to trying out the fstab thing, that sounds like the best solution in the long run, and definutely need to look up sudo as well, as I am not entirely sure what it is, although it looks like its similar the su, or at least based on it..? (correction, I looke dup sudo, I guess it would work, but I'd rather allow all users access to the mount comman universally, nstead of adding one at a time to a special list..) :eek: Thanks again, now if only peple would answer my triple-boot questions as helpfully LOL. :rolleyes: |
All times are GMT -5. The time now is 05:38 AM. |