xfs
[Top] [All Lists]

Re: XFS, empty files after a crash

To: xfs@xxxxxxxxxxx
Subject: Re: XFS, empty files after a crash
From: kadafax@xxxxxxxxx
Date: Mon, 27 Feb 2012 09:43:42 +0100
Authentication-results: mr.google.com; spf=pass (google.com: domain of kadafax@xxxxxxxxx designates 10.204.143.131 as permitted sender) smtp.mail=kadafax@xxxxxxxxx; dkim=pass header.i=kadafax@xxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=+DGj07k7laujURTKbFXKHRDF9ekiR3vr6Ms4relGsR4=; b=nKjERfkgfxTdFlDZRCM3eFUtzuGdW7jTr7QTiTIBteVRNrWrv1k700LsXiulucUMuc uQKGjLTJWj3MtfwOs7+RBDglwrcuK5t9lLUAqeSgFrjR1u4+TK7ZwdjZyJZsj8NYCuta PsnoP9JZCRgCJTyzz4i6CEo3ZXt5dQEdRKlK8=
In-reply-to: <20120227010402.GR3592@dastard>
References: <4F4387A7.2070009@xxxxxxxxx> <20120227010402.GR3592@dastard>
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2
Le 27/02/12 02:04, Dave Chinner a écrit :
On Tue, Feb 21, 2012 at 01:01:43PM +0100, kfx wrote:
# du  myfile
27460    myfile

# du --apparent-size myfile
0    myfile

# xfs_bmap myfile
myfile: no extents
That doesn't seem right:

$ ls -l foobar
-rw------- 1 root root 0 Feb 27 11:54 foobar
$ du foobar
1024    foobar
$ du --apparent-size foobar
0       foobar
$ xfs_bmap foobar
foobar:
        0: [0..2047]: 255169872..255171919

So xfs_bmap can and does report extents beyond EOF.

du uses the fstat(2) syscall to get the block count from the inode,
so it's seeing an inode with a block count but no extents. Can you
dump the inode via xfs_db like so:

$ ls -i foobar
604424233 foobar
$ sudo xfs_db -r -c "inode 604424233" -c p /dev/md0
core.magic = 0x494e
core.mode = 0100600
core.version = 2
.....

And post the output?
[root@server 1_out]# du foobar
25840    foobar
[root@server 1_out]# du --apparent-size foobar
0    foobar
[root@server 1_out]# xfs_bmap foobar
foobar: no extents
[root@server 1_out]# ls -i foobar
114748 foobar
[root@server 1_out]# xfs_db -r -c "inode 114748" -c p /dev/sdc1
core.magic = 0x494e
core.mode = 0100644
core.version = 2
core.format = 2 (extents)
core.nlinkv2 = 1
core.onlink = 0
core.projid = 0
core.uid = 12488
core.gid = 12488
core.flushiter = 0
core.atime.sec = Tue Jan 24 14:50:52 2012
core.atime.nsec = 609667096
core.mtime.sec = Tue Jan 24 14:50:53 2012
core.mtime.nsec = 579672930
core.ctime.sec = Tue Jan 24 14:50:53 2012
core.ctime.nsec = 579672930
core.size = 0
core.nblocks = 6460
core.extsize = 0
core.nextents = 1
core.naextents = 0
core.forkoff = 0
core.aformat = 2 (extents)
core.dmevmask = 0
core.dmstate = 0
core.newrtbm = 0
core.prealloc = 0
core.realtime = 0
core.immutable = 0
core.append = 0
core.sync = 0
core.noatime = 0
core.nodump = 0
core.rtinherit = 0
core.projinherit = 0
core.nosymlinks = 0
core.extsz = 0
core.extszinherit = 0
core.nodefrag = 0
core.filestream = 0
core.gen = 1924597489
next_unlinked = null
u.bmx[0] = [startoff,startblock,blockcount,extentflag] 0:[0,1881705728,6460,0]

After using the Nathaniel's advices and dd'ing the file:
[root@server recover]# ls -alh foobar
-rw-r--r-- 1 root root 26M Feb 24 10:39 /recover/foobar




<Prev in Thread] Current Thread [Next in Thread>