• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: EXT2 Corruption on USB Key  (Read 2728 times)
semery
Newbie
*

Karma: 0
Posts: 13


View Profile
« on: May 26, 2009, 03:56:40 PM »

I'm having a hell of a time getting an EXT2 formatted USB key to work with the plug. I've tried this key in Ubuntu (in a VM) and a x86 Ubuntu box with no problems. I've also had success using the key with a FAT fs in the plug. The plug seems to corrupt the file system horribly. I'm a bit of Linux newb though so please, any insight would be appreciated.

I'll try to give details as to exactly what his happening:

1. I insert the key, the plug picks it up fine (I assume):
ay 26 18:30:22 sheeva kernel: usb 1-1: new high speed USB device using orion-ehci and address 5
May 26 18:30:22 sheeva kernel: usb 1-1: configuration #1 chosen from 1 choice
May 26 18:30:22 sheeva kernel: scsi3 : SCSI emulation for USB Mass Storage devices
May 26 18:30:22 sheeva kernel: usb-storage: device found at 5
May 26 18:30:22 sheeva kernel: usb-storage: waiting for device to settle before scanning
May 26 18:30:27 sheeva kernel: scsi 3:0:0:0: Direct-Access     Real-Way RW8021 PENDRIVE  1.0  PQ: 0 ANSI: 2
May 26 18:30:27 sheeva kernel: sd 3:0:0:0: Attached scsi generic sg0 type 0
May 26 18:30:27 sheeva kernel: usb-storage: device scan complete
May 26 18:30:27 sheeva kernel: sd 3:0:0:0: [sda] 7852032 512-byte hardware sectors: (4.02 GB/3.74 GiB)
May 26 18:30:27 sheeva kernel: sd 3:0:0:0: [sda] Write Protect is off
May 26 18:30:27 sheeva kernel: sd 3:0:0:0: [sda] Mode Sense: 0b 00 00 08
May 26 18:30:27 sheeva kernel: sd 3:0:0:0: [sda] Assuming drive cache: write through
May 26 18:30:27 sheeva kernel: sd 3:0:0:0: [sda] Assuming drive cache: write through
May 26 18:30:27 sheeva kernel:  sda: sda1
May 26 18:30:27 sheeva kernel: sd 3:0:0:0: [sda] Attached SCSI removable disk

2. I mount the partition, my fstab line is:
/dev/sda1 /media/usbstick ext2 rw,nosuid,nodev,errors=continue 0 0

3. When I try to create a file on the partition:
semery@sheeva:/media/usbstick$ touch bar
touch: cannot touch `bar': Input/output error

4. The following shows up in syslog:
May 26 18:31:07 sheeva kernel: usb 1-1: reset high speed USB device using orion-ehci and address 5
May 26 18:31:09 sheeva last message repeated 5 times
May 26 18:31:09 sheeva kernel: sd 3:0:0:0: [sda] Unhandled error code
May 26 18:31:09 sheeva kernel: sd 3:0:0:0: [sda] Result: hostbyte=0x07 driverbyte=0x00
May 26 18:31:09 sheeva kernel: end_request: I/O error, dev sda, sector 1998
May 26 18:31:09 sheeva kernel: EXT2-fs error (device sda1): read_inode_bitmap: Cannot read inode bitmap - block_group = 0, inode_bitmap = 242

5. After I do a few more file operations, the kernel prints some sort of trace (I don't know if it is related) and then it seems to pick up the drive again and assign it to sdb (instead of sda):
May 26 18:46:04 sheeva kernel: WARNING: at fs/buffer.c:1152 mark_buffer_dirty+0x38/0xd8()
May 26 18:46:04 sheeva kernel: Modules linked in: tun dm_crypt dm_mod cifs ipv6
May 26 18:46:04 sheeva kernel: [<c00309c0>] (unwind_backtrace+0x0/0xe0) from [<c003da80>] (warn_slowpath_common+0x50/0x68)
May 26 18:46:04 sheeva kernel: [<c003da80>] (warn_slowpath_common+0x50/0x68) from [<c00c6458>] (mark_buffer_dirty+0x38/0xd8)
May 26 18:46:04 sheeva kernel: [<c00c6458>] (mark_buffer_dirty+0x38/0xd8) from [<c01093f0>] (ext2_sync_super+0x3c/0x54)
May 26 18:46:04 sheeva kernel: [<c01093f0>] (ext2_sync_super+0x3c/0x54) from [<c0109940>] (ext2_error+0x50/0xc8)
May 26 18:46:04 sheeva kernel: [<c0109940>] (ext2_error+0x50/0xc8) from [<c0106df0>] (ext2_get_inode+0x104/0x11c)
May 26 18:46:04 sheeva kernel: [<c0106df0>] (ext2_get_inode+0x104/0x11c) from [<c01083cc>] (ext2_iget+0x48/0x39c)
May 26 18:46:04 sheeva kernel: [<c01083cc>] (ext2_iget+0x48/0x39c) from [<c0109070>] (ext2_lookup+0x40/0x54)
May 26 18:46:04 sheeva kernel: [<c0109070>] (ext2_lookup+0x40/0x54) from [<c00acec0>] (do_lookup+0xcc/0x194)
May 26 18:46:04 sheeva kernel: [<c00acec0>] (do_lookup+0xcc/0x194) from [<c00aed14>] (__link_path_walk+0x9b8/0xe98)
May 26 18:46:04 sheeva kernel: [<c00aed14>] (__link_path_walk+0x9b8/0xe98) from [<c00af244>] (path_walk+0x50/0x9c)
May 26 18:46:04 sheeva kernel: [<c00af244>] (path_walk+0x50/0x9c) from [<c00af400>] (do_path_lookup+0x128/0x150)
May 26 18:46:04 sheeva kernel: [<c00af400>] (do_path_lookup+0x128/0x150) from [<c00afd18>] (user_path_at+0x60/0x98)
May 26 18:46:04 sheeva kernel: [<c00afd18>] (user_path_at+0x60/0x98) from [<c00a8258>] (vfs_fstatat+0x38/0x68)
May 26 18:46:04 sheeva kernel: [<c00a8258>] (vfs_fstatat+0x38/0x68) from [<c00a8384>] (sys_stat64+0x20/0x3c)
May 26 18:46:04 sheeva kernel: [<c00a8384>] (sys_stat64+0x20/0x3c) from [<c002b940>] (ret_fast_syscall+0x0/0x2c)

6. fsck on the plug then reports a broken file system. I can fsck it on my x86 box and it can usually recover from the errors.

I'm running 2.6.30-rc7 from cbxbiker61 (thanks for the builds!) and the key is plugged directly into the device (no hub). This is a freshly minted file system (I used gparted on my x86 box because I figured my fdisk skills may have been part of the problem).

Thanks for any ideas!
Logged

karurosu
Global Moderator
Full Member
*****

Karma: 0
Posts: 116



View Profile WWW
« Reply #1 on: May 26, 2009, 05:03:56 PM »

The same happens to me and is usually due to noise in the energy source (at least thats what I suspect), make sure you have a nobreak or some clean energy source (something that is not fluctuating or below your voltage), additionally you may want to check if there is any device causing noise (lamps, motors, AC, microwave ovens, etc).
Logged

Pages: [1]
Print
Jump to: