Sorry I've been so slow to respond.  I'm currently taking a vacation.

On Tue, 2009-06-23 at 22:33 -0400, CG Monroe wrote:
> I had a bad power outage that left my Ubuntu 8.04 4x750MB Raid 5 fine 
> according to the raid software but damaged according to fsck. I'm
> hoping 
> there might be a way to recover this fs since my primary Superblock 
> 'SEEMS' almost correct.
> 
> First, here's what fsck -v reports:
> 
> --------------------------
> fsck 1.40.8 (13-Mar-2008)
> fsck.jfs version 1.1.11, 05-Jun-2006
> processing started: 6/23/2009 22.9.27
> Using default parameter: -p
> The current device is: /dev/sda1
> Open(...READ/WRITE EXCLUSIVE...) returned rc = 0
> Invalid data (13) detected in the superblock (P).

I'm looking at this error, and I don't think that it should be a
show-stopper.  It's failing to verify a redundant copy of the aggregate
inode table.  Since it didn't fail on the primary, why treat it as a
failure?

> Invalid magic number in the superblock (S).
> Superblock is corrupt and cannot be repaired
> since both primary and secondary copies are corrupt.

The secondary superblock is garbage, so this doesn't bode well for the
rest of the file system.  Corruption in both the secondary superblock
and the secondary aggregate inode table probably means more damage
elsewhere.

I'm attaching a patch to jfsutils that should let you get by this
problem, but I'm not sure how much further fsck will make it.  You may
want to run jfs_fsck with the -n flag first to see what it wants to do
before letting it write to the file system.  You may also want to try
mounting readonly (mount -o ro) to see if you can recover any data
before doing potentially harmful repair to the file system.

Good luck,
Shaggy
> 
> CANNOT CONTINUE.
> --------------------------
> 
> Running the jfs_debugfs utility and displaying the primary sb gives
> the 
> results below which seems to look pretty normal:
> 
> ----------------------------
> [1] s_magic: 'JFS1' [15] s_ait2.addr1: 0x00
> [2] s_version: 1 [16] s_ait2.addr2: 0x0000aee4
> [3] s_size: 0x00000000fffce838 s_ait2.address: 44772
> [4] s_bsize: 4096 [17] s_logdev: 0x00000801
> [5] s_l2bsize: 12 [18] s_logserial: 0x0000000a
> [6] s_l2bfactor: 3 [19] s_logpxd.len: 8192
> [7] s_pbsize: 512 [20] s_logpxd.addr1: 0x00
> [8] s_l2pbsize: 9 [21] s_logpxd.addr2: 0x1fffdd3a
> [9] pad: Not Displayed s_logpxd.address: 536862010
> [10] s_agsize: 0x00400000 [22] s_fsckpxd.len: 16435
> [11] s_flag: 0x10200900 [23] s_fsckpxd.addr1: 0x00
> JFS_LINUX [24] s_fsckpxd.addr2: 0x1fff9d07
> JFS_COMMIT JFS_GROUPCOMMIT s_fsckpxd.address: 536845575
> JFS_INLINELOG [25] s_time.tv_sec: 0x48504287
> [26] s_time.tv_nsec: 0x00000000
> [27] s_fpack: ''
> [12] s_state: 0x00000000
> FM_CLEAN
> [13] s_compress: 0
> [14] s_ait2.len: 4
> ----------------------------
> 
> However displaying the secondary sb seems to show a lot of damage as 
> seen below:
> 
> ----------------------------
> [1] s_magic: ' ' [15] s_ait2.addr1: 0xff
> [2] s_version: 0 [16] s_ait2.addr2: 0xffffffff
> [3] s_size: 0x0000000000036000 s_ait2.address: 1099511627775
> [4] s_bsize: 256 [17] s_logdev: 0xffffffff
> [5] s_l2bsize: 8 [18] s_logserial: 0xffffffff
> [6] s_l2bfactor: 0 [19] s_logpxd.len: 16777215
> [7] s_pbsize: 85 [20] s_logpxd.addr1: 0xff
> [8] s_l2pbsize: 4 [21] s_logpxd.addr2: 0xffffffff
> [9] pad: Not Displayed s_logpxd.address: 1099511627775
> [10] s_agsize: 0xffffff05 [22] s_fsckpxd.len: 16777215
> [11] s_flag: 0xffffffff [23] s_fsckpxd.addr1: 0xff
> JFS_OS2 JFS_LINUX [24] s_fsckpxd.addr2: 0xffffffff
> JFS_COMMIT JFS_GROUPCOMMIT s_fsckpxd.address: 1099511627775
> JFS_LAZYCOMMIT JFS_INLINELOG [25] s_time.tv_sec: 0xffffffff
> JFS_BAD_SAIT JFS_SPARSE [26] s_time.tv_nsec: 0xffffffff
> DASD_ENABLED DASD_PRIME [27] s_fpack: '▒▒▒▒▒▒▒▒▒▒▒'
> [12] s_state: 0xffffffff
> Unknown State
> [13] s_compress: -1
> [14] s_ait2.len: 16777215
> ----------------------------
> 
> Any hope to manually patch it?
> 
> TIA
> 
> Greg
-- 
David Kleikamp
IBM Linux Technology Center
diff -Nurp jfsutils-1.1.14/fsck/fsckmeta.c jfsutils/fsck/fsckmeta.c
--- jfsutils-1.1.14/fsck/fsckmeta.c	2006-06-05 14:31:40.000000000 -0500
+++ jfsutils/fsck/fsckmeta.c	2009-06-27 11:49:42.000000000 -0500
@@ -2117,6 +2117,11 @@ int validate_super(int which_super)
 			 * the Secondary Agg Inode Table and the Secondary Agg Inode Map
 			 */
 			vs_rc = validate_super_2ndaryAI(which_super);
+			if (vs_rc) {
+				/* This shouldn't be fatal */
+				sb_ptr->s_flag |= JFS_BAD_SAIT;
+				vs_rc = 0;
+			}
 		}
 	}
 	/* end else the magic number and version number are correct so it
------------------------------------------------------------------------------
_______________________________________________
Jfs-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jfs-discussion

Reply via email to