LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Got usb drive, what are these files? (https://www.linuxquestions.org/questions/linux-hardware-18/got-usb-drive-what-are-these-files-315059/)

M$ISBS 04-19-2005 06:53 PM

Got usb drive, what are these files?
 
Got this usb drive thing to work, I think, and when I mount it there is a file called " Devices " and a directory created, " 001 ". what are these and what do I do with them? if I open up the 001 directory there are 3 other directories " 001 002 006 " I cant seem to copy anything to or from the usb drive, it just ends up in the mount point I created by following a tutorial on LQ.

username17 04-19-2005 06:57 PM

What tutorial did you follow?

Out of the box, if all is well the following should work:
"mount /dev/sda1 /mnt/foo"

foo being the mount point you created under the /mnt directory.

After making changes (adding removing files) you need to "umount /mnt/foo"

USB storage devices are treated as SCSI, if you have other SCSI devices (hard drives) then your pen drive will most likely not be /dev/sda1, but another sd* device.

I'm not sure about the contents of your pen drive, it could be improper mounting, it could be just the pendrive has contents on it from the factory.

jschiwal 04-19-2005 07:53 PM

You didn't indicate which distro and version that you are using. Often the hotplug system will automatically mount the usb drive.

For example, for SuSE linux, a partition will be created under /media and mounted automatically.
One problem is that there won't be normal entry for it looking at the mount command output or the fstab table.

The entry in /etc/fstab for it is a generic one that might look like this:
usbfs /proc/bus/usb usbfs noauto 0 0

I'm not sure if you could for example include a 'uid=' option for this, and if the autofs system would pick it up. Part of the problem is that there are two ways that user devices are handled in linux.

You might want to read through the man 8 hotplug page, as well as the file /usr/share/doc/packages/hotplug/README if it exists on your system.

Also, there may be a hotplug service that will list mounted devices.
For SuSE /usr/sbin/rchotplug
For Mandrake and others try 'service hotplug --help' for options.

Also read through the /etc/sysconfig/hotplug file. This file will tell you whether subfs is used or something else.

M$ISBS 04-19-2005 08:14 PM

I am using slackware 10 and kernel 2.6
I cant find the tutorial, but its here somewhere on LQ
I have read around and I think I was doing it wrong but now I tried the way I found and it still does not work.
I do this:
mount -t vfat /dev/sda1 /mnt/flashdrive
and I get a message that says
mount: wrong fs type, bad option, bad superblock on /dev/sda1,
or too many mounted file systems

I have seen a file called fstab and have this line:
/dev/sda1 /mnt/flashdrive auto noauto,owner,users 0 0

? What else could I try

username17 04-20-2005 12:09 AM

Try just "mount /mnt/flashdrive" and see what happens.
Typically I don't choose a fstype, I just use auto.
You're fstab config is configured to use auto, so just stick with that.

M$ISBS 04-20-2005 01:16 AM

After reading through all kinds of stuff about USB and fstab I have tried auto, vfat and all kinds of other filesystems but nothing is working. I keep getting that same error message. I have tried mount /mnt/flashdrive and that does not work either :( What else can I try? When I reboot into windows the usb drive works fine.

kencaz 04-20-2005 01:32 AM

Quote:

Originally posted by M$ISBS
I am using slackware 10 and kernel 2.6
I cant find the tutorial, but its here somewhere on LQ
I have read around and I think I was doing it wrong but now I tried the way I found and it still does not work.
I do this:
mount -t vfat /dev/sda1 /mnt/flashdrive
and I get a message that says
mount: wrong fs type, bad option, bad superblock on /dev/sda1,
or too many mounted file systems

I have seen a file called fstab and have this line:
/dev/sda1 /mnt/flashdrive auto noauto,owner,users 0 0

? What else could I try

Hmm, seems like if it's in your fstab then typing mount /dev/sda1 /mnt/flashdrive would give you an already mounted message.
Is there anything on the drive yet...? Have you tried looking for any files on /mnt/flashdrive

ls -l /mnt/flashdrive

See if you can give us some output from ther terminal to see what is actually on your system:

fdisk -l

mount

cat /etc/fstab

KC

DarkVenger 04-20-2005 03:25 AM

When you plug the pen, wait one minute or two and them see the output of the dmesg comand.

If when you mount you have that great amount of folders is because the pen is mounted with usbfs, it is preferrable to use auto instead.

[EDIT]I'm using the same Slackware and Kernel and my pens work fine.

M$ISBS 04-20-2005 01:57 PM

When I do ls -l /mnt/flashdrive it just says " total 0 "

When I do fdisk -l it says this, for the flashdrive:
" Device Boot Start End Blocks Id System /dev/sda1 * 1 500 31982+ 1 FAT12"

Mount /dev/hda1 on / type reiserfs (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
usbfs on /proc/bus/usb type usbfs (rw)

cat /etc/fstab
/dev/hda1 / reiserfs defaults 1 1
/dev/cdrom /mnt/cdrom iso9660 noauto,owner,users,ro 0 0
/dev/cdrom1 /mnt/cdrom1 iso9660 noauto,owner,users 0 0
/dev/dvd /mnt/dvd auto noauto,owner,users 0 0
/dev/fd0 /mnt/floppy auto noauto,owner 0 0
/dev/sda1 /mnt/flashdrive auto noauto,owner,users 0 0
/dev/sda2 /mnt/flashdrive auto noauto,owner,users 0 0
/dev/sda3 /mnt/flashdrive auto noauto,owner,users 0 0
/dev/sda4 /mnt/flashdrive auto noauto,owner,users 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0

dmesg

usb 1-4.1: new full speed USB device using ehci_hcd and address 3
Initializing USB Mass Storage driver...
scsi0 : SCSI emulation for USB Mass Storage devices
usbcore: registered new driver usb-storage
USB Mass Storage support registered.
usb-storage: device found at 3
usb-storage: waiting for device to settle before scanning
Vendor: USB Mass Model: Storage Device Rev:
Type: Direct-Access ANSI SCSI revision: 02
SCSI device sda: 64000 512-byte hdwr sectors (33 MB)
sda: Write Protect is off
sda: Mode Sense: 37 00 00 08
sda: assuming drive cache: write through
SCSI error: host 0 id 0 lun 0 return code = 8000002
Sense class 7, sense error 0, extended sense 0
SCSI device sda: 64000 512-byte hdwr sectors (33 MB)
sda: Write Protect is off
sda: Mode Sense: 37 00 00 08
sda: assuming drive cache: write through
sda: sda1
SCSI error: host 0 id 0 lun 0 return code = 8000002
Sense class 7, sense error 0, extended sense 0
Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0, type 0
usb-storage: device scan complete
SCSI error: host 0 id 0 lun 0 return code = 8000002
Sense class 7, sense error 0, extended sense 0
SCSI error: host 0 id 0 lun 0 return code = 8000002
Sense class 7, sense error 0, extended sense 0
SCSI error: host 0 id 0 lun 0 return code = 8000002
Sense class 7, sense error 0, extended sense 0
SCSI error: host 0 id 0 lun 0 return code = 8000002
Sense class 7, sense error 0, extended sense 0
SCSI error: host 0 id 0 lun 0 return code = 8000002
Sense class 7, sense error 0, extended sense 0
FAT: invalid media value (0x22)
VFS: Can't find a valid FAT filesystem on dev sda1.
SCSI error: host 0 id 0 lun 0 return code = 8000002
Sense class 7, sense error 0, extended sense 0
SCSI error: host 0 id 0 lun 0 return code = 8000002
Sense class 7, sense error 0, extended sense 0
FAT: invalid media value (0x22)
VFS: Can't find a valid FAT filesystem on dev sda1.
SCSI error: host 0 id 0 lun 0 return code = 8000002
Sense class 7, sense error 0, extended sense 0

There are some error messages above but I dont know what they are?
Thanks for any help, I hope I can use this thing, I just bought it.

jschiwal 04-20-2005 04:54 PM

Are you able to mount /dev/sda2, /dev/sda3, /dev/sda4?
Your fstab indicates 3 other partitions. I've seen where the first partition is very small and not used on usb key drives. How many partitions show up in windows?

Are there other partitions indicated by the root command:
fdisk -l /dev/sda

M$ISBS 04-20-2005 11:59 PM

No, When I try other sda2,3,4 I get " Does not exist "

This is output of fdisk -l /dev/sda and when i do this the light on the flashdrive flashes, It seems like I am so close to getting this to work but why wont it mount?

Disk /dev/sda: 32 MB, 32768000 bytes
8 heads, 16 sectors/track, 500 cylinders
Units = cylinders of 128 * 512 = 65536 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 500 31982+ 1 FAT12


THANKS!!

slackist 04-21-2005 06:44 AM

What model of thumb drive is it?

I had similar problems with one (Apacer handy something or other) I used that was pre-formatted for windows until I used cfdisk to reformat it to vfat.

IIRC it was showing up with 4 partitions, but cfdisk complained that the partitions were over-writing each other or something like that.

I deleted the partitions one by one, and then wrote a new partition to use the whole drive and it was fine between Linux boxes but every time I plugged it into a Win box Windows would complain it wasn't formatted, and of course offer to format it :(

I gave it away

BtroddimusPrime 04-21-2005 10:46 AM

The files you are looking at are files from the boot partition. I know the ones you're talking about but I'm not sure what they do. Have you checked the drive size? It may be a lot smaller than you think...

BTW I overwrote mine when trying to install Lilo and it did no harm. See if the other partition mount (sda2, sda3 etc...)

kencaz 04-21-2005 11:48 AM

FAT12???? what did you use to partition the drive?

KC

DarkVenger 04-21-2005 02:46 PM

Quote:

Originally posted by M$ISBS
/dev/sda1 /mnt/flashdrive auto noauto,owner,users 0 0
/dev/sda2 /mnt/flashdrive auto noauto,owner,users 0 0
/dev/sda3 /mnt/flashdrive auto noauto,owner,users 0 0
/dev/sda4 /mnt/flashdrive auto noauto,owner,users 0 0
This will be a problem when you have more than one flashdrive, you could make a diferent folder for each sdaX.
Btw, if you connect more flashdrives, you problaby will have sdb1, sdc1... and not sda1,sda2...
-----------------
Quote:

usb-storage: waiting for device to settle before scanning
Vendor: USB Mass Model: Storage Device Rev:
Type: Direct-Access ANSI SCSI revision: 02
SCSI device sda: 64000 512-byte hdwr sectors (33 MB)
sda: Write Protect is off
sda: Mode Sense: 37 00 00 08
sda: assuming drive cache: write through
SCSI error: host 0 id 0 lun 0 return code = 8000002
Sense class 7, sense error 0, extended sense 0
SCSI device sda: 64000 512-byte hdwr sectors (33 MB)
sda: Write Protect is off
sda: Mode Sense: 37 00 00 08
sda: assuming drive cache: write through
sda: sda1 <---- this is the creation of /dev/sda1, that represents the real flashdrive*
(...)
FAT: invalid media value (0x22)
VFS: Can't find a valid FAT filesystem on dev sda1. This means that problably you have to format your flashdrive
* Just something you probably don't know, the /dev/ directory is a dinamic one, if your using kernel 2.6 this directory is managed by udev, and udev creates links to devices dinamicaly, so if you just have one flashdrive connect don't espect having more than sda1.

M$ISBS 04-21-2005 11:31 PM

I didnt know you had to partition a flashdrive, Just so were on the same page, Were talking about the USB drives you plug in and can remove quickly, right?
So I dont need the sda2, sda3 or sda4?

"Just something you probably don't know, the /dev/ directory is a dinamic one, if your using kernel 2.6 this directory is managed by udev, and udev creates links to devices dinamicaly, so if you just have one flashdrive connect don't espect having more than sda1."
I have no idea what that means??

Thanks for the help and I will keep working on this, I need this to work. :)

kencaz 04-22-2005 12:01 AM

Sure you can partition FlashDrives.
http://www.ibiblio.org/pub/Linux/doc...OWTO.html#ext2

I don't have a flashdrive but are they usually formatted FAT12?

KC

M$ISBS 04-22-2005 12:15 AM

I did not know you could or had to partition a flashdrive and as for the FAT12, I have no idea where that came from.:confused:
Should I try mount -t fat12 /dev/sda1 /mnt/flashdrive?

slackist 04-22-2005 07:54 AM

Try cfdisk /dev/sda, when I did it complained about partitions overwriting each other or something, I don't remember exactly.

Once I used cfdisk to set up a fat32 partition all was fine, except that Windows couldn't read it and always wanted to format it.

Perhaps it was a brand specific problem, remember mine was from Apacer. Since then I have bought a Transcend thumb drive and had no problems using it with Win and Linux.

HTH

M$ISBS 04-22-2005 04:10 PM

I did cfdisk /dev/sda and the FS type was set to fat12 so I changed it to linux and wrote it, rebooted, tried to mount it and I keep getting fs type not supported by kernel, I tried w95 FAT32, and some others and same message. I did not see a vfat in the list. Maybe the drive needs a driver and can only be used in windows or it s defective, I dont know. What else can I try?
Thanks.

M$ISBS 04-23-2005 03:46 PM

Any other Ideas? :scratch:

k1ll3r_x 04-24-2005 01:57 AM

try /dev/sdc1
i think thats mine here

k1ll3r_x 04-24-2005 02:04 AM

i think im right, because this is my table when the device aint connected

Code:

root@virtz:~# fdisk -l

Disk /dev/sda: 200.0 GB, 200049647616 bytes
240 heads, 63 sectors/track, 25841 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1              1        805    6085768+  1b  Hidden W95 FAT32
/dev/sda2            806      23888  174507480  17  Hidden HPFS/NTFS
/dev/sda3  *      23889      25841    14764680  83  Linux
root@virtz:~#

and as you might see its only my partitions, now if i connect my usb drive, this comes out
Code:

root@virtz:~# fdisk -l

Disk /dev/sda: 200.0 GB, 200049647616 bytes
240 heads, 63 sectors/track, 25841 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1              1        805    6085768+  1b  Hidden W95 FAT32
/dev/sda2            806      23888  174507480  17  Hidden HPFS/NTFS
/dev/sda3  *      23889      25841    14764680  83  Linux

Disk /dev/sdc: 260 MB, 260046848 bytes
32 heads, 32 sectors/track, 496 cylinders
Units = cylinders of 1024 * 512 = 524288 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/sdc1  *          1        496      253936    6  FAT16

as you might see the slight difference is at the very bottom, on this part
" Device Boot Start End Blocks Id System"
/dev/sdc1 * 1 496 253936 6 FAT16
so just try to find a way to mount it on a sata and ill really appreciate

M$ISBS 04-24-2005 11:17 AM

When I do fdisk -l after inserting my flashdrive it shows it as sda1:

Device Boot Start End Blocks Id System
/dev/hda1 * 1 9605 77152131 83 Linux
/dev/hda2 9606 9729 996030 82 Linux swap

Disk /dev/sda: 32 MB, 32768000 bytes
8 heads, 16 sectors/track, 500 cylinders
Units = cylinders of 128 * 512 = 65536 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 500 31992 b W95 FAT32

No matter how I try to mount it, with any filesystem type or running fdisk and changing the FS type to anything, I consistently get the message, " you must specify filesystem type " and the light on the flashdrive blinks, except when I use usbfs, like " mount -t usbfs /dev/sda1 /mnt/flashdrive " then it mounts but I cant do anything with the drive. I do dmesg and it shows the drive there and when I take it out of the usb port it show it removed so I am pretty sure the USB ports are working. I guess slackware does not support USB drives by default or something, kinda strange.:scratch:

slackist 04-24-2005 12:12 PM

Here is what I get from fdisk -l /dev/sda after plugging my drive in:
Code:

Disk /dev/sda: 32 MB, 32358400 bytes
1 heads, 62 sectors/track, 1019 cylinders
Units = cylinders of 62 * 512 = 31744 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1  *          2        1019      31558    c  W95 FAT32 (LBA)

I don't know what the (LBA) part means, maybe that is the important bit.

Also in my fstab the device is listed as:
Code:

/dev/sda1        /mnt/thumb      auto        noauto,users,rw,umask=000  0  0
Hope this might help

k1ll3r_x 04-24-2005 12:25 PM

maybe we need a lil research on this, see if slackware supports, i have 10.1 and might be that u need some drivers or something

M$ISBS 04-24-2005 01:32 PM

The LBA thing has something to do with the type of drive, but i dont know if it applies in the case of a USB drive.
It may be that this thing only works in windows. I might buy a cheap one and see if that one works.
:cry:


All times are GMT -5. The time now is 11:39 PM.