Linux NILFS development
 help / color / mirror / Atom feed
From: Ryusuke Konishi <konishi.ryusuke-Zyj7fXuS5i5L9jVzuh4AOg@public.gmane.org>
To: zahid.chowdhury-VJizFkI/10gAspv4Qr0y0gC/G2K4zDHf@public.gmane.org
Cc: konishi.ryusuke-Zyj7fXuS5i5L9jVzuh4AOg@public.gmane.org,
	linux-nilfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: mount & fsck of nilfs partition fail.
Date: Wed, 15 Jun 2011 10:42:51 +0900 (JST)	[thread overview]
Message-ID: <20110615.104251.29260790.ryusuke@osrg.net> (raw)
In-Reply-To: <053D39D3D76C474EB2D2A284AA6BA3181B05E4E394-ZjuI7xOJlFPnaE3xbIMyWkCiaQ3SRT3KFkJ40O1dFu8@public.gmane.org>

On Tue, 14 Jun 2011 11:04:26 -0700, Zahid Chowdhury wrote:
> Hello Ryusuke,
>   I changed the code some to:
> diff -u --ignore-all-space fsck0.nilfs2.c ~/nilfs/nilfs-utils.git/nilfs2-utils/sbin/fsck
> --- fsck0.nilfs2.c      2011-06-14 11:03:49.000000000 -0700
> +++ /root/nilfs/nilfs-utils.git/nilfs2-utils/sbin/fsck/fsck0.nilfs2.c   2011-06-14 11:01:34.000000000 -0700
> @@ -172,10 +172,14 @@
>  static void read_block(int fd, __u64 blocknr, void *buf,
>                        unsigned long size)
>  {
> +        int num_read;
>         if (lseek64(fd, blocknr * blocksize, SEEK_SET) < 0 ||
> -           read(fd, buf, size) < size)
> -               die("cannot read block (blocknr = %llu): %s",
> -                   (unsigned long long)blocknr, strerror(errno));
> +            (num_read = read(fd, buf, size) < size)) {
> +                fprintf(stderr, "Read size was: %d\tNum read: %d\tStrerror: %s\n",
> +                    size, num_read, strerror(errno));
> +                die("cannot read block (blocknr = %llu)",
> +                    (unsigned long long)blocknr);
> +        }
>  }
> 
>  static inline __u64 segment_start_blocknr(unsigned long segnum)
> 
> and I got this as output:
> 
> ./fsck0.nilfs2 -f -v /dev/sda2
> Super-block:
>     revision = 2.0
>     blocksize = 4096
>     write time = 2011-06-11 23:22:03
>     indicated log: blocknr = 1648528
>         segnum = 804, seq = 401758, cno=3250953
> 
> Unclean FS.
> The latest log is lost. Trying rollback recovery..
> ......
> Searching the latest checkpoint.
> Read size was: 4096     Num read: 1     Strerror: Success
> fsck0.nilfs2: cannot read block (blocknr = 2696911)

The return value looks weird.
Is your block device readable ?

 # dd if=/dev/sda2 of=/sda2-image-file

If you can copy the block device into an image file.  You may be able
to recover it through a loop device.

 # losetup /dev/loop0 /sda2-image-file
 # ./fsck0.nilfs2 -f -v /dev/loop0

Otherwise, you may need a low level recovery for the device.

Regards,
Ryusuke Konishi

> The mount error is:
> $ mount -t nilfs2 /dev/sda2 /writable
> Jun 14 10:52:13 _Lab kernel: NILFS warning: mounting unchecked fs
> Jun 14 10:52:13 _Lab kernel: NILFS warning: Checksum error in segment payload
> Jun 14 10:52:13 _Lab kernel: NILFS: error searching super root.
> mount.nilfs2: Error while mounting /dev/sda2 on /writable: Invalid argument
> 
> 
> Will it still be possible to recover the partition or is this error fatal? Thanks all.
> 
> Zahid
> 
> 
> -----Original Message-----
> From: Ryusuke Konishi [mailto:konishi.ryusuke-Zyj7fXuS5i5L9jVzuh4AOg@public.gmane.org] 
> Sent: Monday, June 13, 2011 4:52 PM
> To: Zahid Chowdhury
> Cc: dexen.devries-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; linux-nilfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Subject: Re: mount & fsck of nilfs partition fail.
> 
> On Mon, 13 Jun 2011 16:28:19 -0700, Zahid Chowdhury wrote:
> > Hello Dexen/Ryusuke,
> >   Thanks both for your help. I tried this:
> >    [quadcore:~/nilfs/nilfs-utils.git/nilfs2-utils] git fetch
> >            http://git.nilfs.org/nilfs2-utils-devel.git fsck0:fsck0
> >    fatal: Refusing to fetch into current branch
> >    [quadcore:~/nilfs/nilfs-utils.git/nilfs2-utils] git checkout fsck0
> >    Already on "fsck0"
> > I also tried from scratch with your commands below (not co, but checkout) -
> > there were no changes to the file with diff:
> >   nilfs2-utils-devel/sbin/fsck/fsck0.nilfs2.c
> 
> Sorry, the fsck0 branch was not propery updated.
> I just fixed the problem in the git repo.
> 
> Regards,
> Ryusuke Konishi
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2011-06-15  1:42 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-13  7:13 mount & fsck of nilfs partition fail Zahid Chowdhury
     [not found] ` <053D39D3D76C474EB2D2A284AA6BA3181B05E4E02D-ZjuI7xOJlFPnaE3xbIMyWkCiaQ3SRT3KFkJ40O1dFu8@public.gmane.org>
2011-06-13 12:33   ` Ryusuke Konishi
     [not found]     ` <20110613.213316.221578492.ryusuke-sG5X7nlA6pw@public.gmane.org>
2011-06-13 21:12       ` Zahid Chowdhury
     [not found]         ` <053D39D3D76C474EB2D2A284AA6BA3181B05E4E167-ZjuI7xOJlFPnaE3xbIMyWkCiaQ3SRT3KFkJ40O1dFu8@public.gmane.org>
2011-06-13 22:21           ` dexen deVries
     [not found]             ` <201106140021.52229.dexen.devries-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2011-06-13 22:28               ` mount & fsck of nilfs partition fail. [correction] dexen deVries
2011-06-13 23:28               ` mount & fsck of nilfs partition fail Zahid Chowdhury
     [not found]                 ` <053D39D3D76C474EB2D2A284AA6BA3181B05E4E1CE-ZjuI7xOJlFPnaE3xbIMyWkCiaQ3SRT3KFkJ40O1dFu8@public.gmane.org>
2011-06-13 23:51                   ` Ryusuke Konishi
     [not found]                     ` <20110614.085157.212693296.ryusuke-sG5X7nlA6pw@public.gmane.org>
2011-06-14 18:04                       ` Zahid Chowdhury
     [not found]                         ` <053D39D3D76C474EB2D2A284AA6BA3181B05E4E394-ZjuI7xOJlFPnaE3xbIMyWkCiaQ3SRT3KFkJ40O1dFu8@public.gmane.org>
2011-06-15  1:42                           ` Ryusuke Konishi [this message]
     [not found]                             ` <20110615.104251.29260790.ryusuke-sG5X7nlA6pw@public.gmane.org>
2011-06-15 10:58                               ` Ryusuke Konishi
     [not found]                                 ` <20110615.195858.252298449.ryusuke-sG5X7nlA6pw@public.gmane.org>
2011-06-15 18:32                                   ` Ryusuke Konishi
     [not found]                                     ` <20110616.033201.162617955.ryusuke-sG5X7nlA6pw@public.gmane.org>
2011-06-15 18:38                                       ` Zahid Chowdhury
     [not found]                                         ` <053D39D3D76C474EB2D2A284AA6BA3181B05E99563-ZjuI7xOJlFPnaE3xbIMyWkCiaQ3SRT3KFkJ40O1dFu8@public.gmane.org>
2011-06-17 18:29                                           ` Ryusuke Konishi
     [not found]                                             ` <20110618.032928.182500686.ryusuke-sG5X7nlA6pw@public.gmane.org>
2011-06-17 21:55                                               ` Zahid Chowdhury
     [not found]                                                 ` <053D39D3D76C474EB2D2A284AA6BA3181B05E99A12-ZjuI7xOJlFPnaE3xbIMyWkCiaQ3SRT3KFkJ40O1dFu8@public.gmane.org>
2011-06-18  4:53                                                   ` Ryusuke Konishi
     [not found]                                                     ` <20110618.135312.64853996.ryusuke-sG5X7nlA6pw@public.gmane.org>
2011-06-20 18:27                                                       ` Zahid Chowdhury
     [not found]                                                         ` <053D39D3D76C474EB2D2A284AA6BA3181B05E99CC6-ZjuI7xOJlFPnaE3xbIMyWkCiaQ3SRT3KFkJ40O1dFu8@public.gmane.org>
2011-06-23 11:25                                                           ` Ryusuke Konishi
     [not found]                                                             ` <20110623.202505.27804490.ryusuke-sG5X7nlA6pw@public.gmane.org>
2011-06-23 18:21                                                               ` Zahid Chowdhury
     [not found]                                                                 ` <053D39D3D76C474EB2D2A284AA6BA3181B05E9A356-ZjuI7xOJlFPnaE3xbIMyWkCiaQ3SRT3KFkJ40O1dFu8@public.gmane.org>
2011-06-24 16:26                                                                   ` Ryusuke Konishi
     [not found]                                                                     ` <20110625.012634.121140098.ryusuke-sG5X7nlA6pw@public.gmane.org>
2011-07-05  0:29                                                                       ` Zahid Chowdhury
     [not found]                                                                         ` <053D39D3D76C474EB2D2A284AA6BA3181B05EE2ED0-ZjuI7xOJlFPnaE3xbIMyWkCiaQ3SRT3KFkJ40O1dFu8@public.gmane.org>
2011-07-06  2:16                                                                           ` Ryusuke Konishi
     [not found]                                                                             ` <20110706.111615.163244275.ryusuke-sG5X7nlA6pw@public.gmane.org>
2011-07-08 23:52                                                                               ` Zahid Chowdhury
     [not found]                                                                                 ` <053D39D3D76C474EB2D2A284AA6BA3181B05F38A67-ZjuI7xOJlFPnaE3xbIMyWkCiaQ3SRT3KFkJ40O1dFu8@public.gmane.org>
2011-07-14  0:54                                                                                   ` Zahid Chowdhury
     [not found]                                                                                     ` <053D39D3D76C474EB2D2A284AA6BA3181B05F390D2-ZjuI7xOJlFPnaE3xbIMyWkCiaQ3SRT3KFkJ40O1dFu8@public.gmane.org>
2011-08-08 21:33                                                                                       ` Zahid Chowdhury
     [not found]                                                                                         ` <053D39D3D76C474EB2D2A284AA6BA3181B06066B94-ZjuI7xOJlFPnaE3xbIMyWkCiaQ3SRT3KFkJ40O1dFu8@public.gmane.org>
2011-08-23  3:03                                                                                           ` Ryusuke Konishi
     [not found]                                                                                             ` <20110823.120347.178748126.ryusuke-sG5X7nlA6pw@public.gmane.org>
2011-08-23 14:15                                                                                               ` Zahid Chowdhury

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110615.104251.29260790.ryusuke@osrg.net \
    --to=konishi.ryusuke-zyj7fxus5i5l9jvzuh4aog@public.gmane.org \
    --cc=linux-nilfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=zahid.chowdhury-VJizFkI/10gAspv4Qr0y0gC/G2K4zDHf@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox