Click to See Complete Forum and Search --> : USB PenDrive
Nyckelharpa
06-24-2003, 10:34 PM
I've searched through the forums here and can't seem to get anywhere with mounting my pendrive. I checked on my hardware browser and it is listed by name at /dev/sda1, and it has a Fat16 file system according to the browser.
If, as root, I try mount /dev/sda1/, I get the following:
mount: can't find /dev/sda1 in /etc/fstab or /etc/mtab
If I, as root, try mount /dev/sda1 /my/mountpoint, I get:
mount: you must specify the filesystem type
Now, I don't know (a) if that "/my/mountpoint" in the example above is what it should be (I just copied it from a posting), and (b), if it is right, how or where to specify the filesystem type within the command. I am assuming that it should be msdos, but where does it go?
Thanks many many, very very, all in advance, of course.
Sorry for being so lame.
mart_man00
06-24-2003, 10:37 PM
i dont think it matters.
if it helps i do
mount -t vfat /dev/sda1 /my/mountpoint
Nyckelharpa
06-24-2003, 11:39 PM
Well, I tried:
mount -t vfat /dev/sda1 /my/mountpoint
and this is what I got:
mount: mount point /my/mountpoint does not exist
I am getting somewhere, I guess, but not quite there its seems.... Any next step suggs?
mart_man00
06-24-2003, 11:50 PM
you didnt create the folder! so just make one. mounts normally go in the /mnt dir.
mkdir /mnt/usb
mount -t vfat /dev/sda1 /mnt/usb
DarkJedi9
06-24-2003, 11:58 PM
USB pendrives (or keydrives, whatever...) despite being FAT32, require scsi emulation to work. Hence the /dev/sda1. Compile scsi emulation and also usb mass storage device support into your kernel.
Nyckelharpa
06-25-2003, 02:55 AM
Well, thanks... making the directory worked, but that done, it seems that I have to copy everything to and from as root.... and I can only do it by command line now.
Is there any way to set it up so that it can function a little more conveniently. For example have a desktop icon that pops up when mounted, and have a way to copy to and from without having to be root?
Maybe there is something else I am missing... I tried to change the permissions of the /mnt/usb directory but was told I can't do that.
Hmmm..:confused:
Nyckelharpa
06-25-2003, 03:02 AM
Is there something I am missing about umount? I keep getting the message, /mnt/usb: device is busy
Thanks.....
DarkJedi9
06-25-2003, 03:18 AM
Originally posted by Nyckelharpa
Is there something I am missing about umount? I keep getting the message, /mnt/usb: device is busy
Thanks.....
Are you still in the directory where you mounted the keydrive? If you are, change out of it (cd ~ works).
mrBen
06-25-2003, 04:38 AM
To make the whole thing a little easier:
Edit your /etc/fstab file for simple mounting of the device. A line something like this should help:
This should mean that an ordinary user can mount and umount the drive, and have permission to read/write.
HTH
Nyckelharpa
06-25-2003, 07:43 AM
Yes, I tried umount as you said, but still got the device busy reply.
I will try the ftab suggestion next.
By the way, if I remember correctly, in SuSE, doesn't a USB device automatically pop up on screen when you plug it in? I seem to remember that, but maybe I'm dreaming.... But that doesn't matter, I suppose, because I'm using RH9, but I was curious as to how it was done if it was so....
Thanks:p
Nyckelharpa
06-25-2003, 07:54 AM
Yes, I tried the fstab method you mentioned and set up a disk launcher in the panel and as soon as I click it an icon appears on the desktop and all is hunky dory. Very good. That makes it seem more usable.
Thanks to all for all the great advice - my mind has expanded and I will have to buy bigger hats, red or whatever.....
mrBen
06-25-2003, 08:13 AM
Excellent!
Incidentally, you might want to check out the hotplug module, which is probably what SuSE uses to automatically mount USB devices. IIRC it should actually load al the relevant modules 'n' stuff too.
Nyckelharpa
06-25-2003, 08:29 PM
Well, as I said, all worked fine, but when trying to unmount, I still got the /dev/usb busy message. At home on another computer I tried setting everything up the same EXCEPT that instead of creating a /mnt/usb directory, I created a /mnt/pendrive directory.... and then ammended the fstab as before, but with /mnt/pendrive instead of /mnt/usb. I changed the panel launcher accordingly and all worked fine, including umount. When I changed my office computer in the same way, it worked too.
Why would that be?
Nyckelharpa
06-25-2003, 09:19 PM
Well, everything seemed fine enough, but I came up with a snag....
It's the busy message again. Once I delete a file from the drive, I get the busy message again when I try umount, either from the command line, the panel mounter or from the unmount volume selection in the pop-up menu from the desktop icon itself.
Hmmmm...... Any suggs?
mart_man00
06-25-2003, 09:22 PM
cd ~/
umount /mnt/usb
Nyckelharpa
06-25-2003, 10:02 PM
This is what I get:
[rg@localhost rg]$ cd ~/
[rg@localhost rg]$ umount /mnt/pendrive
umount: /mnt/pendrive: device is busy
[rg@localhost rg]$
Ditto for root. The only way to unmount the the drive is to right click on the desktop icon and select Unmount Volume in the popup menu. Sometimes, however, I get a message anyway which says that the device is busy, but that disappears and the desktop icon disappears too, after which the Gnome Disk Mounter Icon changes to its unmounted state.
Nyckelharpa
06-25-2003, 11:03 PM
Yes, I keep tinkering and still the only way to unmount the drive is by right clicking on the desktop icon and selecting Unmount Volume. The command line and panl Disk Mounter do not work. When I click the panel icon to umount, I get an error message which says:
Mounting via the command line or the panel launcher work fine.
canon006
06-25-2003, 11:18 PM
I've experienced this problem as well, occasionally my external hard drive or my pendrive will complain about being busy, all I do to rectify the problem is
umount /dev/sda1
instead of
umount /mnt/pendrive
see if that works.
As for icons automatically showing up on the desktop, Mandrake does this. I have icons for all my drives, including the removeable ones on the desktop with different icons for mounted and unmounted. Clicking on an unmounted device automatically mounts the device and opens a konqueror window to the appropriate directory.
Nyckelharpa
06-25-2003, 11:53 PM
Tried that, but same problem. Another strange point is that when I try to umount using the icon/menu method (the only one that works), I still get a message that says: Nautilus was unable to unmount the selected volume. (If I click details it says: umount: /mnt/pendrive: device is busy. But then the the little led on the drive itself starts flickering and the icon disappears anyway. It as if it is mounted, in the system's eyes, twice or something. Very odd.
I tried this in KDE too. I placed a drive icon on the desktop and selected mount and it all went well. I selected unmount and all went well, but when I tried mount again, I got something to the effect that the device was already mounted. Hmmmm.......
So
Nyckelharpa
06-26-2003, 12:39 AM
Yes, this unmounting problem only seems to occur after I have deleted something from the pendrive.... no other time. If stick it in fresh, I can mount and unmount a million times without problem. If I copy something to the drive, I can mount and unmount a million times without trouble. ONLY when I drag something to the trash in teh Gnome GUI does this happen. It doesn't matter if I empty the trash or not, the weird unmount problem shows up. I've tried it on both machines and on both the same thing.
Is this another RH quirk, or is something else missing in the equation?
terribleRobbo
06-26-2003, 01:30 AM
It's happened to me as well (RH8.0).
Yes, I did try the above suggestions. :P
mrBen
06-26-2003, 03:01 AM
Maybe it's _really_ slow?
;)
Nyckelharpa
06-26-2003, 04:09 AM
.... but the light on the drive was flickering in real time to whatever action I performed.
Anyway, I kept goofing around and thought about making an icon myself on the desktop. I right clicked on the Gnome menu and went to the disks selection in which I found CD ROM, Floppy and.... pendrive. So I selected that. The umount problem was actually worse than before as I just couldn't unmount it.
But then just on a lark, I thought about just unplugging the drive to see what happened as it seemed to be writing when I wrote to it right away, not when I unmounted. Well, after pulling it out I double clicked on the icon and... the nautilus window was empty. Then I plugged in back in, clicked on the icon, and the window was full again. I tried writing to it, deleting from it and all seems to work well.
Is this alright? It seems to work without any trouble in this way......
And how did my pendrive get into the desktop popup menu anyway?:rolleyes:
dvdnut
06-26-2003, 07:11 AM
have you tried to use the supermount command in fstab too?
i use mdk 9.1 and my pendrive mounted the first time
although if i have two usb devices (camera and pendrive)
whichever connects first gets /mnt/removable (as created by mdk) and the 2nd in line gets removable1 i think.
but if you plug in the other way (ie pen first then camera, their mount points will be different
weird but convenient
Nyckelharpa
06-26-2003, 09:19 AM
...anyway, that is what it seems on the basis of my searching around.
By the way, my "solution" was not a solution after all. Once I tried the pendrive on another computer, the files that seemed to be on it via the simple pull method were in fact not there. I thought that was weird.
But, I found that if I set up a disk launcher in KDE via the desktop/popup menu, I can mount and unmount, via the menu from the icon with no trouble. Is this a Gnome problem? In fact, it does seem to unmount when I click Unmount Volume on the pop-up menu, but it still have to give me an error message. And still the command line approach is a no go in terms of umount. Mount is ok, umount just gives me the ol' busy routine.
This is very frustrating...........:eek:
Nyckelharpa
06-26-2003, 09:50 AM
Well, I tried to do this some more as I seem to be doing without sleep.... Here is what I did (to no avail, before you get excited):
[root@localhost rg]# umount /mnt/pendrive
umount: /mnt/pendrive: device is busy
[root@localhost rg]# umount /dev/sda1
umount: /mnt/pendrive: device is busy
OK, so what is it that is busy, I wondered, so:
[root@localhost rg]# /usr/sbin/lsof /mnt/pendrive
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
fam 5126 rg 29r DIR 8,1 2048 78 /mnt/pendrive/.Trash-rg
Oh, it's the trash, that is why the problem always seems to pop up after I trash something. Hmmm, I thought, so let's get rid of the trash (Don't know if this was a good idea or not, but....)*
Well, tried again, but still got the busy signal, so I sought out the source and this was it:
[root@localhost rg]# /usr/sbin/lsof /mnt/pendrive
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
fam 5126 rg 29r DIR 8,1 2048 78 /mnt/pendrive/.Trash-rg (deleted)
Anway, unmounted via the icon/menu method and then tried again and I could mount and umount without problem from the command line....
But if I trash anythign again.......
Seems to be a problem with trashing as user rather than root?
DarkJedi9
06-26-2003, 01:08 PM
Question: I see you are trying to umount via the commandline. Is that how you mounted it? I'm thinking that if you mount with the icon (I have no kde or gnome experience and use gkrellm for my mounting/unmounting so this is just a guess), it has to be unmounted with the icon, because some process related to the icon is keeping the pendrive in its busy state.
Also, make sure you don't have any browser windows open with the pendrive anywhere in there. Seems to me that would also keep the pendrive busy. Just a few thoughts. Lemme know how it works out (and if you want to know how to set up gkrellm to do it).
Nyckelharpa
06-26-2003, 11:16 PM
Well, I couldn't help wondering what gkrellm was so checked it out, it looked interesting, and I apt-get (apt-got?) it (I have the RH apt-get installed). It works well for mounting and umounting the pendrive, but it still gets the busy signal for the trash thing....
But I have found this: The busy hangup only occurs if I trash a file via the GUI (drag to the trash). If I commandline rm a file, it doesn't happen. Why would that be. Why does the GUI method produce a .Trash-rg directory? And why does that hang things up in terms of umounting?
By the way, thanks for the gkrellm tip. Very good.:p
justlinux.com
Copyright Internet.com Inc. All Rights Reserved.