From: "Nathaniel W. Turner" <nate@houseofnate.net>
To: xfs@oss.sgi.com
Subject: Re: XFS, empty files after a crash
Date: Thu, 23 Feb 2012 17:15:23 -0500 [thread overview]
Message-ID: <4F46BA7B.70600@houseofnate.net> (raw)
In-Reply-To: <4F469C7F.9020208@gmail.com>
On 02/23/2012 03:07 PM, kadafax@gmail.com wrote:
>
>> kfx, try getting the inode number of the file (via stat or ls -i) and then
>> doing something like this:
>>
>> xfs_db -r $DEV -c "inode $INO" -c "bmap"
>
>
> # xfs_db -r /dev/sdc1 -c "inode 114748" -c "bmap"
> data offset 0 startblock 1881705728 (7/2657536) count 6460 flag 0
>
> # xfs_db -r /dev/sdc1 -c "inode 114754" -c "bmap"
> data offset 0 startblock 1077794560 (4/4052736) count 6582 flag 0
If you want to see what's behind those data extents (which are probably
partially written), you could do something along these lines:
# Determine the AG size
agblocks=$(xfs_db -r /dev/sdc1 -c sb -c p | grep ^agblocks | sed 's/.* = //')
# Copy the extent in the first file, which consists of 6460 blocks (~26MB)
# in AG 7 starting at AG-relative block 2657536:
dd if=/dev/sdc1 bs=4096 skip=$(($agblocks * 7 + 2657536)) count=6460 of=./blob
# examine ./blob
...
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2012-02-23 22:15 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-21 12:01 XFS, empty files after a crash kfx
2012-02-21 16:25 ` Peter Grandi
2012-02-22 3:18 ` Eric Sandeen
2012-02-23 19:38 ` Nathaniel W. Turner
2012-02-23 20:07 ` kadafax
2012-02-23 22:15 ` Nathaniel W. Turner [this message]
2012-02-24 10:21 ` kadafax
2012-02-21 17:39 ` Stan Hoeppner
2012-02-27 1:04 ` Dave Chinner
2012-02-27 8:43 ` kadafax
2012-02-28 1:39 ` Dave Chinner
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=4F46BA7B.70600@houseofnate.net \
--to=nate@houseofnate.net \
--cc=xfs@oss.sgi.com \
/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