Discussion:
Can't mount nilfs - error searching super root.
Milos Jana
2009-01-14 22:04:30 UTC
Permalink
Hi,
After 2 weeks of successful using of NILFS on my pendrive I encountered this
error:

***@computer:~$ sudo mount /media/pendrive/
[sudo] password for user:
mount.nilfs2: Error while mounting /dev/sdb on /media/pendrive: Invalid
argument

First, I thought there was something wrong with /etc/fstab entry, which
looks like this:

/dev/sdb /media/pendrive nilfs2 noauto,user,rw 0 0

But it looked the same when drive was working fine, I also tried different
parameters but it did not help. The last two lines from dmesg output made me
even more worry:

[ 759.733075] usb 7-3: new high speed USB device using ehci_hcd and address
5
[ 763.362043] usb 7-3: configuration #1 chosen from 1 choice
[ 763.713991] usbcore: registered new interface driver libusual
[ 763.730554] Initializing USB Mass Storage driver...
[ 763.730704] scsi5 : SCSI emulation for USB Mass Storage devices
[ 763.732474] usbcore: registered new interface driver usb-storage
[ 763.732480] USB Mass Storage support registered.
[ 763.732647] usb-storage: device found at 5
[ 763.732649] usb-storage: waiting for device to settle before scanning
[ 768.732513] usb-storage: device scan complete
[ 768.733715] scsi 5:0:0:0: Direct-Access USB 2.0 Flash Disk 1100 PQ: 0
ANSI: 0 CCS
[ 768.747539] sd 5:0:0:0: [sdb] 62652416 512-byte hardware sectors (32078
MB)
[ 768.748544] sd 5:0:0:0: [sdb] Write Protect is off
[ 768.748552] sd 5:0:0:0: [sdb] Mode Sense: 43 00 00 00
[ 768.748557] sd 5:0:0:0: [sdb] Assuming drive cache: write through
[ 768.752786] sd 5:0:0:0: [sdb] 62652416 512-byte hardware sectors (32078
MB)
[ 768.753780] sd 5:0:0:0: [sdb] Write Protect is off
[ 768.753787] sd 5:0:0:0: [sdb] Mode Sense: 43 00 00 00
[ 768.753792] sd 5:0:0:0: [sdb] Assuming drive cache: write through
[ 768.753803] sdb: sdb1
[ 768.857613] sd 5:0:0:0: [sdb] Attached SCSI removable disk
[ 768.857786] sd 5:0:0:0: Attached scsi generic sg2 type 0
[ 1130.248957] NILFS warning: Segment magic number invalid
[ 1130.248965] NILFS: error searching super root.

I'm using nilfs2-tools 2.0.3-1 on kernel 2.6.27-10, the error also occurs
after upgrade to nilfs2-utils and nilfs kernel module 2.0.6.

How can I recover this drive? I didn't create any checkpoints, afair the
only thing I have done was to create the new filesystem using mkfs.nilfs2
command.
Ryusuke Konishi
2009-01-15 11:48:26 UTC
Permalink
Hi,
Post by Milos Jana
Hi,
After 2 weeks of successful using of NILFS on my pendrive I encountered this
mount.nilfs2: Error while mounting /dev/sdb on /media/pendrive: Invalid
argument
First, I thought there was something wrong with /etc/fstab entry, which
/dev/sdb /media/pendrive nilfs2 noauto,user,rw 0 0
But it looked the same when drive was working fine, I also tried different
parameters but it did not help. The last two lines from dmesg output made me
<snip>
Post by Milos Jana
I'm using nilfs2-tools 2.0.3-1 on kernel 2.6.27-10, the error also occurs
after upgrade to nilfs2-utils and nilfs kernel module 2.0.6.
Thanks for reporting the trouble.
Post by Milos Jana
How can I recover this drive? I didn't create any checkpoints, afair the
only thing I have done was to create the new filesystem using mkfs.nilfs2
command.
Could you try the test version of fsck available in the follwing url?

https://www.nilfs.org/pipermail/users/2008-December/000350.html

The patch is against nilfs-utils, and it will generate
fsck0.nilfs2 in nilfs2-utils/sbin/mkfs directory.

Patch Usage:
$ cd nilfs-utils-2.0.6
$ patch -p1 < path-to-fsck0.patch
$ ./configure
$ make
$ sudo make install
$ sudo fsck0.nilfs2 <device>

Regards,
Ryusuke
Milos Jana
2009-01-15 15:03:07 UTC
Permalink
I managed to apply the patch (the file fsck0.nilfs2.c was created) but
after building nilfs-utils I can't find fsck0.nilfs2 command, it looks
like it was not compiled.

Here is build log: http://wklej.org/id/39551/
Ryusuke Konishi
2009-01-15 17:01:15 UTC
Permalink
Hi!
Post by Milos Jana
I managed to apply the patch (the file fsck0.nilfs2.c was created) but
after building nilfs-utils I can't find fsck0.nilfs2 command, it looks
like it was not compiled.
Here is build log: http://wklej.org/id/39551/
Okay. In some environment, Makefiles are not regenerated automatically.
You may have to run automake and autoconf before running the
./configure script. The full build procedures are as follows:

$ tar jxf nilfs-utils-2.0.6.tar.bz2
$ cd nilfs-utils-2.0.6
$ patch -p1 < path-to-fsck0.patch
[ usually omissible
$ aclocal
$ autoheader
$ libtoolize -c --force
$ automake -a -c
$ autoconf
]
$ ./configure
$ make

$ sudo make install
$ sudo fsck0.nilfs2 <device>

If your machine doesn't have autoconf, automake, or libtool package,
these may be required in advance.

How did it come out?

Ryusuke
Milos Jana
2009-01-15 18:10:19 UTC
Permalink
Nilfs-utils compiled properly with patch after following instructions from
your previous post. Here is what came out:

***@laptop:~$ sudo fsck0.nilfs2 /dev/sdb
Super-block:
revision = 2.0, checksum = OK
blocksize = 4096
write time = 2008-12-28 09:48:42
indicated partial segment: blocknr = 4263936
segnum = 2082, seq = 11746, cno=6661

Clean FS.

***@laptop:~$ sudo mount /media/pendrive/
mount.nilfs2: Error while mounting /dev/sdb on /media/pendrive: Invalid
argument
Post by Ryusuke Konishi
Hi!
Post by Milos Jana
I managed to apply the patch (the file fsck0.nilfs2.c was created) but
after building nilfs-utils I can't find fsck0.nilfs2 command, it looks
like it was not compiled.
Here is build log: http://wklej.org/id/39551/
Okay. In some environment, Makefiles are not regenerated automatically.
You may have to run automake and autoconf before running the
$ tar jxf nilfs-utils-2.0.6.tar.bz2
$ cd nilfs-utils-2.0.6
$ patch -p1 < path-to-fsck0.patch
[ usually omissible
$ aclocal
$ autoheader
$ libtoolize -c --force
$ automake -a -c
$ autoconf
]
$ ./configure
$ make
$ sudo make install
$ sudo fsck0.nilfs2 <device>
If your machine doesn't have autoconf, automake, or libtool package,
these may be required in advance.
How did it come out?
Ryusuke
Ryusuke Konishi
2009-01-16 07:55:03 UTC
Permalink
Post by Milos Jana
Nilfs-utils compiled properly with patch after following instructions from
revision = 2.0, checksum = OK
blocksize = 4096
write time = 2008-12-28 09:48:42
indicated partial segment: blocknr = 4263936
segnum = 2082, seq = 11746, cno=6661
Clean FS.
mount.nilfs2: Error while mounting /dev/sdb on /media/pendrive: Invalid
argument
Hmm, that's weird.

The partition was cleanly unmounted, but the final segment seems not
to be written to the disk.

Maybe, we need 'force' option to treat such situation.

In the meatime, could you try the following (additional) patch?

Regards,
Ryusuke
--

diff --git a/sbin/mkfs/fsck0.nilfs2.c b/sbin/mkfs/fsck0.nilfs2.c
index d3d335f..0d51e54 100644
--- a/sbin/mkfs/fsck0.nilfs2.c
+++ b/sbin/mkfs/fsck0.nilfs2.c
@@ -905,10 +905,12 @@ static void nilfs_fsck(const char *device)
print_pseg_message(&pseg_ref, " indicated partial segment");
fputc('\n', stderr);

+#if 0
if (le16_to_cpu(sb.s_state) & NILFS_VALID_FS) {
fprintf(stderr, "Clean FS.\n");
goto out_clean;
}
+#endif

if (nilfs_do_recovery(devfd, &pseg_ref) == 0)
goto out;
Milos Jana
2009-01-16 09:38:16 UTC
Permalink
***@laptop:~/prog/sources/nilfs-utils-2.0.6$ sudo fsck0.nilfs2 /dev/sdb
[sudo] password for user:
Super-block:
revision = 2.0, checksum = OK
blocksize = 4096
write time = 2008-12-28 09:48:42
indicated partial segment: blocknr = 4263936
segnum = 2082, seq = 11746, cno=6661

empty or bad segment: segnum = 2082, blocknr = 4263936
The latest segment is lost. Trying rollback recovery..
.
Searching the latest checkpoint.
Selected segment: blocknr = 4261888
segnum = 2081, seq = 11745, cno=6660
creation time = 2008-12-28 09:48:34
Do you wish to overwrite super block (y/N)? Y
Recovery will complete on mount.
***@laptop:~/prog/sources/nilfs-utils-2.0.6$ sudo mount /media/pendrive/
mount.nilfs2: Error while mounting /dev/sdb on /media/pendrive: Invalid
argument

dmesg returns the same errors:
[ 553.003240] NILFS warning: Segment magic number invalid
[ 553.003248] NILFS: error searching super root.
Post by Ryusuke Konishi
Post by Milos Jana
Nilfs-utils compiled properly with patch after following instructions
from
Post by Milos Jana
revision = 2.0, checksum = OK
blocksize = 4096
write time = 2008-12-28 09:48:42
indicated partial segment: blocknr = 4263936
segnum = 2082, seq = 11746, cno=6661
Clean FS.
mount.nilfs2: Error while mounting /dev/sdb on /media/pendrive: Invalid
argument
Hmm, that's weird.
The partition was cleanly unmounted, but the final segment seems not
to be written to the disk.
Maybe, we need 'force' option to treat such situation.
In the meatime, could you try the following (additional) patch?
Regards,
Ryusuke
--
diff --git a/sbin/mkfs/fsck0.nilfs2.c b/sbin/mkfs/fsck0.nilfs2.c
index d3d335f..0d51e54 100644
--- a/sbin/mkfs/fsck0.nilfs2.c
+++ b/sbin/mkfs/fsck0.nilfs2.c
@@ -905,10 +905,12 @@ static void nilfs_fsck(const char *device)
print_pseg_message(&pseg_ref, " indicated partial segment");
fputc('\n', stderr);
+#if 0
if (le16_to_cpu(sb.s_state) & NILFS_VALID_FS) {
fprintf(stderr, "Clean FS.\n");
goto out_clean;
}
+#endif
if (nilfs_do_recovery(devfd, &pseg_ref) == 0)
goto out;
Ryusuke Konishi
2009-01-16 10:02:00 UTC
Permalink
Post by Milos Jana
revision = 2.0, checksum = OK
<snip>
Post by Milos Jana
Searching the latest checkpoint.
Selected segment: blocknr = 4261888
segnum = 2081, seq = 11745, cno=6660
creation time = 2008-12-28 09:48:34
Do you wish to overwrite super block (y/N)? Y
Oops, use 'y' instead of 'Y'.

Sorry for the unfriendly interface.
I'll fix it in a next time.

Ryusuke
Post by Milos Jana
Recovery will complete on mount.
mount.nilfs2: Error while mounting /dev/sdb on /media/pendrive: Invalid
argument
[ 553.003240] NILFS warning: Segment magic number invalid
[ 553.003248] NILFS: error searching super root.
Post by Ryusuke Konishi
Post by Milos Jana
Nilfs-utils compiled properly with patch after following instructions
from
Post by Milos Jana
revision = 2.0, checksum = OK
blocksize = 4096
write time = 2008-12-28 09:48:42
indicated partial segment: blocknr = 4263936
segnum = 2082, seq = 11746, cno=6661
Clean FS.
mount.nilfs2: Error while mounting /dev/sdb on /media/pendrive: Invalid
argument
Hmm, that's weird.
The partition was cleanly unmounted, but the final segment seems not
to be written to the disk.
Maybe, we need 'force' option to treat such situation.
In the meatime, could you try the following (additional) patch?
Regards,
Ryusuke
--
diff --git a/sbin/mkfs/fsck0.nilfs2.c b/sbin/mkfs/fsck0.nilfs2.c
index d3d335f..0d51e54 100644
--- a/sbin/mkfs/fsck0.nilfs2.c
+++ b/sbin/mkfs/fsck0.nilfs2.c
@@ -905,10 +905,12 @@ static void nilfs_fsck(const char *device)
print_pseg_message(&pseg_ref, " indicated partial segment");
fputc('\n', stderr);
+#if 0
if (le16_to_cpu(sb.s_state) & NILFS_VALID_FS) {
fprintf(stderr, "Clean FS.\n");
goto out_clean;
}
+#endif
if (nilfs_do_recovery(devfd, &pseg_ref) == 0)
goto out;
Milos Jana
2009-01-16 11:15:53 UTC
Permalink
Post by Ryusuke Konishi
Oops, use 'y' instead of 'Y'.
This solved the problem, pendrive mounted successfuly and it looks like no
data was lost. Thanks for your help and hard work on NILFS development :)
Csaba Kos
2009-01-16 10:22:46 UTC
Permalink
Hi!

Sorry to chime in uncalled, but I noticed that you are trying to mount
"/dev/sdb".
I have to admit that it has been a while since I last mounted a
pendrive from the
command line, so I might be wrong, but usually one mounts partitions
on the device,
like "/dev/sdb1", and not the device itself.

Regards,

Csaba Kos
Post by Milos Jana
revision = 2.0, checksum = OK
blocksize = 4096
write time = 2008-12-28 09:48:42
indicated partial segment: blocknr = 4263936
segnum = 2082, seq = 11746, cno=6661
empty or bad segment: segnum = 2082, blocknr = 4263936
The latest segment is lost. Trying rollback recovery..
.
Searching the latest checkpoint.
Selected segment: blocknr = 4261888
segnum = 2081, seq = 11745, cno=6660
creation time = 2008-12-28 09:48:34
Do you wish to overwrite super block (y/N)? Y
Recovery will complete on mount.
mount.nilfs2: Error while mounting /dev/sdb on /media/pendrive: Invalid
argument
[ 553.003240] NILFS warning: Segment magic number invalid
[ 553.003248] NILFS: error searching super root.
Post by Ryusuke Konishi
Post by Milos Jana
Nilfs-utils compiled properly with patch after following instructions from
revision = 2.0, checksum = OK
blocksize = 4096
write time = 2008-12-28 09:48:42
indicated partial segment: blocknr = 4263936
segnum = 2082, seq = 11746, cno=6661
Clean FS.
mount.nilfs2: Error while mounting /dev/sdb on /media/pendrive: Invalid
argument
Hmm, that's weird.
The partition was cleanly unmounted, but the final segment seems not
to be written to the disk.
Maybe, we need 'force' option to treat such situation.
In the meatime, could you try the following (additional) patch?
Regards,
Ryusuke
--
diff --git a/sbin/mkfs/fsck0.nilfs2.c b/sbin/mkfs/fsck0.nilfs2.c
index d3d335f..0d51e54 100644
--- a/sbin/mkfs/fsck0.nilfs2.c
+++ b/sbin/mkfs/fsck0.nilfs2.c
@@ -905,10 +905,12 @@ static void nilfs_fsck(const char *device)
print_pseg_message(&pseg_ref, " indicated partial segment");
fputc('\n', stderr);
+#if 0
if (le16_to_cpu(sb.s_state) & NILFS_VALID_FS) {
fprintf(stderr, "Clean FS.\n");
goto out_clean;
}
+#endif
if (nilfs_do_recovery(devfd, &pseg_ref) == 0)
goto out;
_______________________________________________
users mailing list
https://www.nilfs.org/mailman/listinfo/users
Ryusuke Konishi
2009-01-16 11:07:49 UTC
Permalink
Post by Csaba Kos
Hi!
Sorry to chime in uncalled, but I noticed that you are trying to mount
"/dev/sdb".
I have to admit that it has been a while since I last mounted a
pendrive from the
command line, so I might be wrong, but usually one mounts partitions
on the device,
like "/dev/sdb1", and not the device itself.
No, no. That's OK.
NILFS does not overwrite the partition table block, so is available
for the device itself.
Of course, it's unless there's a bug for this usage ;)

Ryusuke
Post by Csaba Kos
Regards,
Csaba Kos
Post by Milos Jana
revision = 2.0, checksum = OK
blocksize = 4096
write time = 2008-12-28 09:48:42
indicated partial segment: blocknr = 4263936
segnum = 2082, seq = 11746, cno=6661
empty or bad segment: segnum = 2082, blocknr = 4263936
The latest segment is lost. Trying rollback recovery..
.
Searching the latest checkpoint.
Selected segment: blocknr = 4261888
segnum = 2081, seq = 11745, cno=6660
creation time = 2008-12-28 09:48:34
Do you wish to overwrite super block (y/N)? Y
Recovery will complete on mount.
mount.nilfs2: Error while mounting /dev/sdb on /media/pendrive: Invalid
argument
[ 553.003240] NILFS warning: Segment magic number invalid
[ 553.003248] NILFS: error searching super root.
Post by Ryusuke Konishi
Post by Milos Jana
Nilfs-utils compiled properly with patch after following instructions from
revision = 2.0, checksum = OK
blocksize = 4096
write time = 2008-12-28 09:48:42
indicated partial segment: blocknr = 4263936
segnum = 2082, seq = 11746, cno=6661
Clean FS.
mount.nilfs2: Error while mounting /dev/sdb on /media/pendrive: Invalid
argument
Hmm, that's weird.
The partition was cleanly unmounted, but the final segment seems not
to be written to the disk.
Maybe, we need 'force' option to treat such situation.
In the meatime, could you try the following (additional) patch?
Regards,
Ryusuke
--
diff --git a/sbin/mkfs/fsck0.nilfs2.c b/sbin/mkfs/fsck0.nilfs2.c
index d3d335f..0d51e54 100644
--- a/sbin/mkfs/fsck0.nilfs2.c
+++ b/sbin/mkfs/fsck0.nilfs2.c
@@ -905,10 +905,12 @@ static void nilfs_fsck(const char *device)
print_pseg_message(&pseg_ref, " indicated partial segment");
fputc('\n', stderr);
+#if 0
if (le16_to_cpu(sb.s_state) & NILFS_VALID_FS) {
fprintf(stderr, "Clean FS.\n");
goto out_clean;
}
+#endif
if (nilfs_do_recovery(devfd, &pseg_ref) == 0)
goto out;
_______________________________________________
users mailing list
https://www.nilfs.org/mailman/listinfo/users
_______________________________________________
users mailing list
https://www.nilfs.org/mailman/listinfo/users
Csaba Kos
2009-01-16 11:16:55 UTC
Permalink
Post by Ryusuke Konishi
Post by Csaba Kos
Hi!
Sorry to chime in uncalled, but I noticed that you are trying to mount
"/dev/sdb".
I have to admit that it has been a while since I last mounted a
pendrive from the
command line, so I might be wrong, but usually one mounts partitions
on the device,
like "/dev/sdb1", and not the device itself.
No, no. That's OK.
NILFS does not overwrite the partition table block, so is available
for the device itself.
Of course, it's unless there's a bug for this usage ;)
Ah, sorry, I didn't know about that and thank you for the heads up. So
sdb and sdb1 is basically equivalent for nilfs? Is this a
nilfs-specific feature?

Regards,

Csaba
Post by Ryusuke Konishi
Ryusuke
Post by Csaba Kos
Regards,
Csaba Kos
Post by Milos Jana
revision = 2.0, checksum = OK
blocksize = 4096
write time = 2008-12-28 09:48:42
indicated partial segment: blocknr = 4263936
segnum = 2082, seq = 11746, cno=6661
empty or bad segment: segnum = 2082, blocknr = 4263936
The latest segment is lost. Trying rollback recovery..
.
Searching the latest checkpoint.
Selected segment: blocknr = 4261888
segnum = 2081, seq = 11745, cno=6660
creation time = 2008-12-28 09:48:34
Do you wish to overwrite super block (y/N)? Y
Recovery will complete on mount.
mount.nilfs2: Error while mounting /dev/sdb on /media/pendrive: Invalid
argument
[ 553.003240] NILFS warning: Segment magic number invalid
[ 553.003248] NILFS: error searching super root.
Post by Ryusuke Konishi
Post by Milos Jana
Nilfs-utils compiled properly with patch after following instructions from
revision = 2.0, checksum = OK
blocksize = 4096
write time = 2008-12-28 09:48:42
indicated partial segment: blocknr = 4263936
segnum = 2082, seq = 11746, cno=6661
Clean FS.
mount.nilfs2: Error while mounting /dev/sdb on /media/pendrive: Invalid
argument
Hmm, that's weird.
The partition was cleanly unmounted, but the final segment seems not
to be written to the disk.
Maybe, we need 'force' option to treat such situation.
In the meatime, could you try the following (additional) patch?
Regards,
Ryusuke
--
diff --git a/sbin/mkfs/fsck0.nilfs2.c b/sbin/mkfs/fsck0.nilfs2.c
index d3d335f..0d51e54 100644
--- a/sbin/mkfs/fsck0.nilfs2.c
+++ b/sbin/mkfs/fsck0.nilfs2.c
@@ -905,10 +905,12 @@ static void nilfs_fsck(const char *device)
print_pseg_message(&pseg_ref, " indicated partial segment");
fputc('\n', stderr);
+#if 0
if (le16_to_cpu(sb.s_state) & NILFS_VALID_FS) {
fprintf(stderr, "Clean FS.\n");
goto out_clean;
}
+#endif
if (nilfs_do_recovery(devfd, &pseg_ref) == 0)
goto out;
_______________________________________________
users mailing list
https://www.nilfs.org/mailman/listinfo/users
_______________________________________________
users mailing list
https://www.nilfs.org/mailman/listinfo/users
Ryusuke Konishi
2009-01-16 13:22:55 UTC
Permalink
Post by Csaba Kos
Post by Ryusuke Konishi
Post by Csaba Kos
Hi!
Sorry to chime in uncalled, but I noticed that you are trying to mount
"/dev/sdb".
I have to admit that it has been a while since I last mounted a
pendrive from the
command line, so I might be wrong, but usually one mounts partitions
on the device,
like "/dev/sdb1", and not the device itself.
No, no. That's OK.
NILFS does not overwrite the partition table block, so is available
for the device itself.
Of course, it's unless there's a bug for this usage ;)
Ah, sorry, I didn't know about that and thank you for the heads up. So
sdb and sdb1 is basically equivalent for nilfs?
No. If you did mkfs for sdb, the mount device must be sdb (not sdb1),
and the opposite is true. So they differ.
Post by Csaba Kos
Is this a nilfs-specific feature?
I believe most filesystems can do this.
One of the merits to use device itself is that it can align the
disk area without inserting offset sectors.

Since performance of flash devices is often sensitive to alignment of
sectors, this style is occasionally used.

Cheers,
Ryusuke
Post by Csaba Kos
Regards,
Csaba
Post by Ryusuke Konishi
Ryusuke
Post by Csaba Kos
Regards,
Csaba Kos
Post by Milos Jana
revision = 2.0, checksum = OK
blocksize = 4096
write time = 2008-12-28 09:48:42
indicated partial segment: blocknr = 4263936
segnum = 2082, seq = 11746, cno=6661
empty or bad segment: segnum = 2082, blocknr = 4263936
The latest segment is lost. Trying rollback recovery..
.
Searching the latest checkpoint.
Selected segment: blocknr = 4261888
segnum = 2081, seq = 11745, cno=6660
creation time = 2008-12-28 09:48:34
Do you wish to overwrite super block (y/N)? Y
Recovery will complete on mount.
mount.nilfs2: Error while mounting /dev/sdb on /media/pendrive: Invalid
argument
[ 553.003240] NILFS warning: Segment magic number invalid
[ 553.003248] NILFS: error searching super root.
Post by Ryusuke Konishi
Post by Milos Jana
Nilfs-utils compiled properly with patch after following instructions from
revision = 2.0, checksum = OK
blocksize = 4096
write time = 2008-12-28 09:48:42
indicated partial segment: blocknr = 4263936
segnum = 2082, seq = 11746, cno=6661
Clean FS.
mount.nilfs2: Error while mounting /dev/sdb on /media/pendrive: Invalid
argument
Hmm, that's weird.
The partition was cleanly unmounted, but the final segment seems not
to be written to the disk.
Maybe, we need 'force' option to treat such situation.
In the meatime, could you try the following (additional) patch?
Regards,
Ryusuke
--
diff --git a/sbin/mkfs/fsck0.nilfs2.c b/sbin/mkfs/fsck0.nilfs2.c
index d3d335f..0d51e54 100644
--- a/sbin/mkfs/fsck0.nilfs2.c
+++ b/sbin/mkfs/fsck0.nilfs2.c
@@ -905,10 +905,12 @@ static void nilfs_fsck(const char *device)
print_pseg_message(&pseg_ref, " indicated partial segment");
fputc('\n', stderr);
+#if 0
if (le16_to_cpu(sb.s_state) & NILFS_VALID_FS) {
fprintf(stderr, "Clean FS.\n");
goto out_clean;
}
+#endif
if (nilfs_do_recovery(devfd, &pseg_ref) == 0)
goto out;
_______________________________________________
users mailing list
https://www.nilfs.org/mailman/listinfo/users
_______________________________________________
users mailing list
https://www.nilfs.org/mailman/listinfo/users
Milos Jana
2009-01-24 00:13:41 UTC
Permalink
Hi again,

Looks like I'm unable to mount this drive again. It mounted successfully
several times after following your previous posts, but yesterday the problem
came back. I'm sure that I have been mounting/unmounting my pendrive
properly. This time fsck0.nilfs2 doesn't help - it hangs with "Searching the
latest checkpoint." message (see below).

***@laptop:~$ sudo mount /media/pendrive/
mount.nilfs2: Error while mounting /dev/sdb on /media/pendrive: Invalid
argument

***@laptop:~$ dmesg
...
[22429.446924] NILFS warning: Segment magic number invalid
[22429.446932] NILFS: error searching super root.

***@laptop:~/prog/sources/nilfs-utils-2.0.6$ sudo fsck0.nilfs2 /dev/sdb #
Nilfs-tools with first patch applied
Super-block:
revision = 2.0, checksum = OK
blocksize = 4096
write time = 2009-01-22 23:40:19
indicated partial segment: blocknr = 1966080
segnum = 960, seq = 18266, cno=10169

Clean FS.

***@laptop:~/prog/sources/nilfs-utils-2.0.6$ sudo fsck0.nilfs2 /dev/sdb #
Nilfs-tools with additional patch applied
Super-block:
revision = 2.0, checksum = OK
blocksize = 4096
write time = 2009-01-22 23:40:19
indicated partial segment: blocknr = 1966080
segnum = 960, seq = 18266, cno=10169

empty or bad segment: segnum = 960, blocknr = 1966080
The latest segment is lost. Trying rollback recovery..
.
Searching the latest checkpoint. # here it hanged for like 10 minutes
until I killed it
Milos Jana
2009-01-24 00:22:02 UTC
Permalink
Update: fsck0.nilfs returned this after long time:
fsck0.nilfs2: cannot read block (blocknr = 7831552)
Ryusuke Konishi
2009-01-30 12:03:23 UTC
Permalink
Hi,
Post by Milos Jana
Hi again,
Looks like I'm unable to mount this drive again. It mounted successfully
several times after following your previous posts, but yesterday the problem
came back. I'm sure that I have been mounting/unmounting my pendrive
properly.
Hmm, it's abnormal that this occurs so often.
The partition was cleanly unmounted, but the latest segment was not written.
The usb device seems to lack proper support of cache flushing if it
occurs just before power-off.

The usb stack of Linux is often problematic, but this looks terrific.
Post by Milos Jana
This time fsck0.nilfs2 doesn't help - it hangs with "Searching the
latest checkpoint." message (see below).
All right, I'll look into the hang problem.

Please note that the fsck0 is not a complete solution.
To make it better, we need a few changes on the disk format.

Regards,
Ryusuke
Post by Milos Jana
mount.nilfs2: Error while mounting /dev/sdb on /media/pendrive: Invalid
argument
...
[22429.446924] NILFS warning: Segment magic number invalid
[22429.446932] NILFS: error searching super root.
Nilfs-tools with first patch applied
revision = 2.0, checksum = OK
blocksize = 4096
write time = 2009-01-22 23:40:19
indicated partial segment: blocknr = 1966080
segnum = 960, seq = 18266, cno=10169
Clean FS.
Nilfs-tools with additional patch applied
revision = 2.0, checksum = OK
blocksize = 4096
write time = 2009-01-22 23:40:19
indicated partial segment: blocknr = 1966080
segnum = 960, seq = 18266, cno=10169
empty or bad segment: segnum = 960, blocknr = 1966080
The latest segment is lost. Trying rollback recovery..
.
Searching the latest checkpoint. # here it hanged for like 10 minutes
until I killed it
Milos Jana
2009-02-11 15:09:32 UTC
Permalink
Uhm... does it mean that data from my pendrive in unrecoverable? Is there
any chance that future release on fsck0.nilfs will be able to recover it?
Post by Ryusuke Konishi
Hi,
Post by Milos Jana
Hi again,
Looks like I'm unable to mount this drive again. It mounted successfully
several times after following your previous posts, but yesterday the
problem
Post by Milos Jana
came back. I'm sure that I have been mounting/unmounting my pendrive
properly.
Hmm, it's abnormal that this occurs so often.
The partition was cleanly unmounted, but the latest segment was not written.
The usb device seems to lack proper support of cache flushing if it
occurs just before power-off.
The usb stack of Linux is often problematic, but this looks terrific.
Post by Milos Jana
This time fsck0.nilfs2 doesn't help - it hangs with "Searching the
latest checkpoint." message (see below).
All right, I'll look into the hang problem.
Please note that the fsck0 is not a complete solution.
To make it better, we need a few changes on the disk format.
Regards,
Ryusuke
Post by Milos Jana
mount.nilfs2: Error while mounting /dev/sdb on /media/pendrive: Invalid
argument
...
[22429.446924] NILFS warning: Segment magic number invalid
[22429.446932] NILFS: error searching super root.
#
Post by Milos Jana
Nilfs-tools with first patch applied
revision = 2.0, checksum = OK
blocksize = 4096
write time = 2009-01-22 23:40:19
indicated partial segment: blocknr = 1966080
segnum = 960, seq = 18266, cno=10169
Clean FS.
#
Post by Milos Jana
Nilfs-tools with additional patch applied
revision = 2.0, checksum = OK
blocksize = 4096
write time = 2009-01-22 23:40:19
indicated partial segment: blocknr = 1966080
segnum = 960, seq = 18266, cno=10169
empty or bad segment: segnum = 960, blocknr = 1966080
The latest segment is lost. Trying rollback recovery..
.
Searching the latest checkpoint. # here it hanged for like 10 minutes
until I killed it
Ryusuke Konishi
2009-02-12 05:34:08 UTC
Permalink
Hi,
Post by Milos Jana
Uhm... does it mean that data from my pendrive in unrecoverable? Is there
any chance that future release on fsck0.nilfs will be able to recover it?
Oh, sorry. I once looked into the fsck0, but it was paused because I
had to do so many things. I'll increase priority for this if you
really need it. Meanwhile I'm worrying that the same trouble occurs
again and again even if fsck0 will be improved.

I feel we think removing the cause of the problem because
making better fsck will take some time.
And I wonder why the pendrive does not write all data for cleanly
unmounted partition so often. It may need bugfix for the device driver,
for example it may have a silent error problem (i.e. it may complete
I/O operations even if it couldn't handle them properly).

Anyway, I will be able to back to fsck0 after a while.

Regards,
Ryusuke
Post by Milos Jana
Post by Ryusuke Konishi
Hi,
Post by Milos Jana
Hi again,
Looks like I'm unable to mount this drive again. It mounted successfully
several times after following your previous posts, but yesterday the
problem
Post by Milos Jana
came back. I'm sure that I have been mounting/unmounting my pendrive
properly.
Hmm, it's abnormal that this occurs so often.
The partition was cleanly unmounted, but the latest segment was not written.
The usb device seems to lack proper support of cache flushing if it
occurs just before power-off.
The usb stack of Linux is often problematic, but this looks terrific.
Post by Milos Jana
This time fsck0.nilfs2 doesn't help - it hangs with "Searching the
latest checkpoint." message (see below).
All right, I'll look into the hang problem.
Please note that the fsck0 is not a complete solution.
To make it better, we need a few changes on the disk format.
Regards,
Ryusuke
Post by Milos Jana
mount.nilfs2: Error while mounting /dev/sdb on /media/pendrive: Invalid
argument
...
[22429.446924] NILFS warning: Segment magic number invalid
[22429.446932] NILFS: error searching super root.
#
Post by Milos Jana
Nilfs-tools with first patch applied
revision = 2.0, checksum = OK
blocksize = 4096
write time = 2009-01-22 23:40:19
indicated partial segment: blocknr = 1966080
segnum = 960, seq = 18266, cno=10169
Clean FS.
#
Post by Milos Jana
Nilfs-tools with additional patch applied
revision = 2.0, checksum = OK
blocksize = 4096
write time = 2009-01-22 23:40:19
indicated partial segment: blocknr = 1966080
segnum = 960, seq = 18266, cno=10169
empty or bad segment: segnum = 960, blocknr = 1966080
The latest segment is lost. Trying rollback recovery..
.
Searching the latest checkpoint. # here it hanged for like 10 minutes
until I killed it
Milos Jana
2009-04-22 13:18:33 UTC
Permalink
Hi again,
Is it safe for me to try to mount my drive with current release of nilfs and
nilfs-utils? Release notes are quite short, I'm not sure if disk format
change may affect me and whether "Some reported bugs of userland tools were
fixed" also include "error searching super root" problem.
Regards, MJ
Post by Ryusuke Konishi
Hi,
Post by Milos Jana
Uhm... does it mean that data from my pendrive in unrecoverable? Is there
any chance that future release on fsck0.nilfs will be able to recover it?
Oh, sorry. I once looked into the fsck0, but it was paused because I
had to do so many things. I'll increase priority for this if you
really need it. Meanwhile I'm worrying that the same trouble occurs
again and again even if fsck0 will be improved.
I feel we think removing the cause of the problem because
making better fsck will take some time.
And I wonder why the pendrive does not write all data for cleanly
unmounted partition so often. It may need bugfix for the device driver,
for example it may have a silent error problem (i.e. it may complete
I/O operations even if it couldn't handle them properly).
Anyway, I will be able to back to fsck0 after a while.
Regards,
Ryusuke
Ryusuke Konishi
2009-04-22 14:44:55 UTC
Permalink
Hi!
Post by Milos Jana
Hi again,
Is it safe for me to try to mount my drive with current release of nilfs and
nilfs-utils? Release notes are quite short, I'm not sure if disk format
change may affect me and whether "Some reported bugs of userland tools were
fixed" also include "error searching super root" problem.
Regards, MJ
The disk format compatibility is not broken for x86. You can try the
latest nilfs2-utils and nilfs2-module.

Since the "error searching super root" problem is not a bug of mount
procedure but a result of incomplete disk write, it will occur for the
nilfs2 drive in question.

Even after you create a new partition with mkfs.nilfs2, it could be
reproduced if the device or (or the device driver) still has the
problem on sync write. So please do not put valuable data on the
nilfs2 partition.

I'd like to know the root cause of the problem and take measures if I
can do something on file system layer.
I appreciate if you retry using nilfs on the device.

Thanks,
Ryusuke Konishi
Post by Milos Jana
Post by Ryusuke Konishi
Hi,
Post by Milos Jana
Uhm... does it mean that data from my pendrive in unrecoverable? Is there
any chance that future release on fsck0.nilfs will be able to recover it?
Oh, sorry. I once looked into the fsck0, but it was paused because I
had to do so many things. I'll increase priority for this if you
really need it. Meanwhile I'm worrying that the same trouble occurs
again and again even if fsck0 will be improved.
I feel we think removing the cause of the problem because
making better fsck will take some time.
And I wonder why the pendrive does not write all data for cleanly
unmounted partition so often. It may need bugfix for the device driver,
for example it may have a silent error problem (i.e. it may complete
I/O operations even if it couldn't handle them properly).
Anyway, I will be able to back to fsck0 after a while.
Regards,
Ryusuke
Milos Jana
2009-05-10 14:50:36 UTC
Permalink
Hi,
The same problem (error searching super root) occurred after one week of
using NILFS, this time the drive was formated and mounted with
nilfs/nilfs-utils version 2.0.12.
Post by Ryusuke Konishi
The disk format compatibility is not broken for x86. You can try the
latest nilfs2-utils and nilfs2-module.
Since the "error searching super root" problem is not a bug of mount
procedure but a result of incomplete disk write, it will occur for the
nilfs2 drive in question.
Even after you create a new partition with mkfs.nilfs2, it could be
reproduced if the device or (or the device driver) still has the
problem on sync write. So please do not put valuable data on the
nilfs2 partition.
I'd like to know the root cause of the problem and take measures if I
can do something on file system layer.
I appreciate if you retry using nilfs on the device.
Thanks,
Ryusuke Konishi
Milos Jana
2009-05-11 15:32:48 UTC
Permalink
The first patch modifies the file /fs/nilfs2/ioctl.c, while NILFS 2.0.12 and
current git version have this file located under the path /fs/ioctl.c.
Anyway, I have replaced all strings "/fs/nilfs/" with "/fs/", which allowed
me to apply the first patch, but the second one and compilation failed:

$ patch -p1 < patch1.patch
patching file fs/ioctl.c
Hunk #6 succeeded at 572 (offset -2 lines).
Hunk #7 succeeded at 606 (offset -2 lines).

$ patch -p1 < patch2.patch
patching file fs/ioctl.c
Hunk #1 FAILED at 25.
Hunk #5 FAILED at 432.
Hunk #6 succeeded at 448 (offset -2 lines).
Hunk #7 succeeded at 469 (offset -2 lines).
Hunk #8 succeeded at 478 (offset -2 lines).
Hunk #9 succeeded at 486 (offset -2 lines).
Hunk #10 succeeded at 506 (offset -2 lines).
2 out of 10 hunks FAILED -- saving rejects to file fs/ioctl.c.rej
patching file fs/nilfs.h
Hunk #1 succeeded at 245 (offset 9 lines).
patching file fs/segment.c
Hunk #1 succeeded at 2789 (offset 200 lines).
Hunk #2 succeeded at 2807 (offset 200 lines).
patching file fs/segment.h


$ make -j2
/home/user/temp/nilfs-2.0.12/fs/ioctl.c:434: error: conflicting types for
‘nilfs_ioctl_mark_blocks_dirty’
/home/user/temp/nilfs-2.0.12/fs/ioctl.c:394: error: previous definition of
‘nilfs_ioctl_mark_blocks_dirty’ was here
/home/user/temp/nilfs-2.0.12/fs/ioctl.c: In function
‘nilfs_ioctl_mark_blocks_dirty’:
/home/user/temp/nilfs-2.0.12/fs/ioctl.c:439: error:
‘nilfs_ioctl_do_mark_blocks_dirty’ undeclared (first use in this function)
/home/user/temp/nilfs-2.0.12/fs/ioctl.c:439: error: (Each undeclared
identifier is reported only once
/home/user/temp/nilfs-2.0.12/fs/ioctl.c:439: error: for each function it
appears in.)
/home/user/temp/nilfs-2.0.12/fs/ioctl.c: In function
‘nilfs_ioctl_prepare_clean_segments’:
/home/user/temp/nilfs-2.0.12/fs/ioctl.c:488: warning: passing argument 3 of
‘nilfs_ioctl_mark_blocks_dirty’ makes integer from pointer without a cast
/home/user/temp/nilfs-2.0.12/fs/ioctl.c:496: error: implicit declaration of
function ‘nilfs_ioctl_free_segments’
/home/user/temp/nilfs-2.0.12/fs/ioctl.c: In function
‘nilfs_ioctl_clean_segments’:
/home/user/temp/nilfs-2.0.12/fs/ioctl.c:544: error: implicit declaration of
function ‘memdup_user’
/home/user/temp/nilfs-2.0.12/fs/ioctl.c:545: warning: assignment makes
pointer from integer without a cast
make[3]: *** [/home/user/temp/nilfs-2.0.12/fs/ioctl.o] Error 1
make[2]: *** [_module_/home/user/temp/nilfs-2.0.12/fs] Error 2
make[2]: Leaving directory `/usr/src/linux-headers-2.6.27-10-generic'
make[1]: *** [default] Error 2
make[1]: Leaving directory `/home/user/temp/nilfs-2.0.12/fs'
make: *** [fs] Error 2
Ryusuke Konishi
2009-05-11 18:52:01 UTC
Permalink
Hi,
Post by Milos Jana
The first patch modifies the file /fs/nilfs2/ioctl.c, while NILFS 2.0.12 and
current git version have this file located under the path /fs/ioctl.c.
Anyway, I have replaced all strings "/fs/nilfs/" with "/fs/", which allowed
$ patch -p1 < patch1.patch
patching file fs/ioctl.c
Hunk #6 succeeded at 572 (offset -2 lines).
Hunk #7 succeeded at 606 (offset -2 lines).
$ patch -p1 < patch2.patch
patching file fs/ioctl.c
Hunk #1 FAILED at 25.
Hunk #5 FAILED at 432.
Hunk #6 succeeded at 448 (offset -2 lines).
Hunk #7 succeeded at 469 (offset -2 lines).
Hunk #8 succeeded at 478 (offset -2 lines).
Hunk #9 succeeded at 486 (offset -2 lines).
Hunk #10 succeeded at 506 (offset -2 lines).
2 out of 10 hunks FAILED -- saving rejects to file fs/ioctl.c.rej
patching file fs/nilfs.h
Hunk #1 succeeded at 245 (offset 9 lines).
patching file fs/segment.c
Hunk #1 succeeded at 2789 (offset 200 lines).
Hunk #2 succeeded at 2807 (offset 200 lines).
patching file fs/segment.h
<snip>

Sorry for confusing you.

These patches I have recently posted on this mailing list is not
against out-of-tree modules but against linux-2.6.30-rc5 (i.e. Linus'
kernel tree). And, these will not solve your problem.

I'll apply corresponding patches to the nilfs2-module git tree after
Linus merged into the mainline.


Regards,
Ryusuke Konishi

Milos Jana
2009-02-11 15:20:15 UTC
Permalink
I forgot to mention one important thing - there isn't really hang problem -
I just had to wait some long time until fsck0.nilfs returned "cannont read
block" error, it took so long probably because pendrive size is quite big
(32GB). So here is this is the full output:
***@laptop:~/prog/sources/nilfs-utils-2.0.6$ sudo fsck0.nilfs2 /dev/sdb #
Nilfs-tools with additional patch applied

Super-block:
revision = 2.0, checksum = OK
blocksize = 4096
write time = 2009-01-22 23:40:19
indicated partial segment: blocknr = 1966080
segnum = 960, seq = 18266, cno=10169

empty or bad segment: segnum = 960, blocknr = 1966080

The latest segment is lost. Trying rollback recovery..

Searching the latest checkpoint.
fsck0.nilfs2: cannot read block (blocknr = 7831552)
Loading...