LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Removable Flash Drive Problems (https://www.linuxquestions.org/questions/slackware-14/removable-flash-drive-problems-458639/)

BlackSheep024 06-27-2006 12:04 AM

Removable Flash Drive Problems
 
I've inserted a removable flash drive into my computer, and for some reason I can't seem to find it. Are there commands I need to enter in order to see/get my system to read my flashdrive?

prozac 06-27-2006 12:30 AM

try the command
Code:

fdisk -l
, it will show all filesystems including hot-pluggable ones. if your flash drive is detected, it will be there. you will need to mount it to able to read it.

Bruce Hill 06-27-2006 12:31 AM

To see if your system picked it up, you should issue "dmesg | tail" after it's been plugged in.

krussell 06-27-2006 03:10 AM

hello :)
after adding the following lines in your /etc/fstab you should be able to mount flash drive from Storage Device in Konqueror.

/dev/sda1_______ /mnt/usb-flash______ vfat _______ noauto,user,owner,rw,umask=000 ____ 1__ 0

just change sda1 to only sda or sda2, and make sure you did "mkdir /mnt/usb-flash"

Bruce Hill 06-27-2006 03:15 AM

krussell,

You can only mount a partition, i.e. /dev/sda1 -- not a drive, i.e. /dev/sda.

The OP could also be running two SATA drives, like me, in which case his first USB removable storage drive would be /dev/sdc1.

Code:

mingdao@silas:~$ dmesg | tail
sdc: assuming drive cache: write through
SCSI device sdc: 512000 512-byte hdwr sectors (262 MB)
usb 1-6: reset high speed USB device using ehci_hcd and address 7
sdc: Write Protect is off
sdc: Mode Sense: 02 00 00 00
sdc: assuming drive cache: write through
 sdc: sdc1
sd 2:0:0:0: Attached scsi removable disk sdc
sd 2:0:0:0: Attached scsi generic sg2 type 0
usb-storage: device scan complete

Let's not be too premature with our advice, eh?

archtoad6 06-27-2006 05:32 AM

tail defaults to 10 lines, I would add " -20":
Code:

dmesg  | tail -20            # or
dmesg  | tail -20  | less

Also, lsusb can provide useful info, starting w/ whether it was detected.

BlackSheep024 06-27-2006 10:33 AM

It seems like hotplug isn't detecting the device. Is this a sign that I should upgrade to kernel 2.6? (btw, I issued lsusb, and dmesg | tail)

PS- dmesg | tail had some note of new usb hardware detected, but after removing my drive and issuing the same command, the same notice appeared. Lsusb showed about 6 things, none of which sounded remotely close to a removable drive.

Bruce Hill 06-27-2006 11:01 AM

We can't see the output unless you give us a shell account, or post it here...

You might also want to add what version of Slackware, which kernel, etc.

BlackSheep024 06-27-2006 11:13 AM

Slackware 10.2, Kernel 2.4. Strangely enough, the device appeared after I gave it a second shot

output of lsusb:
Bus 005 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000
Bus 004 Device 002: ID 046d:c03d Logitech, Inc.
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
Bus 001 Device 005: ID 0457:0151 Silicon Integrated Systems Corp.

output of dsmesg | tail
SCSI device sda: 2007040 512-byte hdwr sectors (1028 MB)
sda: Write Protect is off
sda: sda1
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 4
USB Mass Storage support registered.
usb.c: USB disconnect on device 00:02.2-2 address 4
hub.c: new USB device 00:02.2-2, assigned address 5
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 5

Now what do I do?

Bruce Hill 06-27-2006 11:18 AM

Wait for your system to finish scanning the device?

BlackSheep024 06-27-2006 01:49 PM

The drive finished scanning
 
How do I go about mounting it? As in, how do I know which directory to mount? (actually, if someone could explain mounting, that would be a big help) I've only mounted images with daemon tools using the virtual drives.

cwwilson721 06-27-2006 03:49 PM

Quote:

Originally Posted by BlackSheep024
Slackware 10.2, Kernel 2.4. Strangely enough, the device appeared after I gave it a second shot

output of lsusb:
Bus 005 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000
Bus 004 Device 002: ID 046d:c03d Logitech, Inc.
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
Bus 001 Device 005: ID 0457:0151 Silicon Integrated Systems Corp.

output of dsmesg | tail
SCSI device sda: 2007040 512-byte hdwr sectors (1028 MB)
sda: Write Protect is off
sda: sda1

WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 4
USB Mass Storage support registered.
usb.c: USB disconnect on device 00:02.2-2 address 4
hub.c: new USB device 00:02.2-2, assigned address 5
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 5

Now what do I do?

There is the importtant part.
Now
Code:

# mkdir /mnt/usbkey
# mount -t vfat /dev/sda1 /mnt/usbkey

Do the above as root. And change the names to whatever you wish.

Bruce Hill 06-28-2006 01:37 AM

Quote:

Originally Posted by BlackSheep024
How do I go about mounting it? As in, how do I know which directory to mount? (actually, if someone could explain mounting, that would be a big help) I've only mounted images with daemon tools using the virtual drives.

It looked as if your system had not finished scanning your device. You should have gotten a final line similar to what I posted before:
Quote:

usb-storage: device scan complete
Did you not get this? It could take 30 seconds or more for your system to finish scanning, and it looked from your output as it there might be a problem. You should have issued "dmesg | tail" again until it either finished scanning the device or gave up; which I think would give you a disconnect line.

If it did finish scanning, you'd probably like to mount it, read it, and write it as a normal user. You should only use root for system administration tasks.

To learn more about mounting devices, you can issue in a terminal and read "man mount", and also "man fstab" -- because /etc/fstab is the file which contains information about your file systems. This file allows you to setup devices to be read automatically, without having to issue a longer command each time you want to mount a device.

Now that we know the USB flash drive you want to use will be /dev/sda1 we can recommend a line for your /etc/fstab file. The following will allow you to mount the device as a normal user, read and write to it, and unmount it. You may create the mount point wherever you desire. Below is my suggestion only:
Code:

/dev/sda1        /usb1            vfat        noauto,users,rw,umask=1000 0 0
/dev/sdb1        /usb2            vfat        noauto,users,rw,umask=1000 0 0

In this example there are two devices and two mount points. Just in case you have your flash drive plugged in, then decide to plug in your camera and get the photos off of it, for example. I've told it "noauto" which means it doesn't automatically mount the device, you have to actually issue a command I'll give later to mount it.

You can su (switch user) to root and create mount points like this:
Code:

mingdao@silas:~$ su
Password:
root@silas:/home/mingdao# mkdir /usb1

Since you've done this as root, that directory will be owned by root, and only root can mount and write to the device. To change that so a normal user on your system can mount, read, and write, issue these commands while still logged into the terminal as root:
Code:

chown mingdao.users /usb1
chmod 757 /usb1

What we've done is change owner (chown) from root in group root to mingdao in group users. Then we changed file access permissions (chmod) so that root and user mingdao can read, write, and execute files; while other users can read and execute, but not write. If you want every user on your system to also write to the the device, then "chmod 777 /usb1" is what you want.

Now to mount it. We've set it up so that normal users (not root) can mount and read/write to the device. There are several ways to mount it. You can open a terminal and issue "mount /usb1" for /dev/sda1 or "mount /usb2" for /dev/sdb2. To unmount it you cd out of it's directory (if you were there) and issue "umount /usb1" -- notice there is one 'n' in umount.

If you're running KDE, you can click on the System icon on your desktop, then Storage Media, then whichever device you choose > Removable Device (sda1) for example. To unmount it you navigate back to the Storage Media screen, right-click the same icon and choose Safely Remove.

If you're using Xfce, you can open the File Manager (xffm), click the arrow in front of Fstab to expand it's tree, then right-click on /usb1 and choose Mount. Then the only way I see to get it in the right hand window is to navigate by clicking folder icons and up arrow ^ icons until you get to / and then click it. To unmount it, close the folder on the right hand side and get back up the tree and then go to the left hand side, click /usb1 and choose Unmount.

wchild 06-28-2006 03:00 AM

Quote:

Originally Posted by BlackSheep024
I've inserted a removable flash drive into my computer, and for some reason I can't seem to find it. Are there commands I need to enter in order to see/get my system to read my flashdrive?

I'd suggest you to read the Flash Memory HOWTO

Bruce Hill 06-28-2006 05:59 AM

Quote:

Originally Posted by wchild
I'd suggest you to read the Flash Memory HOWTO

Which one is that ... link, please.
I found a few with Google <Linux> but most are out-of-date.
Typical of TLDP docs...


All times are GMT -5. The time now is 09:20 AM.