Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Gentoo currupting all my usb drives, VERY VERY BAD
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC
View previous topic :: View next topic  
Author Message
piroko
Tux's lil' helper
Tux's lil' helper


Joined: 25 Aug 2006
Posts: 77

PostPosted: Mon Apr 02, 2007 10:20 pm    Post subject: [SOLVED] Gentoo currupting all my usb drives, VERY VERY BAD Reply with quote

Well, I found a new bug somewhere in gentoo, and I'm not sure exactly where (udev? kernel?). I've tried two separate usb thumb drives, and they both do the same thing. When I plug them in, they are recognized as uba for one (this is normal) and uba1 for the other one. After mounting them normally, 'df -h' reports the correct filesystem usage and capacity. However, after I write files to the drive(s) and then try to unmount them, they magically grow to 19GB with 15GB taken up, and the unmount process locks up while it proceeds to trash all the files on the drive. I've already lost many important files to this bug, and I have no idea how to solve it :( Maybe an update to udev screwed something up? Do I need to restart udev somehow? I'm completely at a loss... Please help me...

Piroko
_________________
Anyone who is not confused by quantum theory does not truly understand it.


Last edited by piroko on Tue Apr 03, 2007 12:41 pm; edited 1 time in total
Back to top
View user's profile Send private message
JoseJX
Retired Dev
Retired Dev


Joined: 28 Apr 2002
Posts: 2774

PostPosted: Mon Apr 02, 2007 11:17 pm    Post subject: Reply with quote

This sounds like a kernel bug. What filesystem is on the sticks? What kernel are you using?
_________________
Gentoo PPC FAQ: http://www.gentoo.org/doc/en/gentoo-ppc-faq.xml
Back to top
View user's profile Send private message
piroko
Tux's lil' helper
Tux's lil' helper


Joined: 25 Aug 2006
Posts: 77

PostPosted: Mon Apr 02, 2007 11:33 pm    Post subject: Reply with quote

I'm using vanilla 2.6.20.3, and the drives should have fat32 filesystems on them. One is an iriver mp3 player, and it formats itself. They are getting mounted as vfat at least. It is interesting to note that the 19GB capacity with all but ~4GB used up just so happens to be the capacity of my ipod, which I've plugged in before. I previously unmounted it, however, so I'm not sure why this "coincidence" is there.
_________________
Anyone who is not confused by quantum theory does not truly understand it.
Back to top
View user's profile Send private message
JoseJX
Retired Dev
Retired Dev


Joined: 28 Apr 2002
Posts: 2774

PostPosted: Tue Apr 03, 2007 2:36 am    Post subject: Reply with quote

Is it reproducible? Does it still screw up if you eject the disk first? (i.e. eject /dev/sda before pulling it out) Anything in dmesg?
_________________
Gentoo PPC FAQ: http://www.gentoo.org/doc/en/gentoo-ppc-faq.xml
Back to top
View user's profile Send private message
piroko
Tux's lil' helper
Tux's lil' helper


Joined: 25 Aug 2006
Posts: 77

PostPosted: Tue Apr 03, 2007 3:09 am    Post subject: Reply with quote

It is reproduceable. It seems that the bug does either one of two things. If I write a small amount of files on it, this happens:
df -h immediately after writing data:
Code:

/dev/uba   500M   78M  423M  16% /media/disk-1


df -h shows this while unmounting (which takes about two minutes):
Code:

Filesystem            Size  Used Avail Use% Mounted on
/dev/hda5              19G   15G  4.4G  77% /
udev                  504M  5.4M  499M   2% /dev
/dev/hda3              74G   61G   13G  83% /mnt/osx
shm                   504M     0  504M   0% /dev/shm
df: `/media/disk-1': No such file or directory


Note that KDE automounted the drive for me in this case. After the files were written, I tried to play them on my mp3 player and some worked but some ended prematurely. On my USB key, however, files magically vanished.

Dmesg appears to show nothing special:

dmesg after plugging in:
Code:

usb 2-1: new full speed USB device using ohci_hcd and address 30
PM: Adding info for usb:2-1
PM: Adding info for No Bus:usbdev2.30_ep00
usb 2-1: configuration #1 chosen from 1 choice
PM: Adding info for usb:2-1:1.0
 uba:
PM: Adding info for No Bus:usbdev2.30_ep81
PM: Adding info for No Bus:usbdev2.30_ep01


dmesg after disconnecting the drive after a “successful” umount:
Code:

usb 2-1: USB disconnect, address 30
PM: Removing info for No Bus:usbdev2.30_ep81
PM: Removing info for No Bus:usbdev2.30_ep01
PM: Removing info for usb:2-1:1.0
PM: Removing info for No Bus:usbdev2.30_ep00
PM: Removing info for usb:2-1


So now, I plugged the mp3 player back in, and wrote a larger quantity of files. This is where the bug I wrote about shows its face. It appears to mount and write the files fine, but after I 'umount' it, the umount process takes an unusually large amount of time to end, while my mp3 player reads "transferring", with df -h showing this:

df -h after 'umount /dev/uba', umount process takes a while to end while mp3 player reads “transferring”:
Code:

Filesystem            Size  Used Avail Use% Mounted on
/dev/hda5              19G   15G  4.4G  77% /
udev                  504M  5.4M  499M   2% /dev
/dev/hda3              74G   61G   13G  83% /mnt/osx
shm                   504M     0  504M   0% /dev/shm
/dev/uba               19G   15G  4.4G  77% /mnt/sda


I know that this is not my mp3 player's fault because a standard 1GB usb key shows the same symptoms. The umount process apparently did not lock up however, because after giving it a good 6 minutes it finally ended. I'm not sure the overall effect on my files, because in some cases, the mp3's played just fine on my player, but on my usb key files just "vanished". It seems sketchy but happens more often than not. I really really wish I knew what's going wrong here...
_________________
Anyone who is not confused by quantum theory does not truly understand it.
Back to top
View user's profile Send private message
BitJam
Advocate
Advocate


Joined: 12 Aug 2003
Posts: 2483
Location: Silver City, NM

PostPosted: Tue Apr 03, 2007 3:39 am    Post subject: Reply with quote

I had this problem on my older system that only had USB 1.0 (1.1?).

It just takes a very long time to unmount and if you unplug it during this time you are screwing up the file system on the thumb drives.

I also had strange results from df -h during the long unmount process. The size of the usb drive would mimic the size of my root drive which yours seems to be doing also.

The solution is to just wait patiently until it finally unmounts before unplugging.

Edit: if you mount the usb drive as msdos instead of vfat, I think it will unmount much quicker but you are stuck with 8.3 filenames.
Back to top
View user's profile Send private message
piroko
Tux's lil' helper
Tux's lil' helper


Joined: 25 Aug 2006
Posts: 77

PostPosted: Tue Apr 03, 2007 4:03 am    Post subject: Reply with quote

Oh wow. I hadn't even noticed that it was mimicking my root filesystem. This is odd, however, because my ports are usb 2.0. I'll have to look into my kernel config to make sure I have usb 2.0 support enabled. Thank you very much!
_________________
Anyone who is not confused by quantum theory does not truly understand it.
Back to top
View user's profile Send private message
piroko
Tux's lil' helper
Tux's lil' helper


Joined: 25 Aug 2006
Posts: 77

PostPosted: Tue Apr 03, 2007 12:41 pm    Post subject: Reply with quote

Apparently ehci-hcd wasn't getting modprobed for my usb 2.0 devices, so after modprobing it, my usb devices are working at full speed and not appearing to die anymore. You were right, I was unplugging the devices too early thinking that they were getting written past their capacity after I saw the 19GB limit. And I assumed that wouldn't be good ;) All's well now! Thank you!
_________________
Anyone who is not confused by quantum theory does not truly understand it.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum