LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to unmount a USB device that I can't find (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-unmount-a-usb-device-that-i-cant-find-466274/)

Odyssey1942 07-21-2006 11:53 AM

How to unmount a USB device that I can't find
 
Apologies if I am missing something very fundamental here, but when I plug in my Kingston USB device, it does not show up on the desktop, but is listed by "dmesg | grep SCSI" as " sda ". So Ubuntu found it, but I don't how to determine exactly where it is, or how to "unmount" it, and can't find anything with Google that clues me in. Can anyone assist? TIA.

Nylex 07-21-2006 11:59 AM

If you've plugged it in and haven't mounted it yet, you can't unmount it! Do you mean you want to mount it?

lockpicker 07-21-2006 12:05 PM

well it sure looks like you have'nt mounted it in the first place
for that you could be using

mkdir /mnt/flash
mount -t vfat /dev/sda /mnt/flash

assuming that you have a FAT32 filesystem on your drive.

and access your device using /mnt/flash

for unmounting : umount /mnt/flash

Nylex 07-21-2006 12:06 PM

For Ubuntu, you'll need to prefix the commands given by lockpicker with "sudo", unless you've enabled the root account.

Edit:

Quote:

Originally Posted by lockpicker
mount -t vfat /dev/sda /mnt/flash

The bold bit should read /dev/sdax, where x is a number; you mount partitions. dmesg should tell you how many partitions there are on the device, if there's just one, it should be /dev/sda1.

Odyssey1942 07-22-2006 07:51 AM

Thanks all, Will try this when I get to office and report back.

Nylex, In everyday english, I want to use the USB device and ideally by finding it on the desktop. I am not sure exactly what mounting does but suspect that it "enables" use of the device, and possibly puts an icon on the desktop (although this may be a separate process from mounting). So the purpose of this thread is to further my objective and any assistance you can give will be greatly appreciated.

Nylex 07-22-2006 07:54 AM

Mouting attaches the filesystem on the device to your tree, as it were. Again, you need to mount the device before using it and you can't unmount something that hasn't been mounted in the first place.

jstephens84 07-22-2006 10:07 AM

The reason your usb drive showed up as a scsi device is linux treats all usb devices as a scsi device. Just like on a laptop all pcmcia cards are treated as pci devices.

johnathan 07-22-2006 11:03 AM

mounting and unmounting a usb device
 
Depending on your distribution and icon may appear or not appear at all...

There should be a directory for your usb devices in /mnt/usb if there is no icon on your desktop....

If there is no directory then open up a terminal and type

Mkdir /mnt/usb

Then plug in your device and type dmesg..
Look at the bottom of the output for "sda1" or another directory or something like that and type "mount /dev/sda1 or the scsi identifier for your device.

To unmount type "unmount or umount and then /dev/sda1 or the scsi identifier..

Hope this helps!!

Nylex 07-22-2006 11:08 AM

Quote:

Originally Posted by johnathan
Mkdir /mnt/usb

Case sensitivity is important here - it should be "mkdir".

johnathan 07-22-2006 11:33 AM

Sorry about that...

Odyssey1942 07-24-2006 07:42 AM

Thanks guys. Did not make it to the office Sat or Sun but will be in this morning and will try those.

Odyssey1942 07-24-2006 05:20 PM

here are directory contents:

odyssey@ubuntu:/mnt$ cd sda1
odyssey@ubuntu:/mnt/sda1$ ls -l
total 0
odyssey@ubuntu:/mnt/sda1$ cd ..
odyssey@ubuntu:/mnt$ cd sdb1
odyssey@ubuntu:/mnt/sdb1$ ls -l
total 0
odyssey@ubuntu:/mnt/sdb1$ cd ..
odyssey@ubuntu:/mnt$ cd usb
odyssey@ubuntu:/mnt/usb$ ls -l
total 0

I.e., there are 3 directories in mnt: all apparently empty

here are last lines from dmesg (had to use a different USB drive (Lexar)):

usb 2-2: new full speed USB device using ohci_hcd and address 5
scsi5 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 5
usb-storage: waiting for device to settle before scanning
Vendor: LEXAR Model: JUMPDRIVE Rev: 1.11
Type: Direct-Access ANSI SCSI revision: 01 CCS
SCSI device sda: 125952 512-byte hdwr sectors (64 MB)
sda: Write Protect is off
sda: Mode Sense: 23 00 00 00
sda: assuming drive cache: write through
SCSI device sda: 125952 512-byte hdwr sectors (64 MB)
sda: Write Protect is off
sda: Mode Sense: 23 00 00 00
sda: assuming drive cache: write through
/dev/scsi/host5/bus0/target0/lun0: p1
Attached scsi removable disk sda at scsi5, channel 0, id 0, lun 0
usb-storage: device scan complete

As I interpret this, the Lexar USB drive is sda, but cannot see where it is.

Anyway I tried mount /dev/sda and got:

odyssey@ubuntu:/mnt/usb$ mount /dev/sda
mount: can't find /dev/sda in /etc/fstab or /etc/mtab
---------------
I felt that the USB drive could not be unmounted until it got mounted. You confirmed this.

Ubuntu obviously sees the USB drive, but I cannot. I guess I just don't understand the process.

I have tried the above suggestions, but still cannot find or mount the drive. Am I doing something wrong? TIA.

Odyssey1942 07-24-2006 05:40 PM

My other thread: Sooooooo sloooooow

has taken a turn to exactly the same issue, so am posting the results here from that thread that are relevant to the USB drive here and will hope to consolidate into this thread:

Here is result from tail /var/log/messages :

Jul 24 16:46:05 localhost kernel: Type: Direct-Access ANSI SCSI revision: 01 CCS
Jul 24 16:46:05 localhost kernel: SCSI device sda: 125952 512-byte hdwr sectors (64 MB)
Jul 24 16:46:05 localhost kernel: sda: Write Protect is off
Jul 24 16:46:05 localhost kernel: SCSI device sda: 125952 512-byte hdwr sectors (64 MB)
Jul 24 16:46:05 localhost kernel: sda: Write Protect is off
Jul 24 16:46:05 localhost kernel: /dev/scsi/host5/bus0/target0/lun0: p1
Jul 24 16:46:05 localhost kernel: Attached scsi removable disk sda at scsi5, channel 0, id 0, lun 0
Jul 24 16:46:06 localhost scsi.agent[11476]: sd_mod: loaded sucessfully
Jul 24 16:56:10 localhost -- MARK --
Jul 24 17:16:10 localhost -- MARK --

these lines from above seem to indicate where the drive is but I don't understand them:

Jul 24 16:46:05 localhost kernel: /dev/scsi/host5/bus0/target0/lun0: p1
Jul 24 16:46:05 localhost kernel: Attached scsi removable disk sda at scsi5, channel 0, id 0, lun 0

Does this tell anyone anything?

Here are results from lockpicker's suggestion:

odyssey@ubuntu:/mnt/usb$ sudo mount -t /dev/sda /mnt/usb
Usage: mount -V : print version
mount -h : print this help
mount : list mounted filesystems
mount -l : idem, including volume labels
So far the informational part. Next the mounting.
The command is `mount [-t fstype] something somewhere'.
Details found in /etc/fstab may be omitted.
mount -a [-t|-O] ... : mount all stuff from /etc/fstab
mount device : mount device at the known place
mount directory : mount known device here
mount -t type dev dir : ordinary mount command
Note that one does not really mount a device, one mounts
a filesystem (of the given type) found on the device.
One can also mount an already visible directory tree elsewhere:
mount --bind olddir newdir
or move a subtree:
mount --move olddir newdir
A device can be given by name, say /dev/hda1 or /dev/cdrom,
or by label, using -L label or by uuid, using -U uuid .
Other options: [-nfFrsvw] [-o options] [-p passwdfd].

this line:
"The command is `mount [-t fstype] something somewhere'." appears to me to be exactly what lockpicker suggested, but clearly I did something wrong? I have read the info above but can't see where I went astray.

lockpicker 07-24-2006 10:35 PM

just try
mount -t vfat /dev/sda1 /mnt/flash
provided you've already created /mnt/flash using mkdir /mnt/flash

if that dosent seem to work then just try

mount /dev/sda1 /mnt/flash
or
mount /dev/sda /mnt/flash

P.S: The commands wont give you any output..You'll just get the bash prompt back (assuming you're using bash).

Odyssey1942 07-25-2006 08:18 AM

lockpicker, thanks. If there is no report following the commands, will the icon show up on the desktop (or is that another matter) or how will I know if I accomplished anything?


All times are GMT -5. The time now is 11:03 AM.