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.
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??
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.
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)
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.