Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.