Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have an external hard drive with two partitions: A small FAT32 which is mostly empty and works fine and a large ext4 with tons of data, most of which isn't backed up.

The ext4 is visible, but can't be mounted. I get an "error loading journal" error. The drive is a Western Digital Caviar Blue 500GB. Roughly 30GB of that is FAT32 and the rest is the ext4. The light on the enclosure turns red when reading from the bad partition. It was made by Cavalry.

There wasn't any warning, but coincidentally, I've been thinking lately that I should get two large capacity drives for real backups.

Is there anything that can be done? I'm not even sure I have enough storage to backup everything even if it is redeemable.

share|improve this question

closed as off topic by Joel E Salas, Michael Hampton, Magellan, Ward, Ladadadada Oct 22 '12 at 9:55

Questions on Server Fault are expected to relate to professional server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

    
What command are you using to mount it? The obvious I'm sure but it's worth checking. –  Alastair McCormack Oct 21 '12 at 20:23
    
Just the KDE device tray thing. I've tried sudo mount -a also, with no success. –  cloudyOutside Oct 21 '12 at 20:28
    
See my answer below which shows how to mount from the command line –  Alastair McCormack Oct 21 '12 at 20:52
    
justcheckingonall.wordpress.com/2010/07/18/… looks applicable, but I don't want to blindly run commands I see online or run anything that can make it worse. –  cloudyOutside Oct 21 '12 at 21:17
1  
I guess this should have been on SuperUser instead. I ran fsck.ext4 -cDfty -C 0 /dev/sdb1 and managed to recover everything. –  cloudyOutside Oct 23 '12 at 17:05
add comment

2 Answers

Probably your journal have been destroyed (did you have any power cut, or your disk is dying ?) A quick way to bypass it is to mount the filesystem as writeback (without journal)

mount blahblah -o data=writeback

Of course this is just a quick hack to just if my theory is corrent. for a more permanent fix, you must reset the journal {there is a chance to have some inconsistencies on the stuff you had changed right before the problem appeared)

share|improve this answer
1  
You should also mount it read-only in order to prevent further filesystem corruption. –  Michael Hampton Oct 21 '12 at 23:01
add comment

Try mounting the hard disk from the command line:

  1. Find the device name of your external hard disk. Plug it in and do: dmesg | tail -n 20.

You should see something like:

[   19.357961] scsi 8:0:2:0: Direct-Access     ATA      ST31000340AS     SD15 PQ: 0 ANSI: 5
[   19.359664] sd 8:0:2:0: Attached scsi generic sg3 type 0
[   19.360820] sd 8:0:2:0: [sdc] 1953525168 512-byte logical blocks: (1.00 TB/931 GiB)
[   19.485445]  sdc1 sdc2

In my case it would be called sdc

  1. Mount partition 2 on /mnt with explicit type ext4: sudo mount -t ext4 /dev/sdc2 /mnt
share|improve this answer
    
It returned "wrong fs type, bad option, bad superblock on /dev/sdb1, missing codepage or helper program, or other error" –  cloudyOutside Oct 21 '12 at 21:03
    
dmesg | tail returns "[69425.534921] JBD: Failed to read block at offset 1 [69425.534929] JBD: recovery failed [69425.534933] EXT4-fs (sdb1): error loading journal [69428.317719] sd 15:0:0:0: [sdb] Unhandled sense code [69428.317725] sd 15:0:0:0: [sdb] Result: hostbyte=invalid driverbyte=DRIVER_SENSE [69428.317729] sd 15:0:0:0: [sdb] Sense Key : Medium Error [current] [69428.317734] sd 15:0:0:0: [sdb] Add. Sense: Unrecovered read error [69428.317739] sd 15:0:0:0: [sdb] CDB: Read(10): 28 00 1b c4 00 57 00 00 f0 00 [69428.317750] end_request: critical target error, dev sdb, sector 465829975" –  cloudyOutside Oct 21 '12 at 21:11
    
Can you run: file -s /dev/sdb and fdisk -l /dev/sdb –  Alastair McCormack Oct 21 '12 at 21:34
    
file -s /dev/sdb /dev/sdb: x86 boot sector; partition 1: ID=0x83, starthead 1, startsector 63, 935818317 sectors; partition 2: ID=0xb, starthead 254, startsector 935818380, 40949685 sectors, code offset 0xb8 –  cloudyOutside Oct 21 '12 at 21:47
    
fdisk -l /dev/sdb Disk /dev/sdb: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000e9695 Device Boot Start End Blocks Id System /dev/sdb1 63 935818379 467909158+ 83 Linux /dev/sdb2 935818380 976768064 20474842+ b W95 FAT32 –  cloudyOutside Oct 21 '12 at 21:47
show 3 more comments

Not the answer you're looking for? Browse other questions tagged or ask your own question.