Re: [Jfs-discussion] Ideas on how to recover a trashed JFS volume.
Brought to you by:
blaschke-oss,
shaggyk
From: Dave K. <sh...@au...> - 2006-10-30 21:47:47
|
On Fri, 2006-10-27 at 22:45 +0200, lu...@ik... wrote: > It was the unallocated inodes that fooled me. When I take them into > account its no problem to detect inode extents. I guess this is quite a > good filter. > > The program does check for duplicate di_numbers, and I am not sure what to > do with these duplicates. The di_number must be unique in the inode set to > be recovered (or else its impossible to decide which inode whould be used > as parent etc.). But how do I choose which inode to keep of two, seemingly > sane, but not identical, inodes? I will attach an example at the end of > this mail. I guess the decision should be made on an entire inode extent. I'm sure one was freed at one point, and a new extent was allocated for the same group of inodes. I think it's pretty safe to choose the one with the larger otime timestamp. The other timestamps can be touched back by cp -p or something, but otime is set when the inode is allocated, and there currently is no interface to change it. > How do I detect which inode that was the original root? In normal cases I > get a set of orphaned trees, but one of this should be the original root. > In the filesystems I have tried it seems that the inode with di_number == > 2 is the root. Is that always true? Yes. The root is always 2. > The program slowly progresses towards something that might be usable by > others than me. I would be very happy with releasing it under the GPL or > some other open source license. But, as I have copied some code from xpeek > I'm not sure weather it is possible. The program is not based on anything > from any jfs package, its only parts from xpeek that has been copied and > modified (the extent walk for instance). The xpeek code is GPL, so that's probably your only option, other than replacing the xpeek code and releasing it under anything you like. > > Best regards, > Simon > > > I have no idea why these two inodes have the same di_number. They also > have the same inostamp. > > Non-unique di_number found! 680576 > [1] di_inostamp: 0x44da3d75 [19] di_mtime.tv_nsec: 0x00000000 > [2] di_fileset: 16 [20] di_otime.tv_sec: 0x45072082 > [3] di_number: 680576 [21] di_otime.tv_nsec: 0x00000000 > [4] di_gen: 7214231 [22] di_acl.flag: 0x00 > [5] di_ixpxd.len: 4 [23] di_acl.rsrvd: Not Displayed > [6] di_ixpxd.addr1: 0x00 [24] di_acl.size: 0x00000000 > [7] di_ixpxd.addr2: 0x000925e8 [25] di_acl.len: 0 > di_ixpxd.address: 599528 [26] di_acl.addr1: 0x00 > [8] di_size: 0x0000000000001000 [27] di_acl.addr2: 0x00000000 > [9] di_nblocks: 0x0000000000000002 di_acl.address: 0 > [10] di_nlink: 2 [28] di_ea.flag: 0x00 > [11] di_uid: 0 [29] di_ea.rsrvd: Not Displayed > [12] di_gid: 0 [30] di_ea.size: 0x00000000 > [13] di_mode: 0x200041ed [31] di_ea.len: 0 > [32] di_ea.addr1: 0x00 > [14] di_atime.tv_sec: 0x45072082 [33] di_ea.addr2: 0x00000000 > [15] di_atime.tv_nsec: 0x00000000 di_ea.address: 0 > [16] di_ctime.tv_sec: 0x45072087 [34] di_next_index: 27 > [17] di_ctime.tv_nsec: 0x234a7068 [35] di_acltype: 0x00000000 > [18] di_mtime.tv_sec: 0x45072085 > > > > > [1] di_inostamp: 0x44da3d75 [19] di_mtime.tv_nsec: 0x00000000 > [2] di_fileset: 16 [20] di_otime.tv_sec: 0x44dfbb92 > [3] di_number: 680576 [21] di_otime.tv_nsec: 0x00000000 > [4] di_gen: 1703739 [22] di_acl.flag: 0x00 > [5] di_ixpxd.len: 4 [23] di_acl.rsrvd: Not Displayed > [6] di_ixpxd.addr1: 0x00 [24] di_acl.size: 0x00000000 > [7] di_ixpxd.addr2: 0x000c507c [25] di_acl.len: 0 > di_ixpxd.address: 807036 [26] di_acl.addr1: 0x00 > [8] di_size: 0x0000000000000010 [27] di_acl.addr2: 0x00000000 > [9] di_nblocks: 0x0000000000000000 di_acl.address: 0 > [10] di_nlink: 2 [28] di_ea.flag: 0x00 > [11] di_uid: 1000 [29] di_ea.rsrvd: Not Displayed > [12] di_gid: 100 [30] di_ea.size: 0x00000000 > [13] di_mode: 0x200041ed [31] di_ea.len: 0 > [32] di_ea.addr1: 0x00 > [14] di_atime.tv_sec: 0x44dfc505 [33] di_ea.addr2: 0x00000000 > [15] di_atime.tv_nsec: 0x00000000 di_ea.address: 0 > [16] di_ctime.tv_sec: 0x44dfc505 [34] di_next_index: 4 > [17] di_ctime.tv_nsec: 0x1185292c [35] di_acltype: 0x00000000 > [18] di_mtime.tv_sec: 0x44d2c8db > > > -- David Kleikamp IBM Linux Technology Center |