LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   USB Stick Mount Solution (and Problem) With Linux (https://www.linuxquestions.org/questions/linux-newbie-8/usb-stick-mount-solution-and-problem-with-linux-278322/)

C0Y0TE 01-16-2005 12:57 AM

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:

Kristijan 01-16-2005 01:44 AM

Hi C0Y0TE,

Goggle or seach on these forums on sudo.

-Kristijan

Dark_Helmet 01-16-2005 01:59 AM

Another solution would be to ass a line to your fstab:
Code:

/dev/sda1      /media/pendrive  vfat    noauto,rw,user          0    0
noauto - do not try to mount the device at startup
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.

slackie1000 01-16-2005 02:37 AM

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

Dark_Helmet 01-16-2005 02:50 AM

Quote:

Originally posted by slackie1000
why is necessary to use "vfat" as filesystem? i would suggest "auto".
Using "auto" is best when the media you are using has a tendency to change (for instance, floppy disks can be vfat, ext2, or whatever) and when the system doesn't have a problem detecting what type of filesystem it is.

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.

slackie1000 01-16-2005 11:24 AM

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

C0Y0TE 01-17-2005 03:02 PM

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.