problem s USB 2.0 Flash Drive [VYRESENO]
Kotrla Vitezslav
kotrla na ceb.cz
Středa Říjen 22 18:55:55 CEST 2003
Google a Stefan Kluth <skluth (at) mppmu.mpg.de> muj problem
vyresili. Prikladam Stefanuv postup, je tam vic uzitecnych
veci. Pouze nenapsal, ze cfdisk je treba poustet s parametrem
-z, aby ignoroval to, co je na disku a zacal s novou prazdnou
tabulkou. Trvalo pul hodiny, nez jsem zjistil, ze je neco
takoveho mozne. Ted mi jeste nekdo napise, ze to umi i fdisk ;-)
Omlouvam se za dlouhy prispevek, ale treba se to bude nekomu
jeste hodit.
VK
===========================================================
To: debian-user na lists.debian.org
Subject: can't mount USB flash memory key
From: Date: Wed, 14 May 2003 10:15:09 +0200 (CEST)
Reply-to: Stefan Kluth <skluth na mppmu.mpg.de>
Hello All,
I have Linux lapkluth 2.4.17 #1 Fri Apr 11 14:54:56 CEST 2003 i686 unknown
on a DELL i3700 laptop and have used USB flash memory keys (sticks)
successfully before. I run usbmgr/hotplug to hopefully automatically
detect devices and load kernel modules, which works with another USB
memory stick.
Now I have a apacer handy steno 2.0, a USB 2 compliant 256MB USB
flash memory stick. The company claims "linux support".
First, the device is too new to be recognised by usbmgr/hotplug so I load
the drivers by hand:
$ modprobe sd_mod
$ modprobe usb-storage
BTW and a bit off-topic, why does adding an appropriate entry to
/etc/usbmgr/usbmgr.conf not work? I added
# a 256MB USB 2 flash drive (Apacer)
vendor 0x1005 product 0xb113 module scsi_mod, sd_mod, usb-storage
and it is still not recognised.
Back to the real problem, here are the interesting bits from
/var/log/messages:
May 14 09:59:23 lapkluth kernel: SCSI subsystem driver Revision: 1.00
May 14 09:59:38 lapkluth kernel: Initializing USB Mass Storage driver...
May 14 09:59:38 lapkluth kernel: usb.c: registered new driver usb-storage
May 14 09:59:38 lapkluth kernel: USB Mass Storage support registered.
May 14 10:00:27 lapkluth kernel: hub.c: USB new device connect on bus1/1,
assigned device number 2
May 14 10:00:27 lapkluth kernel: scsi0 : SCSI emulation for USB Mass
Storage devices
May 14 10:00:28 lapkluth kernel: Vendor: USB Model: Flash Drive
Rev: 1.05
May 14 10:00:28 lapkluth kernel: Type: Direct-Access
ANSI SCSI revision: 02
May 14 10:00:28 lapkluth kernel: Attached scsi removable disk sda at
scsi0, channel 0, id 0, lun 0
May 14 10:00:28 lapkluth kernel: SCSI device sda: 507904 512-byte hdwr
sectors (260 MB)
May 14 10:00:28 lapkluth kernel: sda: Write Protect is on
May 14 10:00:28 lapkluth kernel: sda: sda1 sda2 sda3 sda4
That looks ok to me, except that appaerently there are already 4
partitions on the USB stick. Now I try to mount:
$ mount -t vfat /dev/sda1 /usbstick/
mount: block device /dev/sda1 is write-protected, mounting read-only
mount: wrong fs type, bad option, bad superblock on /dev/sda1,
or too many mounted file systems
An interesting bit of information comes from /proc/partitions:
$ cat /proc/partitions
major minor #blocks name
8 0 253952 sda
8 1 570754815 sda1
8 2 968014120 sda2
8 3 968014096 sda3
8 4 1818613248 sda4
It looks like the partition table is broken, the #blocks are far too
large.
The other /proc entries like /proc/bus/usb and /proc/scsi look reasonable.
And the USB flash memory of course works in MacOS 9.2, I haven't tried
windows yet.
I have seen at least one similar error report somehwere else, but
unfortunately no helpful reply ... perhaps somebody on this list knows how
to understand this further?
===========================================================
To: debian-user na lists.debian.org
Subject: RE: can't mount USB flash memory key (solved)
From: Stefan Kluth <skluth na mppmu.mpg.de>
Date: Thu, 15 May 2003 15:48:51 +0200 (CEST)
Reply-to: Stefan Kluth <skluth na mppmu.mpg.de>
Hello All,
the trick is to use brute force and replace the silly partition table of
the USB flash drive by a sane one with cfdisk. I simply created a single
primary FAT32 partition (0b), then walked to a WinXP machine to have it
formatted. Incidentally, is there a way to format (initialise) FAT32 on a
linux system?
Anyway, here is the sane partiton table:
$ fdisk -l /dev/sda
Disk /dev/sda: 8 heads, 62 sectors, 1024 cylinders
Units = cylinders of 496 * 512 bytes
Device Boot Start End Blocks Id System
/dev/sda1 1 1024 253921 b Win95 FAT32
I can now mount using this /etc/fstab entry:
/dev/sda1 /usbstick auto defaults,user,noauto 0 0
Cheers, Stefan
Další informace o konferenci Linux