# ReiserFS journal-* REPLAY FAILURE fsck required! buffer writ

## devnull5475

Hi.

I can't boot up & I can't mount /dev/sda3 using KNOPPIX. I would like to recover a CVS repository from /dev/sda3. I've read about dd_rescue, but would appreciate some explanation of errors, advice, &c, before I proceed. E.g., maybe there's more I could do with reiserfsck? What about professional data recovery? TIA.

Here's what I see at boot:

```
# dmesg | less

...

ReiserFS: sda3: found reiserfs format "3.6" with standard journal

ReiserFS: sda3: using ordered data mode

ReiserFS: sda3: journal params: device sda3, size 8192, journal first block 18, max trans len 1024,

 max batch 900, max commit age 30, max trans age 30

ReiserFS: sda3: checking transaction log (sda3)

ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0

ata1.00: (BMDMA stat 0x20)

ata1.00: tag 0 cmd 0xc8 Emask 0x9 stat 0x51 err 0x40 (media error)

ata1: EH complete

ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0

ata1.00: (BMDMA stat 0x20)

ata1.00: tag 0 cmd 0xc8 Emask 0x9 stat 0x51 err 0x40 (media error)

ata1: EH complete

ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0

ata1.00: (BMDMA stat 0x20)

ata1.00: tag 0 cmd 0xc8 Emask 0x9 stat 0x51 err 0x40 (media error)

ata1: EH complete

ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0

ata1.00: (BMDMA stat 0x20)

ata1.00: tag 0 cmd 0xc8 Emask 0x9 stat 0x51 err 0x40 (media error)

ata1: EH complete

ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0

ata1.00: (BMDMA stat 0x20)

ata1.00: tag 0 cmd 0xc8 Emask 0x9 stat 0x51 err 0x40 (media error)

ata1: EH complete

ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0

ata1.00: (BMDMA stat 0x20)

ata1.00: tag 0 cmd 0xc8 Emask 0x9 stat 0x51 err 0x40 (media error)

sd 0:0:0:0: SCSI error: return code = 0x08000002

sda: Current: sense key=0x3

    ASC=0x11 ASCQ=0x4

end_request: I/O error, dev sda, sector 616312

ata1: EH complete

ReiserFS: sda3: warning: journal-1212: REPLAY FAILURE fsck required! buffer write failed

ReiserFS: sda3: warning: Replay Failure, unable to mount

SCSI device sda: 312581808 512-byte hdwr sectors (160042 MB)

sda: Write Protect is off

sda: Mode Sense: 00 3a 00 00

SCSI device sda: drive cache: write back

SCSI device sda: 312581808 512-byte hdwr sectors (160042 MB)

ReiserFS: sda3: warning: sh-2022: reiserfs_fill_super: unable to initialize journal space

sda: Write Protect is off

sda: Mode Sense: 00 3a 00 00

SCSI device sda: drive cache: write back

...
```

Using reiserfsck through KNOPPIX, this is what I see:

```
# reiserfsck -V

reiserfsck 3.6.19 (2003 www.namesys.com)

# reiserfsck --check started at Sat Aug  4 09:09:42 2007

bread: Cannot read the block (3450): (Input/output error).

Aborted

# echo 3450 > /tmp/bb

# reiserfsck --rebuild-sb /dev/sda3

Reiserfs super block in block 16 on 0x803 of format 3.6 with standard journal

Count of blocks on the device: 34180640

Number of bitmaps: 1044

Blocksize: 4096

Free blocks (count of blocks - used [journal, bitmaps, data, reserved] blocks): 16233234

Root block: 7668289

Filesystem is NOT clean

Tree height: 5

Hash function used to sort names: "r5"

Objectid map size 968, max 972

Journal parameters:

        Device [0x0]

        Magic [0x7cd56081]

        Size 8193 blocks (including 1 for journal header) (first block 18)

        Max transaction length 1024 blocks

        Max batch size 900 blocks

        Max commit age 30

Blocks reserved by journal: 0

Fs state field: 0x0:

sb_version: 2

inode generation number: 30138215

UUID: 4a291a7c-768d-48fa-a2c9-45660e825e5f

LABEL:

Set flags in SB:

        ATTRIBUTES CLEAN

Super block seems to be correct

# reiserfsck --fix-fixable -B/tmp/bb /dev/sda3

create_badblock_bitmap: block number (3450) belongs to system reiserfs area. It cannot be relocated.

# reiserfsck --rebuild-tree -B/tmp/bb /dev/sda3

create_badblock_bitmap: block number (3450) belongs to system reiserfs area. It cannot be relocated.

# reiserfsck --rebuild-tree -S -B/tmp/bb /dev/sda3

create_badblock_bitmap: block number (3450) belongs to system reiserfs area. It cannot be relocated.

```

Finally, here's some output from lshw:

```
        *-ide:1

             description: IDE interface

             product: 82801FB/FW (ICH6/ICH6W) SATA Controller

             vendor: Intel Corporation

             physical id: 1f.2

             bus info: pci@0000:00:1f.2

             logical name: scsi0

             version: 03

             width: 32 bits

             clock: 66MHz

             capabilities: ide pm bus_master cap_list emulated

             configuration: driver=ata_piix latency=0

           *-disk

                description: SCSI Disk

                product: SAMSUNG SP1614C

                vendor: ATA

                physical id: 0.0.0

                bus info: scsi@0:0.0.0

                logical name: /dev/sda

                version: SW10

                serial: S01XJ10XC56188

                size: 149GB

                capabilities: partitioned partitioned:dos

                configuration: ansiversion=5

              *-volume:0

                   description: Linux filesystem partition

                   physical id: 1

                   bus info: scsi@0:0.0.0,1

                   logical name: /dev/sda1

                   capacity: 36MB

                   capabilities: primary

              *-volume:1

                   description: Linux swap / Solaris partition

                   physical id: 2

                   bus info: scsi@0:0.0.0,2

                   logical name: /dev/sda2

                   capacity: 251MB

                   capabilities: primary nofs

              *-volume:2

                   description: Linux filesystem partition

                   physical id: 3

                   bus info: scsi@0:0.0.0,3

                   logical name: /dev/sda3

                   capacity: 130GB

                   capabilities: primary
```

Thanks in advance for advice.

----------

## terminal9

It seems there's bad block in journal area, have you tried nolog option to mount?

There's also debugreiserfs command, though not sure if it helps.

----------

## devnull5475

Hi.

Thanks for suggestion. Unfortunately, error message seems essentially the same. I tried:

```
# mount -o nolog /dev/sda3 /media/sda3
```

Error is:

```
warning: journal-1212: REPLAY FAILURE fsck required! buffer write failed

warning: Replay failure. Unable to mount

warning: sh-2022: reiserfs_fill_super: unable to initialize journal space
```

----------

## terminal9

There's also reiserfstune. This seems to have some facility to discard journal, move/create on a separate device. Description paragraph of its man page has some info, also --no-journal-available option.

Added: I suggest you collect and record as much info as possible with debugreiserfs before making such changes.

----------

## devnull5475

OK, I'll look into that. However, at the moment the old disk is detached & I'm focused on rebuilding system on a new disk. Rebuild includes reconstructing CVS repository from backups & up-to-date sandboxes. 

The CVS repository backups are kinda old, so it would have been nice to recover from failed disk. Oh, well. Since USB 2.0 external drive for daily backups costs about $75, this subject really shouldn't come up, should it? This topic probably should be moved out of "Kernel & Hardware" into "Live & Learn" or "Now will you listen?"  :Confused: 

----------

