Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Rockbox Ports are now being developed for various digital audio players!

+  Rockbox Technical Forums
|-+  Rockbox General
| |-+  Rockbox General Discussion
| | |-+  Sansa c250 - File system corruption when using Windows and Linux
« previous next »
  • Print
Pages: [1]

Author Topic: Sansa c250 - File system corruption when using Windows and Linux  (Read 7767 times)

Offline sdhoigt

  • Member
  • *
  • Posts: 5
Sansa c250 - File system corruption when using Windows and Linux
« on: July 28, 2008, 11:33:47 PM »
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: [Select]
[ 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

After last section repeats 3-4 times my system finally recognizes the device and I can mount it.
Code: [Select]
[ 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

And here's the badness that is thrown while trying to access corrupt directories/files.
Code: [Select]
[ 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

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
« Last Edit: July 29, 2008, 01:30:07 AM by sdhoigt »
Logged

Offline Strife89

  • Member
  • *
  • Posts: 354
  • Michael Carr
    • Strife89's blog
Re: Sansa c250 - File system corruption when using Windows and Linux
« Reply #1 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).
Logged
Rockbox: Sansa Clip Zip, iPod Color, iRiver H320

Android: Moto X4, Galaxy Tab S2 T710

Offline LambdaCalculus

  • Member
  • *
  • Posts: 2257
  • Dreaming of Turing Machines...
    • The Nostalgia Roadtrip
Re: Sansa c250 - File system corruption when using Windows and Linux
« Reply #2 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: [Select]
EXTRA_DEFINES=DUSE_ROCKBOX_USB

This will enable the driver.
Logged
Former Rockbox dev. Rising from the ashes...

Players: iPod Video /w 128GB SSD mod, H320 /w 128GB SSD mod

Offline GodEater

  • Member
  • *
  • Posts: 2829
Re: Sansa c250 - File system corruption when using Windows and Linux
« Reply #3 on: July 29, 2008, 11:50:57 AM »
you probably actually want:

Code: [Select]
EXTRA_DEFINES=-DUSE_ROCKBOX_USB -DUSE_HIGH_SPEED

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

Read The Manual Please

Offline sdhoigt

  • Member
  • *
  • Posts: 5
Re: Sansa c250 - File system corruption when using Windows and Linux
« Reply #4 on: July 29, 2008, 03:55:53 PM »
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).

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: [Select]
EXTRA_DEFINES=DUSE_ROCKBOX_USB

This will enable the driver.

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

Thanks,
SD
Logged

Offline Strife89

  • Member
  • *
  • Posts: 354
  • Michael Carr
    • Strife89's blog
Re: Sansa c250 - File system corruption when using Windows and Linux
« Reply #5 on: July 29, 2008, 05:31:11 PM »
Quote from: sdhoigt on July 29, 2008, 03:55:53 PM
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.

I'm really not sure what to tell you, then. :( I've been using my Sansa on a Linux machine since the day I got it, occasionally plugging it into my Windows laptop without problems.

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

I was on the IRC channel earlier today, and someone discovered that the biggest problem with the USB stack (data corruption) may have been sorted out recently.

As for whether it's an improvement, well, anything's an improvement over waiting on the Sansa's database to be refreshed. ;)
Logged
Rockbox: Sansa Clip Zip, iPod Color, iRiver H320

Android: Moto X4, Galaxy Tab S2 T710

Offline sdhoigt

  • Member
  • *
  • Posts: 5
Re: Sansa c250 - File system corruption when using Windows and Linux
« Reply #6 on: July 30, 2008, 11:33:56 PM »
Quote from: GodEater on July 29, 2008, 11:50:57 AM
you probably actually want:

Code: [Select]
EXTRA_DEFINES=-DUSE_ROCKBOX_USB -DUSE_HIGH_SPEED

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

Done.  Hey, great job on the devs part; that was dead simple to get the Rockbox environment set-up (thanks to rockboxdev.sh!) and compiled.

I did notice that the Rockbox USB stack was quite a bit slower (yep, even with EXTRA_DEFINES=-DUSE_ROCKBOX_USB -DUSE_HIGH_SPEED) than the native SanDisk USB.  I timed the transfer of 19 files at 98.5 MB.  Rockbox USB took 3 min. 15 seconds; SanDisk USB took 25 seconds.

Anyway, I still experienced file corruption when setting everything up again (Rockbox bootloader/firmware) from scratch under Linux with the Rockbox I compiled from SVN.  I had to pop onto Windows, go to recovery mode and to restore (via Sansa c200 wiki).  Also, just to make sure file corruption isn't possibly happening on Windows too (in case I had missed it somehow before) I put Rockbox back on under Windows using the one I compiled under Linux and filled the c250 till the disk was full of music.  No problems.

Since it's apparently not my computer (Windows and Linux are the same box) I'm starting to question the USB stack on my Linux distro (Xubuntu 8.04).  I'll try another Linux distro and see what happens.

Thanks and I'm open to try other ideas.
SD
Logged

Offline Strife89

  • Member
  • *
  • Posts: 354
  • Michael Carr
    • Strife89's blog
Re: Sansa c250 - File system corruption when using Windows and Linux
« Reply #7 on: July 31, 2008, 10:24:52 AM »
Quote from: sdhoigt on July 30, 2008, 11:33:56 PM
Since it's apparently not my computer (Windows and Linux are the same box) I'm starting to question the USB stack on my Linux distro (Xubuntu 8.04).  I'll try another Linux distro and see what happens.

I'll go ahead and tell you that Ubuntu 7.10 has given me no problems at all with USB. (although I haven't updated to 8.04 yet because of wireless glitches (I have attempted to update once already, but with wireless gone I had no connection, so I reinstalled 7.10 cleanly)).
Logged
Rockbox: Sansa Clip Zip, iPod Color, iRiver H320

Android: Moto X4, Galaxy Tab S2 T710

Offline GodEater

  • Member
  • *
  • Posts: 2829
Re: Sansa c250 - File system corruption when using Windows and Linux
« Reply #8 on: August 01, 2008, 02:07:59 AM »
Quote from: sdhoigt on July 30, 2008, 11:33:56 PM
Since it's apparently not my computer (Windows and Linux are the same box) I'm starting to question the USB stack on my Linux distro (Xubuntu 8.04).  I'll try another Linux distro and see what happens.

I'm running the same distro (and version), and I have no problems with the usb stack in general, or with filesystem corruption on my USB devices specifically.
Logged

Read The Manual Please

Offline cool_walking_

  • Rockbox Expert
  • Member
  • *
  • Posts: 695
Re: Sansa c250 - File system corruption when using Windows and Linux
« Reply #9 on: August 01, 2008, 03:14:57 AM »
Kubuntu 8.04 here, no problems either.
Logged

Offline sdhoigt

  • Member
  • *
  • Posts: 5
Re: Sansa c250 - File system corruption when using Windows and Linux
« Reply #10 on: August 01, 2008, 10:05:45 AM »
Can either of you post me the appropriate line from your /etc/fstab?

Another random thing I noticed is that when I mount under Windows using the SanDisk USB and move some files around I always get the 'Refresh Database' dialog after unmounting.  Under Linux this never happens; it just goes right back to the menu (the original Sansa one).  Not sure if that is an indication of anything. 


Thanks,
SD
« Last Edit: August 01, 2008, 10:10:17 AM by sdhoigt »
Logged

Offline GodEater

  • Member
  • *
  • Posts: 2829
Re: Sansa c250 - File system corruption when using Windows and Linux
« Reply #11 on: August 02, 2008, 12:49:59 PM »
I don't have an fstab entry for any of my devices, I let HAL take care of mounting.
Logged

Read The Manual Please

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox General
| |-+  Rockbox General Discussion
| | |-+  Sansa c250 - File system corruption when using Windows and Linux
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.096 seconds with 15 queries.