Re: [Jfs-discussion] Partition corruption, help!!

2004-12-08 Thread Dave Kleikamp
On Wed, 2004-12-08 at 08:20 -0600, Dave Kleikamp wrote:

> Here is a patch that should get you by this specific error,

I bet you'd rather have a patch that compiles.  Apply this one instead.
-- 
David Kleikamp
IBM Linux Technology Center
Index: jfsutils/fsck/fsckmeta.c
===
RCS file: /usr/cvs/jfs/jfsutils/fsck/fsckmeta.c,v
retrieving revision 1.19
diff -u -p -r1.19 fsckmeta.c
--- jfsutils/fsck/fsckmeta.c	24 Sep 2004 14:43:53 -	1.19
+++ jfsutils/fsck/fsckmeta.c	8 Dec 2004 14:27:45 -
@@ -1370,8 +1370,9 @@ int validate_fs_metadata()
 	intermed_rc = inode_get(aggregate_inode, which_fsit, ino_idx, &ino_ptr);
 	if (intermed_rc != FSCK_OK) {
 		/* can't get the inode */
-		vfm_rc = FSCK_CANTREADFSEXT;
-		goto vfm_exit;		
+		//vfm_rc = FSCK_CANTREADFSEXT;
+		//goto vfm_exit;		
+		goto read_root; /* Who really cares? */
 	}
 	
 	/* got superinode extension inode  */
@@ -1379,14 +1380,16 @@ int validate_fs_metadata()
 	intermed_rc = verify_fs_super_ext(ino_ptr, msg_info_ptr,&inode_updated);
 	if (intermed_rc < 0) {
 		/* something really really bad happened */
-		vfm_rc = intermed_rc;
-		goto vfm_exit;		
+		//vfm_rc = intermed_rc;
+		//goto vfm_exit;		
+		goto read_root;
 	}
 	
 	if (intermed_rc != FSCK_OK) {
 		/* inode is bad */
-		vfm_rc = FSCK_FSETEXTBAD;
-		goto vfm_exit;		
+		//vfm_rc = FSCK_FSETEXTBAD;
+		//goto vfm_exit;
+		goto read_root;
 	}
 	
 	/* superinode extension inode is ok */
@@ -1394,9 +1397,9 @@ int validate_fs_metadata()
 		/* need to write the superinode extension */
 		vfm_rc = inode_put(ino_ptr);
 	}
-	if (vfm_rc != FSCK_OK)
-		goto vfm_exit;		
-			
+	//if (vfm_rc != FSCK_OK)
+	//	goto vfm_exit;		
+read_root:
 	/* read the root directory inode */
 	ino_idx = ROOT_I;
 	intermed_rc = inode_get(aggregate_inode, which_fsit, ino_idx,


Re: [Jfs-discussion] Partition corruption, help!!

2004-12-08 Thread Dave Kleikamp
On Tue, 2004-12-07 at 23:59 -0800, Sang Nguyen Van wrote:
> processing terminated:  12/8/2004 8:49:47  with return
> code: 10052  exit code: 8. [xchkdsk.c:472]

Here is a patch that should get you by this specific error, but I'm not
sure how much further you'll get.  This is a failure to read an inode
that isn't used.  fsck shouldn't give up here.  But with both the
journal superblock corrupt, and fsck unable to read this inode, I have a
suspicion that fsck won't get a whole lot farther.

If you can't get fsck to finish, you may try to mount the partition
read-only (mount -oro).  If that succeeds, you may be able to recover
some data.

> About the syslog, before we installed the new SuSe
> 9.2, my administrator checked the system and said
> there was an error message like the system is trying
> to write to the area out of the hardisk space (?!).
> I have a question: the problem comes from my old SuSe
> 7.3 (old kernel), and so the jfs handler or something
> else? Eventhough there may not be much hope for
> recovering the partition, I just don't want it to
> occur again!

I'm not sure what happened, but jfs is much more stable in SuSe 9.2 than
in 7.3.

> Thanks,
> Sang Nguyen.

Shaggy
-- 
David Kleikamp
IBM Linux Technology Center
Index: jfsutils/fsck/fsckmeta.c
===
RCS file: /usr/cvs/jfs/jfsutils/fsck/fsckmeta.c,v
retrieving revision 1.19
diff -u -p -r1.19 fsckmeta.c
--- jfsutils/fsck/fsckmeta.c	24 Sep 2004 14:43:53 -	1.19
+++ jfsutils/fsck/fsckmeta.c	8 Dec 2004 14:12:25 -
@@ -1370,8 +1370,9 @@ int validate_fs_metadata()
 	intermed_rc = inode_get(aggregate_inode, which_fsit, ino_idx, &ino_ptr);
 	if (intermed_rc != FSCK_OK) {
 		/* can't get the inode */
-		vfm_rc = FSCK_CANTREADFSEXT;
-		goto vfm_exit;		
+		//vfm_rc = FSCK_CANTREADFSEXT;
+		//goto vfm_exit;		
+		goto read_root; /* Who really cares? */
 	}
 	
 	/* got superinode extension inode  */
@@ -1379,14 +1380,16 @@ int validate_fs_metadata()
 	intermed_rc = verify_fs_super_ext(ino_ptr, msg_info_ptr,&inode_updated);
 	if (intermed_rc < 0) {
 		/* something really really bad happened */
-		vfm_rc = intermed_rc;
-		goto vfm_exit;		
+		//vfm_rc = intermed_rc;
+		//goto vfm_exit;		
+		goto read_root;
 	}
 	
 	if (intermed_rc != FSCK_OK) {
 		/* inode is bad */
-		vfm_rc = FSCK_FSETEXTBAD;
-		goto vfm_exit;		
+		//vfm_rc = FSCK_FSETEXTBAD;
+		//goto vfm_exit;
+		goto read_root;
 	}
 	
 	/* superinode extension inode is ok */
@@ -1394,8 +1397,8 @@ int validate_fs_metadata()
 		/* need to write the superinode extension */
 		vfm_rc = inode_put(ino_ptr);
 	}
-	if (vfm_rc != FSCK_OK)
-		goto vfm_exit;		
+	//if (vfm_rc != FSCK_OK)
+	//	goto vfm_exit;		
 			
 	/* read the root directory inode */
 	ino_idx = ROOT_I;


Re: [Jfs-discussion] Partition corruption, help!!

2004-12-08 Thread Sang Nguyen Van

--- Dave Kleikamp <[EMAIL PROTECTED]> wrote:

> Hmm, this is what the patch was supposed to fix. 
> Could you try running
> fsck with the -d flag (debug)?

The result is:

...:/ # jfs_fsck -d /dev/hdb1
jfs_fsck version 1.1.7, 22-Jul-2004
processing started: 12/8/2004 8.49.47
Using default parameter: -p [xchkdsk.c:3157]
The current device is:  /dev/hdb1 [xchkdsk.c:1558]
Open(...READ/WRITE EXCLUSIVE...) returned rc = 0
[fsckpfs.c:3273]
Primary superblock is valid. [fsckmeta.c:1570]
The type of file system for the device is JFS.
[xchkdsk.c:1575]
Block size in bytes:  4096 [xchkdsk.c:1902]
Filesystem size in blocks:  40019915 [xchkdsk.c:1909]
**Phase 0 - Replay Journal Log [xchkdsk.c:1916]
LOGREDO:  Log superblock contains invalid magic
number. [logredo.c:537]
logredo failed (rc=-268).  fsck continuing.
[xchkdsk.c:1946]
**Phase 1 - Check Blocks, Files/Directories, and 
Directory Entries [xchkdsk.c:2041]
processing terminated:  12/8/2004 8:49:47  with return
code: 10052  exit code: 8. [xchkdsk.c:472]

About the syslog, before we installed the new SuSe
9.2, my administrator checked the system and said
there was an error message like the system is trying
to write to the area out of the hardisk space (?!).
I have a question: the problem comes from my old SuSe
7.3 (old kernel), and so the jfs handler or something
else? Eventhough there may not be much hope for
recovering the partition, I just don't want it to
occur again!
Thanks,
Sang Nguyen.

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
___
Jfs-discussion mailing list
[EMAIL PROTECTED]
http://www-124.ibm.com/developerworks/oss/mailman/listinfo/jfs-discussion


Re: [Jfs-discussion] Partition corruption, help!!

2004-12-07 Thread Dave Kleikamp
On Mon, 2004-12-06 at 23:56 -0800, Sang Nguyen Van wrote:
> --- Dave Kleikamp <[EMAIL PROTECTED]> wrote:
> > Okay, I've seen this before and this patch to
> > jfsutils should get fsck
> > past phase 1.  Could you please give it a try?
> > 
> I've just built and installed the new jfsutils with
> the patches in those 3 files which you pointed out.
> The results of jfs_fsck seems to puzzle me, with
> jfs_fsck /dev/hdb1 and jfs_fsck -f /dev/hdb1 I have
> the same message:
> The current device is:  /dev/hdb1
> Block size in bytes:  4096
> Filesystem size in blocks:  40019915
> **Phase 0 - Replay Journal Log
> logredo failed (rc=-268).  fsck continuing.

This is not good.  -268 indicates that fsck did not recognize the
journal's superblock.

> **Phase 1 - Check Blocks, Files/Directories, and 
> Directory Entries
> 
> It stopped here, without any message telling "the
> system is clean" as before. Any suggestion?

Hmm, this is what the patch was supposed to fix.  Could you try running
fsck with the -d flag (debug)?

> Thanks,
> Sang Nguyen

Thanks,
Shaggy
-- 
David Kleikamp
IBM Linux Technology Center

___
Jfs-discussion mailing list
[EMAIL PROTECTED]
http://www-124.ibm.com/developerworks/oss/mailman/listinfo/jfs-discussion


Re: [Jfs-discussion] Partition corruption, help!!

2004-12-06 Thread Sang Nguyen Van

--- Dave Kleikamp <[EMAIL PROTECTED]> wrote:
> Okay, I've seen this before and this patch to
> jfsutils should get fsck
> past phase 1.  Could you please give it a try?
> 
I've just built and installed the new jfsutils with
the patches in those 3 files which you pointed out.
The results of jfs_fsck seems to puzzle me, with
jfs_fsck /dev/hdb1 and jfs_fsck -f /dev/hdb1 I have
the same message:
The current device is:  /dev/hdb1
Block size in bytes:  4096
Filesystem size in blocks:  40019915
**Phase 0 - Replay Journal Log
logredo failed (rc=-268).  fsck continuing.
**Phase 1 - Check Blocks, Files/Directories, and 
Directory Entries

It stopped here, without any message telling "the
system is clean" as before. Any suggestion?
Thanks,
Sang Nguyen



__ 
Do you Yahoo!? 
Read only the mail you want - Yahoo! Mail SpamGuard. 
http://promotions.yahoo.com/new_mail 
___
Jfs-discussion mailing list
[EMAIL PROTECTED]
http://www-124.ibm.com/developerworks/oss/mailman/listinfo/jfs-discussion


Re: [Jfs-discussion] Partition corruption, help!!

2004-12-06 Thread Dave Kleikamp
On Mon, 2004-12-06 at 07:26 -0800, Sang Nguyen Van wrote:

> ... # jfs_fsck /dev/hdb1
> jfs_fsck version 1.1.7, 22-Jul-2004
> processing started: 12/6/2004 16.17.41
> Using default parameter: -p
> The current device is:  /dev/hdb1
> Block size in bytes:  4096
> Filesystem size in blocks:  40019915
> **Phase 0 - Replay Journal Log
> logredo failed (rc=-268).  fsck continuing.
> **Phase 1 - Check Blocks, Files/Directories, and 
> Directory Entries
> Filesystem is clean.

> I could not get to phase 2,... of jfs_fsck after many
> tries, and could not mount the 2nd harddisk even after
> trying various option of mount command: -o
> errors=continue ..., still the message:
> mount: wrong fs type, bad option, bad superblock on
> /dev/hdb1,
>or too many mounted file systems

Okay, I've seen this before and this patch to jfsutils should get fsck
past phase 1.  Could you please give it a try?

Thanks,
Shaggy
-- 
David Kleikamp
IBM Linux Technology Center
Index: jfsutils/fsck/fsckmeta.c
===
RCS file: /usr/cvs/jfs/jfsutils/fsck/fsckmeta.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -p -r1.18 -r1.19
--- jfsutils/fsck/fsckmeta.c	17 Dec 2003 20:28:47 -	1.18
+++ jfsutils/fsck/fsckmeta.c	24 Sep 2004 14:43:53 -	1.19
@@ -3322,6 +3322,7 @@ int verify_fs_super_ext(struct dinode *i
 			if (inorecptr->ignore_alloc_blks
 			|| (vfse_rc != FSCK_OK)) {
 inode_invalid = -1;
+vfse_rc = FSCK_OK;
 			}
 		}
 	}
Index: jfsutils/fsck/xchkdsk.c
===
RCS file: /usr/cvs/jfs/jfsutils/fsck/xchkdsk.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -p -r1.48 -r1.49
--- jfsutils/fsck/xchkdsk.c	22 Jul 2004 14:29:37 -	1.48
+++ jfsutils/fsck/xchkdsk.c	24 Sep 2004 14:43:53 -	1.49
@@ -2103,10 +2103,6 @@ int phase1_processing()
 	if (p1_rc != FSCK_OK) {
 		agg_recptr->fsck_is_done = 1;
 		exit_value = FSCK_OP_ERROR;
-		if (p1_rc > 0) {
-			/* this isn't a fsck failure */
-			p1_rc = 0;
-		}
 	}
 	return (p1_rc);
 }
Index: jfsutils/libfs/logredo.c
===
RCS file: /usr/cvs/jfs/jfsutils/libfs/logredo.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -p -r1.26 -r1.27
--- jfsutils/libfs/logredo.c	29 Jun 2004 19:36:53 -	1.26
+++ jfsutils/libfs/logredo.c	24 Sep 2004 13:33:58 -	1.27
@@ -791,14 +791,9 @@ int jfs_logredo(caddr_t pathname, int32_
 		if (vopen[k].state != VOPEN_OPEN)
 			continue;
 
-		/* don't update the maps if the aggregate/lv is
-		 * FM_DIRTY since fsck will rebuild maps anyway
-		 */
-		if (!vopen[k].is_fsdirty) {
-			if ((rc = updateMaps(k)) != 0) {
-fsck_send_msg(lrdo_ERRORCANTUPDMAPS);
-goto error_out;
-			}
+		if ((rc = updateMaps(k)) != 0) {
+			fsck_send_msg(lrdo_ERRORCANTUPDMAPS);
+			goto error_out;
 		}
 
 		/* Make sure all changes are committed to disk before we


[Jfs-discussion] Partition corruption, help!!

2004-12-06 Thread Sang Nguyen Van
I installed a 2nd harddisk (160 GB) formatted with jfs
system to use under SuSe Linux 7.3 several months ago.
Everything worked well until it was crashed last week
when the disk usage of the 2nd harddrive exceeded
something about 100GB (output form my program). My
system is configured like that:
hda7 mounted as /
hdb1 (2nd harddisk) mounted as /local
After that time it was crashed (during the running of
my program overnight), I could not list (by ls
command) the directory which contained the output of
my program, but I still could change to  to others
directory. Then I reboot the system, during booting it
reported errors and checked the hda7 (very long, with
progress bar). After the system is on, I could never
use the 2nd harddrive (it is not mounted), it said:
mount: wrong fs type, bad option, bad superblock on
/dev/hdb1,
   or too many mounted file systems
 .
Thinking that the 'old-fashion' SuSe 7.3 may not
handle the big disk very well, I installed the new
Suse Linux 9.2 without any touch to the 2nd harddisk.
The installation is OK, but after that the 2nd
harddisk is still not mountable with the same error
message.
I use jfs_fsck and have:
... # jfs_fsck /dev/hdb1
jfs_fsck version 1.1.7, 22-Jul-2004
processing started: 12/6/2004 16.17.41
Using default parameter: -p
The current device is:  /dev/hdb1
Block size in bytes:  4096
Filesystem size in blocks:  40019915
**Phase 0 - Replay Journal Log
logredo failed (rc=-268).  fsck continuing.
**Phase 1 - Check Blocks, Files/Directories, and 
Directory Entries
Filesystem is clean.
With the -f option, I have:
... # jfs_fsck -f /dev/hdb1
jfs_fsck version 1.1.7, 22-Jul-2004
processing started: 12/6/2004 16.18.17
The current device is:  /dev/hdb1
Block size in bytes:  4096
Filesystem size in blocks:  40019915
**Phase 0 - Replay Journal Log
logredo failed (rc=-268).  fsck continuing.
**Phase 1 - Check Blocks, Files/Directories, and 
Directory Entries
Filesystem is clean.

I could not get to phase 2,... of jfs_fsck after many
tries, and could not mount the 2nd harddisk even after
trying various option of mount command: -o
errors=continue ..., still the message:
mount: wrong fs type, bad option, bad superblock on
/dev/hdb1,
   or too many mounted file systems

The data on that disk is very important for me. Please
help me how I can have access to the disk (even to
recover only part of it).
Thanks for any help.
Sang Nguyen.

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
___
Jfs-discussion mailing list
[EMAIL PROTECTED]
http://www-124.ibm.com/developerworks/oss/mailman/listinfo/jfs-discussion