View Full Version : Mounting a Flash drive? Help?
|Doc|
2004-05-20, 12:24 AM CDT
I have a usb flash drive and I cant get it to mount.
I have found it in the hardware browser and I know that my computer can 'see it'. I know that I am supposed to edit the /etc/fstab and I tried it by adding the following line:
/dev/sda1 /mnt/flashdrive auto noauto,users,noatime,async
I used it because I found it on another post and it worked for those involved. However it is not working for me at the moment. An icon shows up in the computer window from the desktop but it throws up an error saying that it cant find the mount point.
Does anybody have any suggestions? Along with that can anybody point me in the direction of some info about what all the options for /etc/fstab are and what they all mean. I'm sure this would help keep me from jamming up the forum with all my little problems, I'm sure it would help others too.
Thanks in advance!
|Doc|
|Doc|
2004-05-20, 12:59 AM CDT
I have a usb zip drive that seems to be automaticly recognized and mounted. Is there anyway that I can have my flash drives do the same?
ilja
2004-05-20, 01:56 AM CDT
When I plug my digi cam I get automatical a new directory in /mnt/ something like /mnt/cam/. Maybe the best way is to write this things into fstab, but when I want a usb flash being mounted I just type mount /dev/hda1 -t vfat /mnt/usb
I have my usb on hda1 and all my usb flashes are formated as FAT. I got never a problem before. But you have to be aware, that you can use it only as root and I heard that it is only synchronised when you type umount /mnt/usb/ . So I leave the flash some minutes there when after umount.
But if you want it to be available for users, then surelly you need a /etc/fstab entry.
I'm not a specialist of fstab commands, but as far as I know :
/dev/sda1 -- is the source device
/mnt/flashdrive -- directory where it should be mounted
auto noauto, --don't know but I think it has something to do with automount
users, <-- all users of the group users can use it
noatime, <--don't know
async <-- not sure but I think it aims to solve the synchronasation problem I have, with waiting after umount.
|Doc|
2004-05-20, 10:12 AM CDT
I gave it a shot and no luck. I am reading through the man pages right now but if anybody has any other ideas please post.
|Doc|
2004-05-20, 01:21 PM CDT
I edited fstab several different ways and I have come to the conclusion that the kernel that I am working with doesn't support fat16. At least thats what it tells me.
Does anybody know how to get support for fat16 in FC2?
|Doc|
2004-05-20, 01:31 PM CDT
I finally got it to work with this line.
/dev/sda1 /mnt/flashdrive vfat noauto,user,kudzu 0 0
try it out!
I noticed my errors were like this: I used /dev/sda not /dev/sda1. I needed to actually crate the folder /mnt/flashdrive. Use vfat not FAT16. for the rest of it I just made the options similar to my floppy drive.
If I have any major potential problems here somebody let me know.
|Doc|
ezeze5000
2004-05-20, 08:34 PM CDT
You can format the flash drive as a fat32 and the original
/etc/fstab line will work just fine ok?
I formatted mine on a win machine as fat32
ezeze5000
2004-05-20, 08:39 PM CDT
I have several flash (thumb) drives that i use between several different PCs and operating systems. they look like this...
/dev/sda1
/dev/sdb1
/dev/sdc1
and so on............with each drive having its own name.
radonsg
2004-05-21, 12:01 AM CDT
/dev/sda1 /mnt/usb vfat defaults,auto,user 0 0
this can also work.
|Doc|
2004-05-23, 12:40 AM CDT
In windoze I am supposed to tell the os to disconnect my flashdrive, they call it 'safely remove hardware' . Is there something similar to that in linux or is it ok to just unplug the thing when the light is not on? I tried to unmount it once but that just undid all the work I did to get it connected in the first place.
|Doc|
radonsg
2004-05-23, 09:59 PM CDT
U will need to umount it as well. For example, say u mount it to /mnt/usb_drive, then u need to umount /mnt/usb_drive. I did not have any problem abt getting everything undo the moment I un-mount it & never heard anything like tt before. U sure u did the correct thingy.
|Doc|
2004-05-24, 06:11 PM CDT
When I unmount my flashdrive I am not able to remount it without a restart. It is not recognized by hardware browser when I try to remount. My edit of fstab is deleted and the folder /mnt/flashdrive is gone too. I also noticed something curious. during startup I see a line saying updateing fstab, is this normal?
My big wish is this: I want to be able to plug in my flash drive, use it, unplug it, plug it in later and use it again. I don't want to have to have to restart, edit fstab, create /mnt/flashdrive every time I want to use my stinking flash drive. I don't think this is unreasonable, why can't I figure it out? I am also having problems with my zip drive. It is recognized right away and am able to mount the disk in the drive then later eject it and replace the disk. The problems start when I unplug the drive and then plug it back in. Then I get a "Cannot mount device' error.
Will somebody out there please help.
|Doc|
radonsg
2004-05-24, 09:01 PM CDT
Hmm. I experience the deletion of my fstab before. It has somethin to do with the fstab not entirely correct. Try to change the auto to nonauto & c if that correct the error.
shred
2004-05-25, 03:58 AM CDT
There is a mechanism in Fedora that recognizes some USB file systems if they get connected, and automatically create a mount directory and an appropriate fstab entry.
If the USB device is disconnected, the fstab entry and the mount directory will be deleted automatically. Maybe this is what you have noticed.
Have a look at man updfstab and man devlabel to learn more about this mechanism. You can make it learn all your USB file systems, so you'll then just need to plug them in and just mount them, without any hassles and finding out the right /dev/ the USB thingie was attached to and stuff... Quite a nice invention IMO.
deuch
2004-05-25, 04:01 AM CDT
try this :
create a directory as root in /mnt ea : /mnt/flashdisk
as root, create a script in /usr/local/sbin like mflash ...
it will contains womething like that
#!/bin/sh (or #!/bin/bash)
sudo mount -t vfat -o umask=000 /dev/sda1 /mnt/flashdisk
and now a uflash script :
#!/bin/sh (or #!/bin/bash)
sudo umount /mnt/flashdisk
You have to configure sudo to allow user use this script ...
type visudo and add this :
## in Host Alias section
Host_Alais HERE = name_of_your_pc (or localhost ...)
## in Cmnd_Alias section
Cmnd_Alias MOUNT = /usr/sbin/mount, /usr/sbin/umount
## in User_Alias Section
User_Alias ROOT_FRIENDS = user1, user2, ...., usern
At the end add :
ROOT_FRIENDS WHERE = NOPASSWD: MOUNT
If you want to alow access at every user, modify the line abose like this :
ALL WHERE WHERE = NOPASSWD: MOUNT
Whith this, all user will be able to mount.umount a drive !!!
Use a alias with a list of authorized user is more secure !!
This is a methos i used to use my reader/writer Compact Flash ...
One question : Fedora Core 2 mount automatically USB external drive plugged ??? I never see a new directory in my /mnt dir when i plugg my usb drive ...
I see that FC2 load necessary module to use it (like usb-storage and his friends ...), but in my /mnt i have only floppy and cdrom and cflash that i created ...
I know that with mandrake 10 it works ... My USB drive is my reader/writer of Compact Flash ...
thanks for you response and hopes that mys little tricks helps !!
deuch
deuch
2004-05-25, 04:36 AM CDT
i didn't try but it seems to be more simple to do that :
mount -t vfat -o user, mask=000 /dev/sda1/ /mnt/flash ...
I think that it's possible to use this without configure sudo and for all users ...
you can test :-)
deuch
|Doc|
2004-05-25, 05:28 PM CDT
Ok. I got it working just how I want it. This is how I did it. First I read man updfstab & man devlabel to understand what is going on here. Fedora did a good job of trying to cover many devices to work automaticly so I was able to just add my hardware to the existing configs.
1)Log in as root.
2)Plug in the drive, make sure that is powers up. (If there is no power to the drive then you have issues with your usb port.)
3) Run hardware browser, look for your hardware, should be under hard drives. Make note of the label (Model: ....your hardware name...) in my case it was "SanDisk Cruzer Mini". Rember it, write it down, cut paste... whatever.
4) Now open /etc/updfstab.conf.default with gedit (or your prefered text editor) If you are worried about making a big mistake make a backup copy first.
5) Scroll down and find the section labeled flash (or whatever else you think would work better with your hardware. I used flash. Add a line similar to the others in the section that has the model label of your hardware in quotes. When I was all done the section looked like this:
device flash {
partition 1
match hd "SanDisk Cruzer Mini"
match hd CompactFlash
match hd ImageMate
match hd Flash
match hd JumpDrive
match hd MuVo
match hd ClipDrive
match hd "Generic Traveling Disk"
match hd "Jungsoft NEXDISK"
match hd "Memory Key"
}
6) Save the file, close it. Unplug the drive. Plug it back in. It should now automaticly mount and pop an icon on your desktop.
Now this is all assuming that you did the default install and you havent changed anything much. If you did you may not need this. I haven't tried mounting and unmounting as a normal user, could be a problem. We shal see.
If anybody has other sugestions or problems please post.
|Doc|
Reindeer
2007-10-20, 02:46 AM CDT
I have a one gig compactflash card from my Nikon camera.
I'm getting this message on my flash drive, when I try to mount it:
[root@szybki usb]# mount -t vfat -o umask=000 /dev/sdb1 /mnt/usb
mount: wrong fs type, bad option, bad superblock on /dev/sdb1,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
[root@szybki usb]# dmesg | tail
sd 7:0:0:0: [sdb] Write Protect is off
sd 7:0:0:0: [sdb] Mode Sense: 02 00 00 00
sd 7:0:0:0: [sdb] Assuming drive cache: write through
sdb: sdb1
sd 7:0:0:0: [sdb] Attached SCSI removable disk
sd 7:0:0:0: Attached scsi generic sg3 type 0
FAT: count of clusters too big (247210)
VFS: Can't find a valid FAT filesystem on dev sdb1.
FAT: count of clusters too big (247210)
VFS: Can't find a valid FAT filesystem on dev sdb1.
marko
2007-10-20, 04:32 PM CDT
Reindeer
It might be good idea to start this as a new post, the thread you tacked onto
is 3 years old.
Mark
Reindeer
2007-10-21, 12:37 AM CDT
Reindeer
It might be good idea to start this as a new post, the thread you tacked onto
is 3 years old.
Mark
Good idea.
I have started a new thread on this topic here:
Compactflash won't mount - Clusters too big? (http://forums.fedoraforum.org/showthread.php?p=884977#post884977)
vBulletin® v3.7.3, Copyright ©2000-2009, Jelsoft Enterprises Ltd.