LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices



Reply
 
Search this Thread
Old 04-19-2005, 07:53 PM   #1
M$ISBS
Member
 
Registered: Aug 2003
Posts: 820

Rep: Reputation: 30
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.
 
Old 04-19-2005, 07:57 PM   #2
username17
Member
 
Registered: Aug 2004
Location: Norfolk VA
Distribution: Slackware 11
Posts: 230

Rep: Reputation: 30
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.
 
Old 04-19-2005, 08:53 PM   #3
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
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.

Last edited by jschiwal; 04-19-2005 at 09:13 PM.
 
Old 04-19-2005, 09:14 PM   #4
M$ISBS
Member
 
Registered: Aug 2003
Posts: 820

Original Poster
Rep: Reputation: 30
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
 
Old 04-20-2005, 01:09 AM   #5
username17
Member
 
Registered: Aug 2004
Location: Norfolk VA
Distribution: Slackware 11
Posts: 230

Rep: Reputation: 30
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.
 
Old 04-20-2005, 02:16 AM   #6
M$ISBS
Member
 
Registered: Aug 2003
Posts: 820

Original Poster
Rep: Reputation: 30
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.
 
Old 04-20-2005, 02:32 AM   #7
kencaz
Senior Member
 
Registered: Mar 2005
Location: Las Vegas, NV
Distribution: Mandriva Slackware FreeBSD
Posts: 1,468

Rep: Reputation: 48
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
 
Old 04-20-2005, 04:25 AM   #8
DarkVenger
Member
 
Registered: Mar 2004
Location: VCO
Distribution: Arch
Posts: 43

Rep: Reputation: 26
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.

Last edited by DarkVenger; 04-20-2005 at 04:28 AM.
 
Old 04-20-2005, 02:57 PM   #9
M$ISBS
Member
 
Registered: Aug 2003
Posts: 820

Original Poster
Rep: Reputation: 30
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.

Last edited by M$ISBS; 04-20-2005 at 02:59 PM.
 
Old 04-20-2005, 05:54 PM   #10
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
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
 
Old 04-21-2005, 12:59 AM   #11
M$ISBS
Member
 
Registered: Aug 2003
Posts: 820

Original Poster
Rep: Reputation: 30
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!!
 
Old 04-21-2005, 07:44 AM   #12
slackist
Member
 
Registered: Feb 2004
Location: Phuket, Thailand
Distribution: Slackware 14.1
Posts: 439

Rep: Reputation: Disabled
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
 
Old 04-21-2005, 11:46 AM   #13
BtroddimusPrime
LQ Newbie
 
Registered: Apr 2005
Location: Éire
Distribution: The Distro formerly known as Mandrake, SLAX x.x,Knoppix x.x ,Mepis
Posts: 1

Rep: Reputation: 0
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...)
 
Old 04-21-2005, 12:48 PM   #14
kencaz
Senior Member
 
Registered: Mar 2005
Location: Las Vegas, NV
Distribution: Mandriva Slackware FreeBSD
Posts: 1,468

Rep: Reputation: 48
FAT12???? what did you use to partition the drive?

KC
 
Old 04-21-2005, 03:46 PM   #15
DarkVenger
Member
 
Registered: Mar 2004
Location: VCO
Distribution: Arch
Posts: 43

Rep: Reputation: 26
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache2 cannot execute cgi files on a USB drive bhoult Linux - Software 2 07-11-2005 11:19 AM
Backing up files with a USB Extrenal hard drive linuxmarine Red Hat 13 05-26-2005 09:33 PM
USB Drive - Mounted OK, but files aren't recognized Dr3n Linux - Hardware 6 03-14-2005 07:00 PM
USB Hard Drive mounted: No files shown. mooreted Slackware 3 12-06-2004 07:51 PM
How do you burn iso files to usb cd-rw drive ??? pleasehelpme Linux - Newbie 0 12-20-2003 03:05 AM


All times are GMT -5. The time now is 10:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration