Rockbox General > Rockbox General Discussion

Sansa c250 - File system corruption when using Windows and Linux

(1/3) > >>

sdhoigt:
First of all love the project!   Excellent work in bringing out the untapped potential hidden in these devices!  ( btw the $22.77 donation is from me :)

Ok, I got everything installed on my new Sansa c250 under Windows via the installer.  I then added a few music files (MP3s), boot up the device and all works well.  Then I popped over to Linux, mount the device and add some more music files (E.g., the 'Melt Banana' directory/MP3s in the example below).  I unmount and boot the device; the new files show up under 'Files', but they're not playable.

So I remount to see what happened and I see the files/directory I just added are corrupted.  I can't enter the directory nor delete it.

$ ls -al
drwxr-xr-x 3 dit dit 32768 2008-07-27 23:50 Black Francis
d????????? ? ?   ?       ?                ? Melt Banana
drwxr-xr-x 2 dit dit 32768 2008-07-27 23:31 MUSIC
drwxr-xr-x 3 dit dit 32768 2008-07-28 00:10 Phish
drwxr-xr-x 2 dit dit 32768 2008-07-27 23:31 PHOTO
...

Here's the relevant mount line in my fstab.
/dev/sdc1        /media/sdc1    vfat    rw,user,noauto  0       0

FYI. I use this same fstab entry for mounting flash drives that I use back and forth on Linux and Windows w/o any problems. 

I've been able to reproduce this file system corruption problem 3-4 times now with different assortments of files and have it narrowed down to file manipulation when mounted in Linux.  No problems when moving files around in Windows.

Here's some dmesg output trying to mount the device after the file system has some corrupted data.  The following section repeats a few times before I'm actually able to mount it.

--- Code: ---[ 2948.897875] usb 4-4: new high speed USB device using ehci_hcd and address 33
[ 2949.030843] usb 4-4: config 128 interface 0 altsetting 0 endpoint 0x81 has an invalid bInterval 100, changing to 10
[ 2949.032752] usb 4-4: configuration #128 chosen from 1 choice
[ 2949.102746] scsi26 : SCSI emulation for USB Mass Storage devices
[ 2949.109796] usb-storage: device found at 33
[ 2949.109805] usb-storage: waiting for device to settle before scanning
[ 2954.115165] usb-storage: device scan complete
[ 2959.717549] usb 4-4: reset high speed USB device using ehci_hcd and address 33
[ 2964.841945] usb 4-4: failed to restore interface 0 altsetting 0 (error=-110)
[ 2964.842200] usb 4-4: USB disconnect, address 33
[ 2964.842476] scsi 26:0:0:0: Device offlined - not ready after error recovery

--- End code ---

After last section repeats 3-4 times my system finally recognizes the device and I can mount it.

--- Code: ---[ 2965.081460] usb 4-4: new high speed USB device using ehci_hcd and address 34
[ 2965.214641] usb 4-4: config 128 interface 0 altsetting 0 endpoint 0x81 has an invalid bInterval 100, changing to 10
[ 2970.207208] usb 4-4: configuration #128 chosen from 1 choice
[ 2970.264104] scsi27 : SCSI emulation for USB Mass Storage devices
[ 2970.274366] usb-storage: device found at 34
[ 2970.274375] usb-storage: waiting for device to settle before scanning
[ 2975.266634] usb-storage: device scan complete
[ 2980.869646] usb 4-4: reset high speed USB device using ehci_hcd and address 34
[ 2983.017784] scsi 27:0:0:0: Direct-Access     SanDisk  Sansa c250       Sans PQ: 0 ANSI: 0
[ 2985.015263] scsi 27:0:0:1: Direct-Access     SanDisk  Sansa c250       Sans PQ: 0 ANSI: 0

--- End code ---

And here's the badness that is thrown while trying to access corrupt directories/files.

--- Code: ---[ 2610.831125] FAT: Filesystem panic (dev sdc1)
[ 2610.831138]     fat_get_cluster: invalid cluster chain (i_pos 0)
[ 2610.831143]     File system has been set read-only

--- End code ---

One final note.  When I was trying to reproduce this problem just now I couldn't get it happen when I just copied over 2-3 files at a time (I.e., the songs played fine).  But once I copied over a directory with >10 files the corruption happened. 

Some info:
Original Firmware: 01.01.05P
Rockbox version: r18134-080727

Any ideas?  Thanks a lot for reading,
SD

Strife89:
Did you use the original firmware for file transfers, or did you use a Rockbox build with a USB patch? Last I heard, the PortalPlayer USB driver is technically operational (though not enabled in the normal builds), but it induces corruption.

Someone correct me if I'm wrong (and I feel certain I am).

LambdaCalculus:
There are a couple of kinks in the driver, so until we sort them out, we're keeping the USB driver disabled in the normal builds for now.

You can, however, enable it when you compile by by defining the USB driver in the Makefile. Look for a line that reads EXTRA_DEFINES= and change it to:


--- Code: ---EXTRA_DEFINES=DUSE_ROCKBOX_USB

--- End code ---

This will enable the driver.

GodEater:
you probably actually want:


--- Code: ---EXTRA_DEFINES=-DUSE_ROCKBOX_USB -DUSE_HIGH_SPEED

--- End code ---

as otherwise you won't get the highest speed possible with the Rockbox USB stack.

sdhoigt:

--- Quote from: Strife89 on July 29, 2008, 09:38:36 AM ---Did you use the original firmware for file transfers, or did you use a Rockbox build with a USB patch? Last I heard, the PortalPlayer USB driver is technically operational (though not enabled in the normal builds), but it induces corruption.

Someone correct me if I'm wrong (and I feel certain I am).

--- End quote ---

I did use the original Sansa firmware for file transfers.  Plugging in USB under Windows or Linux essentially boots into the original Sansa firmware.  But I never (at least so far haven't) had any corruption moving files under Windows.



--- Quote from: LambdaCalculus379 on July 29, 2008, 09:47:22 AM ---There are a couple of kinks in the driver, so until we sort them out, we're keeping the USB driver disabled in the normal builds for now.

You can, however, enable it when you compile by by defining the USB driver in the Makefile. Look for a line that reads EXTRA_DEFINES= and change it to:


--- Code: ---EXTRA_DEFINES=DUSE_ROCKBOX_USB

--- End code ---

This will enable the driver.

--- End quote ---

So are these "kinks" an improvement over the Sandisk USB implementation?

Thanks,
SD

Navigation

[0] Message Index

[#] Next page

Go to full version