LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 05-14-2011, 09:25 AM   #1
AusBob
LQ Newbie
 
Registered: May 2011
Distribution: debian wheezy/sid
Posts: 9

Rep: Reputation: 0
Question USB drive Reiserfs partitions suddenly corrupted?!


Hi folks,

Okay I'm really lost and desperate and hope someone can give me a hint.
I have an external USB drive with 3 ReiserFS partitions which were working without trouble last time I connected it a few days ago.
However, today after attaching the drive none of the partitions are recognized as Reiserfs (the partition table seems fine however). So I did various (read-only) checks, read up about the reiser filesystem structure etc. and, using hexdump, realized that the superblock of all three partitions seem to contain invalid data.
So I created a disk image of one of the partitions and ran testdisk. It found a number of superblocks at various offsets (I believe all within the journal area) but was not able to recover anything. Next, I tried two things:
Code:
reiserfsck -rebuild-sb && reiserfsck -rebuild-tree -S
which recovered a lot of files, however *a lot* of them ended up in lost+found with a generic name so were essentially useless.

Second thing I tried (with the original image) was manually copying one of the superblocks to offset 0x10000. Unfortunately, I was still unable to mount the image and although testdisk was now able to browse the filesystem, it only showed those files which reiserfsck fully recovered in attempt 1.

I checked my system logs but as far as I can tell the hard drive was properly unmounted last time and nothing else done with it since then. So I have absolutely no idea what is going on...

Here are some relevant details of my setup:
System: Debian wheezy/sid 2.6.38-2-686
HDD: WDC WD30
lsusb: Bus 001 Device 005: ID 067b:2507 Prolific Technology, Inc. PL2507 Hi-speed USB to IDE bridge controller

Code:
# fdisk -l /dev/sdb

Disk /dev/sdb: 300.1 GB, 300069051904 bytes
255 heads, 63 sectors/track, 36481 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x525dcb85

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       24323   195374466   83  Linux
/dev/sdb2           24324       30402    48829567+  83  Linux
/dev/sdb3           30403       36481    48829567+  83  Linux
What's rather weird is that the first 64k of all partitions are zeros as they should be but what follows is not a superblock but something else (part of the journal maybe). FWIW, here are the first few lines of the dump output:
Code:
# hexdump -C /dev/sdb1

00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00010000  1c b6 00 00 31 b6 00 00  32 b6 00 00 37 b6 00 00  |....1...2...7...|
00010010  39 b6 00 00 0c b7 00 00  0d b7 00 00 38 b7 00 00  |9...........8...|
00010020  3b b7 00 00 47 b7 00 00  4a b7 00 00 4b b7 00 00  |;...G...J...K...|
00010030  62 b7 00 00 f0 b7 00 00  f1 b7 00 00 f2 b7 00 00  |b...............|
00010040  1c b6 00 00 31 b6 00 00  32 b6 00 00 37 b6 00 00  |....1...2...7...|
00010050  39 b6 00 00 0c b7 00 00  0d b7 00 00 38 b7 00 00  |9...........8...|
00010060  3b b7 00 00 47 b7 00 00  4a b7 00 00 4b b7 00 00  |;...G...J...K...|
00010070  62 b7 00 00 f0 b7 00 00  f1 b7 00 00 f2 b7 00 00  |b...............|
00010080  1c b6 00 00 31 b6 00 00  32 b6 00 00 37 b6 00 00  |....1...2...7...|
The reiser partitions on another drive work fine. Can anyone tell me what might have caused this? Could it be the controller?

Cheers,
AusBob
 
Old 05-15-2011, 03:54 AM   #2
coltree
Member
 
Registered: Nov 2003
Location: Jacobs Well, Queensland AU
Distribution: Slackware
Posts: 76
Blog Entries: 1

Rep: Reputation: 10
don't do it

simple
don't use reiserfs for a usb stick
your stick might actually be stuffed now from using a journaling file system
use vfat for compatibility or use one of the newer file-systems designed for flash drives.
go for a search, don't be lazy, learn
http://www.justfuckinggoogleit.com/
search for something like
linux usb flash filesystem
http://linux.koolsolutions.com/2009/...r-usb-devices/
came up first for me
and especially described the problem of write life limits
buy a new stick, they're cheap
throw your old stick in the bin, it's character building
 
Old 05-15-2011, 05:32 AM   #3
AusBob
LQ Newbie
 
Registered: May 2011
Distribution: debian wheezy/sid
Posts: 9

Original Poster
Rep: Reputation: 0
hey coltree,

thanks for your suggestions - however, it is not a USB stick but an external HDD (300GB).
Nevertheless, I guess I'll use ext3 in the future.

Still wondering what might have happened though... anyone?
 
Old 05-15-2011, 09:18 AM   #4
Sjonnie48
Member
 
Registered: Jun 2005
Location: Earth
Distribution: Ubuntu10.04
Posts: 308

Rep: Reputation: 43
Quote:
however, it is not a USB stick but an external HDD (300GB).
Ausbob: To avoid confusion you'd better talk about an external harddisk with a usb connection.

Quote:
simple don't use reiserfs for a usb stick
coltree: Did you ever see a usb stick with heads and cylinders?

Ausbob: What is the age of your harddisk? Can you see it in disk utility when connected?
 
Old 05-15-2011, 11:21 AM   #5
AusBob
LQ Newbie
 
Registered: May 2011
Distribution: debian wheezy/sid
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
What is the age of your harddisk? Can you see it in disk utility when connected?
It is about 4-5 years old, so yes it is about time to replace it. Having said that, it is switched off most of the time I use my computer.

I can see the drive and its partitions in disk utility. As I wrote in my first post, the disk and MBR are fine, as is the general structure of the partitions. It just appears as if the reiser superblocks (and maybe some other blocks) have been overwritten but I have no idea how. All I did when I last used it were general file operations before a safe remove.
 
Old 05-15-2011, 12:19 PM   #6
Sjonnie48
Member
 
Registered: Jun 2005
Location: Earth
Distribution: Ubuntu10.04
Posts: 308

Rep: Reputation: 43
Forgot to ask: has the disk smart capability? If yes did you run a selftest? Has there been an extreme load on your computer?
 
Old 05-16-2011, 10:20 PM   #7
AusBob
LQ Newbie
 
Registered: May 2011
Distribution: debian wheezy/sid
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
has the disk smart capability? If yes did you run a selftest?
Unfortunately, it looks like I can't get SMART attributes through the USB interface and I haven't got a desktop computer to connect the drive to directly.

Quote:
Has there been an extreme load on your computer?
Not that I'm aware of. It's a laptop and there were no special circumstances when I last worked with the drive.
 
Old 01-02-2012, 05:11 PM   #8
salemboot
Member
 
Registered: Mar 2007
Location: America
Distribution: Linux
Posts: 161

Rep: Reputation: 36
Interesting situation

I've seen superblock corruption before when trying to use an external USB 2.0 drive with a USB 1.0 port on an ext3 filesystem.

May have just been a bad usb port.
 
1 members found this post helpful.
Old 01-02-2012, 05:52 PM   #9
AusBob
LQ Newbie
 
Registered: May 2011
Distribution: debian wheezy/sid
Posts: 9

Original Poster
Rep: Reputation: 0
That's interesting salemboot. I might have had the device attached to an old laptop which doesn't support USB 2.0 once. Unfortunately I can't remember anymore. But if that's really the reason I wonder if it's a hardware or software issue since I use other USB devices on that laptop which work fine.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
USB Flash drive suddenly exploded in size Jorophose General 2 02-26-2007 06:37 PM
ReiserFS & USB hard drive TheShemeta Linux - General 4 12-03-2004 09:41 AM
USB drive using different partitions (usb key thumb drive) Arodef Linux - Hardware 0 08-04-2004 07:36 PM
USB hard drive looks corrupted wirawan0 Linux - Hardware 0 04-20-2004 12:47 PM
Add ReiserFS package destroys non-ReiserFS partitions smirk Mandriva 0 03-24-2004 08:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 01:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration