Page 1 of 2

Can't access or eject USB flash drive

Posted: Sat Mar 07, 2009 4:58 am
by gumby
My new Mint install won't let me open my USB flash drive. When I plug it into a USB hub, the flash drive light comes on, and an icon called "USB drive" appears in File Browser, but when I double click on the icon, I get an error: "Unable to mount location. Can't mount file."

This same thing happened when I ran the Live CD.

I'd like to try to unplug the flash drive and try plugging it directly into a usb port instead of a hub, but i can't find any way to unmount or eject it. When I right click and choose properties there's no option for unmount or eject. So to remove my flash drive safely, I will have to restart.

What's wrong? Thanks for any help.

Re: Can't access or eject USB flash drive

Posted: Sat Mar 07, 2009 5:12 am
by gumby
Okay, I have the same problem even when I plug it directly into the USB port.

Re: Can't access or eject USB flash drive

Posted: Sat Mar 07, 2009 7:21 am
by DataMan
Right click the desktop icon and select "Mount".

-DataMan

Re: Can't access or eject USB flash drive

Posted: Sat Mar 07, 2009 9:45 am
by garda
With the flash drive plugged in, execute this command in a Terminal window:

Code: Select all

sudo fdisk -l
If it freezes or refuses to show partition informations of your flash drive, there are two possibilities:
a) The flash drive is corrupted, or
b) It is not compatible with Linux (some Kingston drives, for example, have serious compatibility issues with Linux), which means there will not be much you can do to rectify it.

If fdisk does not freeze, please post here the outputs that you get.

Re: Can't access or eject USB flash drive

Posted: Sat Mar 07, 2009 12:30 pm
by gumby
DataMan wrote:Right click the desktop icon and select "Mount".

-DataMan
The only mount command I see in the right click menu is "mount volume" and nothing happens when I select it.

Re: Can't access or eject USB flash drive

Posted: Sat Mar 07, 2009 12:43 pm
by gumby
garda wrote:With the flash drive plugged in, execute this command in a Terminal window:

Code: Select all

sudo fdisk -l
If it freezes or refuses to show partition informations of your flash drive, there are two possibilities:
a) The flash drive is corrupted, or
b) It is not compatible with Linux (some Kingston drives, for example, have serious compatibility issues with Linux), which means there will not be much you can do to rectify it.

If fdisk does not freeze, please post here the outputs that you get.
Well Garda, I'm embarrassed to admit that, being a total newb, I don't yet know how to execute a command in terminal. I just pasted your sudo fdisk -1 command and then did not know how to execute it. Press "enter"? I tried that and got "[sudo] password for gumby:" But when I type my password it does not appear in the terminal. The cursor just blinks, doesn't move, and no password appears on the screen.

Re: Can't access or eject USB flash drive

Posted: Sat Mar 07, 2009 2:17 pm
by gumby
garda wrote:With the flash drive plugged in, execute this command in a Terminal window:

Code: Select all

sudo fdisk -l
...

If fdisk does not freeze, please post here the outputs that you get.
Okay Garda. I figured out how to execute the command and here is the output (the sdb: 2051 MB appears to be my 2 GB flash drive, which is a Transcend Jetflash brand):

Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x3a893a88

Device Boot Start End Blocks Id System
/dev/sda1 * 1 5100 40965718+ 7 HPFS/NTFS
/dev/sda2 5101 26430 171333225 f W95 Ext'd (LBA)
/dev/sda5 5101 5282 1461883+ 82 Linux swap / Solaris
/dev/sda6 5283 7893 20972826 83 Linux
/dev/sda7 7894 9460 12586896 83 Linux
/dev/sda8 9461 17945 68155731 83 Linux
/dev/sda9 17946 26430 68155731 83 Linux

Disk /dev/sdb: 2051 MB, 2051013632 bytes
33 heads, 63 sectors/track, 1926 cylinders
Units = cylinders of 2079 * 512 = 1064448 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdb1 1 1927 2002927 6 FAT16

Re: Can't access or eject USB flash drive

Posted: Sun Mar 08, 2009 2:56 am
by garda
Good news is there is at least one trick we can try to make it possible for you to access your flash drive. This involves adding the necessary informations to your fstab file. Now, with your flash drive plugged in, enter this command in the terminal:

Code: Select all

sudo su

Code: Select all

blkid
You will get lines of outputs that look more or less like this

/dev/sda6: TYPE="swap" UUID="de35b91d-cc1e-493e-aa69-779a7dbf8648"
/dev/sda7: UUID="6ed89bd6-e89b-4b15-9af0-fcc3d825ba8c" TYPE="ext3"
/dev/sdb1: LABEL="FLASHDRIVELABEL" UUID="F86C-C3C7" TYPE="vfat"

Before you edit the fstab, create a directory that will serve as the mount point for your flash drive:

Code: Select all

mkdir /media/trjf1
Then modify the access permissions of that directory:

Code: Select all

chmod 777 /media/trjf1
Time to open your fstab for editing:

Code: Select all

gedit /etc/fstab
Then add these two lines at the end of the file (note that the part that contains the partition information is a single line):

# Transcend JetFlash1
UUID=Enter the UUID of /dev/sdb1 that you got from the blkid command but remove the quotes /media/trjf1 vfat rw,noauto,nosuid,nodev,users,shortname=mixed,utf8,umask=077,flush 0 0

Review all the steps and edits you have done and, if you think everything is fine (i.e. no typos, nothing is skipped), save the changes and exit gedit. Last thing you would have to do is try to access your flash drive from Nautilus (the file browser) or, if it blurbs about your not having the necessary permissions, reboot your computer and try again.

Re: Can't access or eject USB flash drive

Posted: Sun Mar 08, 2009 4:27 am
by garda
If you are not sure what to add to your fstab, post here the outputs of:

Code: Select all

sudo blkid
and I will post the exact fstab line for you.

Re: Can't access or eject USB flash drive

Posted: Sun Mar 08, 2009 12:56 pm
by gumby
Thanks garda. Here is the output. The last item looks like my flash drive:

blkid
/dev/sda1: UUID="E8AC5E53AC5E1BFE" TYPE="ntfs"
/dev/sda5: TYPE="swap" UUID="52e7132f-6553-46b7-a9ff-b8b760a19a49"
/dev/sda6: UUID="c0f43a4f-6fca-48b8-89bf-b2296f4332d4" TYPE="ext3"
/dev/sda7: UUID="c7b30ea7-d83f-4a02-aaad-471d3dc2ac49" SEC_TYPE="ext2" TYPE="ext3"
/dev/sda8: UUID="f054016d-bac2-434c-9c16-d873434ee7a2" SEC_TYPE="ext2" TYPE="ext3"
/dev/sda9: UUID="86adca8e-3348-4050-b219-3c2406751654" SEC_TYPE="ext2" TYPE="ext3"
/dev/sdb1: SEC_TYPE="msdos" LABEL="MGFLASH" UUID="09EA-3A0B" TYPE="vfat"

Re: Can't access or eject USB flash drive

Posted: Sun Mar 08, 2009 1:05 pm
by gumby
garda wrote:
Before you edit the fstab, create a directory that will serve as the mount point for your flash drive:

Code: Select all

mkdir /media/trjf1
Then modify the access permissions of that directory:

Code: Select all

chmod 777 /media/trjf1
Garda,
In my thread about making a data partition, I learned that it was best to mount the data partition in Home (but not to put Home in a separate partition). Would it be best to also mount the flash drive in Home?

Also, I have about 5 flash drives. Am I going to have to do this for all of them? I also have an external HD in a USB box from which I will need to transfer old data files to my Linux installation

Does everybody have to do this or do I have a special problem? I thought Linux would detect the removable mass storage devices automatically, like Windows does! :shock:

Re: Can't access or eject USB flash drive

Posted: Sun Mar 08, 2009 1:20 pm
by gumby
Okay, I can report that my external HD is accessible in Nautilus. Now if only I could figure out why I can't copy files from it to my Data Partition. (Could it have something to do with the padlock icon I see on the partition? :? But that's a separate subject, not for this thread.

Re: Can't access or eject USB flash drive

Posted: Sun Mar 08, 2009 1:42 pm
by garda
Would it be best to also mount the flash drive in Home?
Should not make any difference. But creating mount points under /media/ keeps everything well organized, since that is normally where all mount points would be automatically created.
Does everybody have to do this or do I have a special problem?
You have a special problem. All of my external storage devices are detected and mounted automatically on insertion without any problems whatsoever. It could be HAL that has been causing this, but not quite sure right now -- Gnome Volume Mounter can also cause problems with some external devices.

And this is how the added line in your fstab should look like:

UUID=09EA-3A0B /media/trjf1 vfat rw,noauto,nosuid,nodev,users,shortname=mixed,utf8,umask=077,flush 0 0

Just a reminder, make sure that you have created the mount point (directory) and you have changed the access permission for it before adding the above line to your fstab.

Re: Can't access or eject USB flash drive

Posted: Sun Mar 08, 2009 2:28 pm
by Fred
garda is correct. Your external drives should mount without issue when you plug them in. Occasionally you will have an odd ball that you have to help by making a mount point folder and/or putting a line in fstab, but it is unusual.

How it works is when you plug a device in the machine makes a mounting line and puts it in /mnt and a folder mount point in /media. When you safely remove and unplug it the mounting line in /mnt is removed along with the folder in /media.

Sometimes it is necessary to manually put a folder in /media, for some unknown reason to me. Some times the /mnt folder will not get the mounting line either so one has to be put in /etc/fstab manually. This is unusual however, and is generally limited to one particular device that doesn't cooperate.

Your permanent storage devices, ie your internal hard drive partitions that you want mounted each time you boot, I like to put in home for easier access but they can and often do go in /media instead of or in addition to the /home mount. /media is where Ubuntu used to mount these internal partitions when they were mounted by default.

Fred

Re: Can't access or eject USB flash drive

Posted: Mon Mar 09, 2009 5:43 pm
by garda
Thanks for the details, Fred. :) I am often too lazy to give detailed answers, so that kind of helps a lot.

Gumby, have you solved the problem or does it still persist? You only have to manually add mount points to fstab for storage devices that cannot be automatically handled, not for every one and all of them.

Re: Can't access or eject USB flash drive

Posted: Mon Mar 09, 2009 10:52 pm
by gumby
Thanks Fred and Garda. I've been too busy to implement your suggestions, Garda. I will do so soon and report back.

Re: Can't access or eject USB flash drive

Posted: Wed Mar 11, 2009 7:29 pm
by dlkreations
Since you haven't reported back for a couple days, I am going to assume that the issue is still present. Do you by chance use this drive on a Windows system? If so, do you properly unmount it from there, or just unplug it first without thinking about it?

If you do use it on a Windows system, try clicking the icon in the system tray of Windows that looks like a drive with a green arrow on top of it. It'll say something like "Safely remove such and such". That's at least what I do when I use my external drives at work on the Windows system I use.

Hopefully I got the gist of the thread, and I'm not reading it out of context.

Re: Can't access or eject USB flash drive

Posted: Fri Mar 13, 2009 2:26 pm
by gumby
garda wrote:Good news is there is at least one trick we can try to make it possible for you to access your flash drive. This involves adding the necessary informations to your fstab file. Now, with your flash drive plugged in, enter this command in the terminal:

Code: Select all

sudo su

Code: Select all

blkid
You will get lines of outputs that look more or less like this

/dev/sda6: TYPE="swap" UUID="de35b91d-cc1e-493e-aa69-779a7dbf8648"
/dev/sda7: UUID="6ed89bd6-e89b-4b15-9af0-fcc3d825ba8c" TYPE="ext3"
/dev/sdb1: LABEL="FLASHDRIVELABEL" UUID="F86C-C3C7" TYPE="vfat"

Before you edit the fstab, create a directory that will serve as the mount point for your flash drive:

Code: Select all

mkdir /media/trjf1
Then modify the access permissions of that directory:

Code: Select all

chmod 777 /media/trjf1
Time to open your fstab for editing:

Code: Select all

gedit /etc/fstab
Then add these two lines at the end of the file (note that the part that contains the partition information is a single line):

# Transcend JetFlash1
UUID=Enter the UUID of /dev/sdb1 that you got from the blkid command but remove the quotes /media/trjf1 vfat rw,noauto,nosuid,nodev,users,shortname=mixed,utf8,umask=077,flush 0 0

Review all the steps and edits you have done and, if you think everything is fine (i.e. no typos, nothing is skipped), save the changes and exit gedit. Last thing you would have to do is try to access your flash drive from Nautilus (the file browser) or, if it blurbs about your not having the necessary permissions, reboot your computer and try again.
Garda,

Sorry to disappear for a few days. I just did everything you said, and added these two lines to the end of fstab:

# Transcend JetFlash1
UUID=09EA-3A0B /media/trjf1 vfat rw,noauto,nosuid,nodev,users,shortname=mixed,utf8,umask=077,flush 0 0

Saved the changes.

But I still could not access the USB drive. I restarted, and still cannot access it.

Did I get the code correct?

Gumby

Re: Can't access or eject USB flash drive

Posted: Fri Mar 13, 2009 2:47 pm
by garda
Gumby, let's see if we can mount the flash drive manually. First, with the flash drive unplugged, comment out the added line (add a hash mark in front of it):

Code: Select all

sudo su

Code: Select all

gksu gedit /etc/fstab
Make the string look like this:
# UUID=09EA-3A0B /media/trjf1 vfat rw,noauto,nosuid,nodev,users,shortname=mixed,utf8,umask=077,flush 0 0

Then save the changes and close the file. Back to the terminal, type these commands in the terminal (plug the flash drive first):

Code: Select all

mkdir /media/test

Code: Select all

mount -t vfat /dev/sdb1 /media/test
Then check whether you can read from and write to the flash drive.

Re: Can't access or eject USB flash drive

Posted: Fri Mar 13, 2009 2:50 pm
by gumby
dlkreations wrote:Since you haven't reported back for a couple days, I am going to assume that the issue is still present. Do you by chance use this drive on a Windows system? If so, do you properly unmount it from there, or just unplug it first without thinking about it?

If you do use it on a Windows system, try clicking the icon in the system tray of Windows that looks like a drive with a green arrow on top of it. It'll say something like "Safely remove such and such". That's at least what I do when I use my external drives at work on the Windows system I use.

Hopefully I got the gist of the thread, and I'm not reading it out of context.
Yes, Dlkreations, I use it in Windows and it works fine, and I always unmount it before removing it via the little arrow icon.