LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-03-2005, 04:23 PM   #1
zparihar
Member
 
Registered: Sep 2004
Distribution: Fedora, Debian
Posts: 61

Rep: Reputation: 15
How to use a USB Flash Key with out mounting and unmounting it!


Hello Everyone!

I wanted to figure out a way to where I could just plug in my USB Flash key into my Linux box and just access the device from KDE without having to mount or unmount it!

I did a little bit of research and eventually figured I it out!

I'm using Fedora Core 3 and KDE 3.3.*

I also have 'mtools' installed (very important!).

KDE 3.3 has integrated mtools with it self and can be used with typing in ' floppy:/ ' from konqueror (i'll explain later). Im not sure if you can access it the same way in Gnome, but you can definitely do it. You probably gotta do a little reasearch into mtools: ' man mtools '

This step-by-step howto is for KDE ( but can be applied to Gnome)

1) First you will need to find out what device your USB Flash disk is recognized as:

/dev/sda1
/dev/sdb1
/dev/sda2
/dev/sdb2
...etc

If you already know what device it is, skip to step 2.

I'm sure there is a more efficient way to do this, but what you could do to test which device it is recognized as is mount it. (lol! pretty ironic).

to find out:

a) plug it in

b) mount -t auto /dev/sda1 /mnt
or sdb1 or sda2 or sdb2 (which ever one works for you)
c) once it mounts, you'll know which device it is.


2) Now edit the file /etc/mtools.conf

add the following line under '# Linux Floppy Drives' :

drive u: file="/dev/sdb1" exclusive mformat_only

(change the sdb1 to whatever device yours is recognized as)


3) When you plug in your USB Key... it should appear in /dev/ as sda1 or sdb1 or whatever yours is... however the permission on it will only be 700 (only for root).

We'll need to change it so that when ever you plug it in, the permission should be 777.

Edit the file /etc/udev/permissions.d/50-udev.permissions

change the following line from :

sd*:root:disk:0660

to:

sd*:root:disk:0777


4) The Configuration is complete... Now we want to create a shortcut in KDE so that we can Access the USB KEY by only double-clicking the icon. ( there is no need to mount or unmount: for more info do a 'man mtools')

You can create this device anywhere...I chose my Desktop

i) Right mouse button your desktop
ii) Click 'Create New -> File -> Link to Location (URL)
iii) Under 'File name:' type 'USB Flash Device'
Under 'Enter link tolocation (URL):' type ' floppy:/u '
iv) Press OK and thats it!

You should now have an Icon on your desktop called ' USB Flash Device ' ( you can rename it).

Plug in your Usb Key and now double click your new icon! Voila! You should see the contents of your device!


I hoped that worked out for you!


Let me know if you have any problems.



Zubin Parihar
 
Old 02-03-2005, 04:51 PM   #2
oneandoneis2
Senior Member
 
Registered: Nov 2003
Location: London, England
Distribution: Ubuntu
Posts: 1,460

Rep: Reputation: 48
Quote:
'm sure there is a more efficient way to do this, but what you could do to test which device it is recognized as is mount it. (lol! pretty ironic).
dmesg and /var/log/messages or /var/log/syslog are your friends at this point. . .
 
Old 02-03-2005, 04:59 PM   #3
zparihar
Member
 
Registered: Sep 2004
Distribution: Fedora, Debian
Posts: 61

Original Poster
Rep: Reputation: 15
thx

Thanks oneandoneis2

Zubin
 
Old 08-19-2005, 03:44 PM   #4
realnerd
Member
 
Registered: Aug 2004
Distribution: Gentoo (main), FreeBSD, VoidLinux, Crux
Posts: 49
Blog Entries: 1

Rep: Reputation: 15
Hi,

thanks for your guide. I have Debian sarge with kernel 2.6.8 and cannot use the step:

"Edit the file /etc/udev/permissions.d/50-udev.permissions"

as there is no file 50-udev.permissions on my box. Is it something that is not available for Debian?

What should I do?

Thanks for your help

realnerd
 
Old 08-19-2005, 08:21 PM   #5
AdaHacker
Member
 
Registered: Oct 2001
Location: Brockport, NY
Distribution: Kubuntu
Posts: 384

Rep: Reputation: 32
Personally, I prefer the method of using automount/autofs. This way has the advantage that it doesn't depend on Konqueror or any other program. When you access the mount point, the device will be automatically mounted, and after you stop accessing it, it will be unmounted. It doesn't matter if you open the mount point in Konqueror or if you cd to it from the command line. Also, in addition to floppies and USB drives, it works with CD and DVD drives and network shares.

Another interesting tidbit I discovered is that you can write a script that works with Udev to automatically open the file manager when you insert a USB drive. Kind of makes having a desktop shortcut irrelevant (although they still come in handy).
 
Old 08-20-2005, 11:56 AM   #6
realnerd
Member
 
Registered: Aug 2004
Distribution: Gentoo (main), FreeBSD, VoidLinux, Crux
Posts: 49
Blog Entries: 1

Rep: Reputation: 15
Thanks for your help. I have examined your suggestions, and found them very interesting.

But my very problem is not to access my USB drive, it's perfectly feasible.

My problem is that the permissions permit only to non-root users to read the data, and not to write. To write I must be root.

Is your solution suitable for writing on the USB drive?

Thanks for your reply,

realnerd
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mounting and unmounting USB drives Ian D Linux - Software 3 10-15-2005 02:45 PM
Problems mounting/unmounting flash USB drive LordSurvivoR Linux - Hardware 1 07-12-2005 11:19 PM
Need help identifying and mounting/unmounting USB drive. calathar Linux - Newbie 2 05-01-2005 03:50 AM
Unmounting USB Flash drive alanbarnard JDS 2 02-20-2005 11:16 AM
External USB drive mounting/unmounting nsk078 Linux - Hardware 1 09-22-2004 05:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration