LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 08-24-2005, 03:24 AM   #1
lenson
LQ Newbie
 
Registered: Aug 2005
Distribution: Slackware
Posts: 13

Rep: Reputation: 0
how do i access my USB stick???


Hello,

I've been trying to access my USB stick. It is actually a memory card reader with a memory card slot for my mobile MMC card. How do i access this USB. do i have to mount it??

Please help..

I'm using slackware 10.0, with kde desktop..

any help appreciated
thanks
 
Old 08-24-2005, 04:03 AM   #2
Charred
Member
 
Registered: Mar 2005
Location: Utah, USA
Distribution: Slackware 11
Posts: 816
Blog Entries: 2

Rep: Reputation: 30
Yes, you will have to mount it, and in order to make that easy, you'll need to put it in /etc/fstab. If you can't find it, try "lsusb -v" from the command line, that should list your usb devices. If that doesn't help, try looking for it under /proc/scsi; my card reader gets mounted as a scsi device.
 
Old 08-24-2005, 04:37 AM   #3
|2ainman
Member
 
Registered: Mar 2004
Distribution: Slackware current, DSL 0.9.2
Posts: 133

Rep: Reputation: 15
Also when you plug it in, type dmesg in console and look at the output. It should say what device it is registered as ie /dev/sda1
 
Old 08-24-2005, 04:41 AM   #4
Poetics
Senior Member
 
Registered: Jun 2003
Location: California
Distribution: Slackware
Posts: 1,181

Rep: Reputation: 49
# mkdir /mnt/usb
# mount /dev/sda1 /mnt/usb

And, as suggested above, add the usb to your fstab
 
Old 08-25-2005, 12:58 AM   #5
lenson
LQ Newbie
 
Registered: Aug 2005
Distribution: Slackware
Posts: 13

Original Poster
Rep: Reputation: 0
USB Problem sorted

Thanks , the usb was registered as /dev/sda1

I mounted it in /mnt/usb and i was able to access the stick

But wats the stuff about adding it to fstab?
Why do I need to do that?

Please Reply
 
Old 08-25-2005, 02:52 AM   #6
DefRay
LQ Newbie
 
Registered: Aug 2005
Location: Germany
Distribution: Debian sid
Posts: 15

Rep: Reputation: 0
You might want to add it to your fstab if you're using it quite often and don't always want to type the whole mount command.
(though if you're mounting through GUI programs in KDE you wouldn't have to type the whole command in an shell anyway)
Also the fstab mounts certain devices for you at boot time, e.g. I have an external HDD on my usb port, and the 2 partitions on it, recognised as sda5 and sda6 are automatically mounted when I boot linux, if I have my HDD switched on.
If it's off and I just use it occasionally, I just type "mount extern1" (or 2) after I switched it on, for example, or a simple "mount -a" will try to mount everything in your fstab.

But I think it's often not a very good idea to have removable divices attached to your usb port in you fstab, because linux recognises a usb storage device when you plug it in, via hotplug. But it recognises the first you plug in as sda(1-x), the second as sdb and so on. So in my case, if I plug in a USB-stick BEFORE I switch on my usb-hdd, the hdd is recognised as sdb5/6 and the stick as sda1.
So having written devices like those in you fstab isn't always a good idea.
You should only put devices in there, which are always installed in your computer, like HDDs and CD/DVD-Roms/RWs.

Oh and by the way:
there' also a /etc/mtab which shows the devices currently mounted.
You should never take a card out of your reader, if it's still mounted, so umount it first. (with CDs it's impossible, as you may know already, because linux blocks the eject function of your CD-Rom while a medium is mounted)

But as I said before, If you're often using your card-reader and it's always plugged in to a usb-port AND if it's always recognised as /dev/sda, then it's a good idea to add it to your fstab, e.g. through a line like that:

/dev/sda1 /mnt/flash vfat noauto,user 0 0
(you can also put in "auto" instead of vfat, or remove "user" if you dn't want users to be able to mount it)

Last edited by DefRay; 08-25-2005 at 03:03 AM.
 
Old 08-25-2005, 03:03 AM   #7
lenson
LQ Newbie
 
Registered: Aug 2005
Distribution: Slackware
Posts: 13

Original Poster
Rep: Reputation: 0
Question..

OK ..first how do I add it in fstab?

And second .. if I add it in fstab , Do I still have to umount the device?

I dont have the stick connected at all times..of course..
So wats the best option for automatically mounting it at startup or when I plug it in?

Thanks a lot for the help..
That was useful
 
Old 08-25-2005, 03:08 AM   #8
lenson
LQ Newbie
 
Registered: Aug 2005
Distribution: Slackware
Posts: 13

Original Poster
Rep: Reputation: 0
sorry

ignore the first question
 
Old 08-25-2005, 05:13 AM   #9
DefRay
LQ Newbie
 
Registered: Aug 2005
Location: Germany
Distribution: Debian sid
Posts: 15

Rep: Reputation: 0
well,
I think you'd need scripts to automount/-unmount your card.
And there's some automount demons out there, you'd have to look for them, they'll run everytime and do the same as the mentioned scripts.

So if you don't use those, yes, I think you'll have to do a umount manually.

But if you put a line like the above in your fstab you shorten the mount command and only need to type "mount /dev/sda1" or "mount /mnt/flash".
Your distro knows how to mount the device, because you inserted it in fstab.
So if you're not using it VERY often, this should be enough. You can even write a bash-script to shorten the command, but I don't think it's neccessary. You can also type "mount -a" as I said earlier.

And if you insert the card into the reader before starting linux, it will be automounted in the boot process if you replace "noauto" with "auto" in your fstab.

But if it's a Multi-Card-Reader you could run into problems. Depending on your distro and cardreader, the devices assigned to a certain type of card could be different, e.g. sdb for another type of card. You should find out what devices are assigned to what memory slot. You can then add additional lines like the one I posted in your fstab.

here's also a site I found googling, which addresses this: http://www.cs.sfu.ca/~ggbaker/personal/cf-linux

Oh yeah: It's probably a good idea to add "sync" to your mount options (users, noauto). This prevents data-loss due to perhaps unfinished copy-jobs if you accidentally pull the card out without unmonting first.
 
Old 08-25-2005, 05:27 AM   #10
lenson
LQ Newbie
 
Registered: Aug 2005
Distribution: Slackware
Posts: 13

Original Poster
Rep: Reputation: 0
Thanks

That was a lot of info..really helpful
 
Old 08-25-2005, 12:45 PM   #11
mjjzf
Member
 
Registered: Feb 2004
Location: Valby, Denmark / Citizen of the Web
Distribution: Slackware 14.1
Posts: 879

Rep: Reputation: 39
When I used SuSE (one of the earlier versions) I made a small text file, 'mntflash' which had one line of code: mount /dev/sda1 /mnt/usb. I made a shortcut button with the command : gksu ~/mntflash. I made a similar button for 'unmntflash' (guess what that did).
Gksu is a command for running a program as root from the user interface, and a small 'enter password' box pops up.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cybershot p-73 memory stick pro access Simon Bridge Linux - Hardware 12 05-22-2005 10:08 PM
mount/umount usb stick - PQI Intelligent Stick 2.0 sandbag Linux - Software 5 05-06-2005 11:12 AM
USB problems: Memorex USB stick 256MB and PSX to USB adapter by Radio Shack Knuckles T15 Linux - Hardware 1 05-19-2004 06:58 PM
USB flash pen/stick/card cannot access mudelf Linux - Hardware 5 09-26-2003 05:58 AM
USB-Stick/usb-storage JC_at_LQ Linux - General 2 07-14-2003 06:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:17 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