LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 12-27-2006, 02:53 PM   #1
wanglinux2007
LQ Newbie
 
Registered: Dec 2006
Posts: 6

Rep: Reputation: 0
Problem with USB flash drive usage


Hi,

I have two problems about usage of USB flash drives on linux(kernel 2.4). I built the kernel to support the USB mass storage devices.

[PROBLEM 1]:
I tested a USB flash drives, it works well.

I testd another flash drives from Kingston, but not work right. Once it pluged in, fdisk -l showed the device on /dev/sdc1.
Device Boot Start End Blocks ID System
/dev/sdc1 * 1 1016 2015216 e Win95 FAT16 (LBA)
Then I mounted it:
#mount /dev/sdc1 /mnt/usbstick
gave error:
VFS: Can't find ext3 filesystem on dev sd(8,33).
#mount
showed it did mount the device. But, when I checked the files on USB drive under /mnt/usbstick, the filenames were shown incorrectly:
140500~1.txt (should be: 14050000000001S1.txt)

The only diffenerce I can see with the first one is the first one has fileSystem FAT16 (run: fdisk -l).

Here are the file system support I turned on:
File systems --->
<*> DOS FAT fs support(CONFIG_FAT_FS fat.o)
<*> MSDOS fs support(CONFIG_MSDOS_FS msdos.o)
<*> VFAT (Windows-95) fs support (CONFIG_VFAT_FS vfat.o)
<*> /proc filesystem (CONFIG_PROC_FS)
<*> Second extended fs support (ext2fs) (CONFIG_EXT2_FS ext2.o)

Do I need to turn on any more support? What could be the cause?

[PROBLEM 2]:
I found if I try different USB flash drives one by one. By running "fdisk -l", I can see the first drive is attached to sda1, the second to sdb1, the third to sdc1, the forth to sdd1,... I took out the previous one before I plug in the next one, but it seems the kernel still remembers them. I can see this from: /proc/scsi/scsi. Also, it create /proc/scsi/usb-storage-* for each USB flash drive. The only way I can delete this now is to reboot the system. Is there a way to remove this information without rebooting? The ideal result is I can use device /dev/sda1 for different USB drives.

Could anyone help me with this? Thanks a lot.

wanglinux2007
 
Old 12-27-2006, 03:19 PM   #2
Heeap
LQ Newbie
 
Registered: Dec 2006
Posts: 12

Rep: Reputation: 0
I think there is a problem on your fstab.
can you please post it?
 
Old 12-27-2006, 03:36 PM   #3
wanglinux2007
LQ Newbie
 
Registered: Dec 2006
Posts: 6

Original Poster
Rep: Reputation: 0
Here is the fstab file:

# filesystem mount-point fs-type options dump fsck-order
/dev/nand2 / ext3 data=ordered 1 1
/proc /proc proc defaults 0 0
/dev/nor /var/data ext2 defaults 0 0
none /dev/pts devpts defaults 0 0
none /proc/bus/usb usbdevfs defaults 0 0

Thanks a lot.

wanglinux2007
 
Old 12-27-2006, 04:37 PM   #4
wanglinux2007
LQ Newbie
 
Registered: Dec 2006
Posts: 6

Original Poster
Rep: Reputation: 0
Hi,

I think I got the first problem solved. I added "-t vfat" while mounting the device. It worked. It seems for some USB drives I have to specify the file type clearly. But, the second problem I still could not figure it out. Thanks for your help.

wanglinux2007
 
Old 12-29-2006, 08:26 AM   #5
wanglinux2007
LQ Newbie
 
Registered: Dec 2006
Posts: 6

Original Poster
Rep: Reputation: 0
Hi,

I really need some help on the second question. I write it again and hope it is clear this time.
*
I want to support my users using USB flash drives(copy data files)*on my system (Linux kernel 2.4). I configured and built the kernel to support the USB mass storage devices. Now, when I plug in a USB drive, I run "fdisk -l" to see which device it is attached to. Then, I found if I try different USB flash drives one by one.*The first drive is attached to sda1, the second to sdb1, the third to sdc1, the forth to sdd1,... I took out the previous one before I plug in the next one, but it seems the kernel still remembers the previous ones. I can see this from: /proc/scsi/scsi. Also, it create /proc/scsi/usb-storage-* for each USB flash drive. The only way I can delete this now is to reboot the system. If the users use all kinds of USB drives later, I will have to create a long list of devices for them.*And I don't know how long is enough. I hope there is a better way to handle this situation. The ideal result is I can use device /dev/sda1 for different USB drives.
*
Thanks a lot for your help.

wanglinux2007
 
Old 12-29-2006, 09:23 AM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,703

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
Make sure you unmount (umount command) the device prior to removing it from the computer. Umounting will complete any delayed disk writes and if not accomplished data might be lost as well as possibly corrupting the filesystem.
 
  


Reply



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
USB flash drive problem Executor21 SUSE / openSUSE 4 12-17-2006 12:45 PM
Usb flash drive problem procfs Linux - Hardware 5 07-18-2006 10:51 PM
Problem with USB flash drive dmsynck Debian 4 11-23-2005 01:43 PM
USB flash drive mount problem servnov Linux - General 4 10-10-2005 08:08 PM
USB flash drive problem Kensai Mandriva 6 02-23-2004 02:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 03:45 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
Open Source Consulting | Domain Registration