Chinaunix首页 | 论坛 | 博客
  • 博客访问: 546803
  • 博文数量: 32
  • 博客积分: 5359
  • 博客等级: 大校
  • 技术积分: 1535
  • 用 户 组: 普通用户
  • 注册时间: 2005-01-04 20:39
文章分类

全部博文(32)

文章存档

2011年(1)

2010年(1)

2009年(6)

2008年(24)

我的朋友

分类:

2009-01-07 12:59:43

    如下步骤,节选自昨天做的rm -r 后恢复子目录中所有文件的实际操作过程。本文同样也是依据LOVEUNIX 技术专家projects的文章——,照猫画虎而来。

17:50:28 dir1
17:50:34
dir1        lost+found
17:50:35 dir1
17:50:40
17:50:41 >a
17:50:45 >b
17:50:49 -l
total 16
-rw-r--r--   1 root     system           31 Jan 06 17:50 a
-rw-r--r--   1 root     system           31 Jan 06 17:50 b
17:50:50 *
Tue Jan  6 17:50:45 BEIST 2009
Tue Jan  6 17:50:49 BEIST 2009
17:50:55
17:51:01
17:51:02 /jfs2
17:51:09
dir1        lost+found
17:51:10 -r dir1
17:51:13
lost+found
17:51:15

17:51:35 -id /jfs2
    2 /jfs2
17:51:39 umount
umount /jfs2

17:53:57 /jfs2

File System:                    /jfs2

File System Size:               523864  (512 byte blocks)
Aggregate Block Size:           4096
Allocation Group Size:          8192    (aggregate blocks)

> i 2
Inode 2 at block 33, offset 0x400:

[1] di_fileset:         16              [18] di_inostamp:       0x4963295c
[2] di_number:          2               [19] di_gen:            1
[3] di_size:    0x0000000000000100      [20] di_ixpxd.len:      4
[4] di_nblocks: 0x0000000000000000      [21] di_ixpxd.addr1:    0x00
[5] di_nlink:           3               [22] di_ixpxd.addr2:    0x00000021
[6] di_mode:            0x000141ed           di_ixpxd.address:  33
                0040755 drwxr-xr-x      [24] di_uid:            0
                                        [25] di_gid:            0
[9] di_atime.tj_nsec:   0x33cba81b      [26] di_atime.tj_sec:0x0000000049632a25
[10] di_ctime.tj_nsec:  0x2747ead0      [27] di_ctime.tj_sec:0x0000000049632991
[11] di_mtime.tj_nsec:  0x2747ead0      [28] di_mtime.tj_sec:0x0000000049632991
[12] di_otime.tj_nsec:  0x00000000      [29] di_otime.tj_sec:0x000000004963295c
[13] di_ea.flag:        0x00            [30] di_ea.len:         0
     EAv1                               [31] di_ea.addr1:       0x00
[15] di_ea.nEntry:      0x00            [32] di_ea.addr2:       0x00000000
[16] di_ea.type:        0x0000               di_ea.address:     0
                                        [34] di_ea.nblocks:     0
change_inode: [m]odify, [e]a, [t]ree, or e[x]it > t
Root D-Tree Node of inode 2

[1] flag        0x83            BT_ROOT  BT_LEAF 
[2] nextindex   1
[3] freecnt     7       Actual Free Count: 7
[4] freelist    2       type 'f' to walk
[5] idotdot     2
    stbl        {1,1,0,0,0,0,0,0}       type '#' for specific stbl entry

       Slots:   next    cnt     type 's' to modify slot
     slot[1]:   0       0
     slot[2]:   3       1
     slot[3]:   4       1
     slot[4]:   5       1
     slot[5]:   6       1
     slot[6]:   7       1
     slot[7]:   8       1
     slot[8]:   -1      1
dtree: Hit enter to see entries, [h]ex dump, [u]p, [m]odify, [f]reelist,
        [s]lot, [#], or e[x]it: h
Slot:      Inum              Next  NamLen    Name
00000000:  00000000 00000002 00000000 00000000   |................|
00000010:  83010702 00000000 01010000 00000000   |................|
00000020:  00000000 00000003 FF0A6C6F 73742B66   |..........lost+f|
00000030:  6F756E64 00000000 00000000 00000000   |ound............|
00000040:  03010000 00000020 FF046469 72310000   |....... ..dir1..|
00000050:  00000000 00000000 00000000 00000000   |................|
00000060:  04010000 00000000 00000000 00000000   |................|
00000070:  00000000 00000000 00000000 00000000   |................|
00000080:  05010000 00000000 00000000 00000000   |................|
00000090:  00000000 00000000 00000000 00000000   |................|
000000a0:  06010000 00000000 00000000 00000000   |................|
000000b0:  00000000 00000000 00000000 00000000   |................|
000000c0:  07010000 00000000 00000000 00000000   |................|
000000d0:  00000000 00000000 00000000 00000000   |................|
000000e0:  08010000 00000000 00000000 00000000   |................|
000000f0:  00000000 00000000 00000000 00000000   |................|
-hit enter for more-
00000100:  FF010000 00000000 00000000 00000000   |................|
00000110:  00000000 00000000 00000000 00000000   |................|
dtree: Press [u]p, [#], or e[x]it > x
> i 32
Inode 32 at block 40, offset 0x0:

[1] di_fileset:         16              [18] di_inostamp:       0x4963295c
[2] di_number:          32              [19] di_gen:            694231674
[3] di_size:    0x0000000000000100      [20] di_ixpxd.len:      4
[4] di_nblocks: 0x0000000000000000      [21] di_ixpxd.addr1:    0x00
[5] di_nlink:           0               [22] di_ixpxd.addr2:    0x00000028
[6] di_mode:            0x000141ed           di_ixpxd.address:  40
                0040755 drwxr-xr-x      [24] di_uid:            0
                                        [25] di_gid:            0
[9] di_atime.tj_nsec:   0x26aed9a9      [26] di_atime.tj_sec:0x0000000049632991
[10] di_ctime.tj_nsec:  0x2747ead0      [27] di_ctime.tj_sec:0x0000000049632991
[11] di_mtime.tj_nsec:  0x26aed9a9      [28] di_mtime.tj_sec:0x0000000049632991
[12] di_otime.tj_nsec:  0x30d07c96      [29] di_otime.tj_sec:0x000000004963296a
[13] di_ea.flag:        0x00            [30] di_ea.len:         0
     EAv1                               [31] di_ea.addr1:       0x00
[15] di_ea.nEntry:      0x00            [32] di_ea.addr2:       0x00000000
[16] di_ea.type:        0x0000               di_ea.address:     0
                                        [34] di_ea.nblocks:     0
change_inode: [m]odify, [e]a, [t]ree, or e[x]it > m 5 1
Inode 32 at block 40, offset 0x0:

[1] di_fileset:         16              [18] di_inostamp:       0x4963295c
[2] di_number:          32              [19] di_gen:            694231674
[3] di_size:    0x0000000000000100      [20] di_ixpxd.len:      4
[4] di_nblocks: 0x0000000000000000      [21] di_ixpxd.addr1:    0x00
[5] di_nlink:           1               [22] di_ixpxd.addr2:    0x00000028
[6] di_mode:            0x000141ed           di_ixpxd.address:  40
                0040755 drwxr-xr-x      [24] di_uid:            0
                                        [25] di_gid:            0
[9] di_atime.tj_nsec:   0x26aed9a9      [26] di_atime.tj_sec:0x0000000049632991
[10] di_ctime.tj_nsec:  0x2747ead0      [27] di_ctime.tj_sec:0x0000000049632991
[11] di_mtime.tj_nsec:  0x26aed9a9      [28] di_mtime.tj_sec:0x0000000049632991
[12] di_otime.tj_nsec:  0x30d07c96      [29] di_otime.tj_sec:0x000000004963296a
[13] di_ea.flag:        0x00            [30] di_ea.len:         0
     EAv1                               [31] di_ea.addr1:       0x00
[15] di_ea.nEntry:      0x00            [32] di_ea.addr2:       0x00000000
[16] di_ea.type:        0x0000               di_ea.address:     0
                                        [34] di_ea.nblocks:     0
change_inode: [m]odify, [e]a, [t]ree, or e[x]it > x
> q
17:54:36 -y /jfs2

 

The current volume is: /dev/fslv01
Primary superblock is valid.
*** Phase 1 - Initial inode scan
Inode 32 has incorrect link count (FIXED)
Superblock marked dirty because repairs are about to be written.
*** Phase 2 - Process remaining directories
*** Phase 3 - Process remaining files
*** Phase 4 - Check and repair inode allocation map
File system inode map is corrupt (FIXED)
*** Phase 5 - Check and repair block allocation map
Inodes not connected to the root directory
         tree have been detected.  Will reconnect.
File system is clean.
Superblock is marked dirty (FIXED)
All observed inconsistencies have been repaired.
17:54:52 /jfs2
17:55:00 /jfs2
17:55:03
lost+found
17:55:04 *
17:55:06 -l
total 0
drwxr-xr-x   2 root     system          256 Jan 06 17:51 32
17:55:09 32
17:55:12
17:55:13

17:57:30 /jfs2
17:57:43 /jfs2

File System:                    /jfs2

File System Size:               523864  (512 byte blocks)
Aggregate Block Size:           4096
Allocation Group Size:          8192    (aggregate blocks)

> i 32
Inode 32 at block 40, offset 0x0:

[1] di_fileset:         16              [18] di_inostamp:       0x4963295c
[2] di_number:          32              [19] di_gen:            694231674
[3] di_size:    0x0000000000000100      [20] di_ixpxd.len:      4
[4] di_nblocks: 0x0000000000000000      [21] di_ixpxd.addr1:    0x00
[5] di_nlink:           2               [22] di_ixpxd.addr2:    0x00000028
[6] di_mode:            0x000141ed           di_ixpxd.address:  40
                0040755 drwxr-xr-x      [24] di_uid:            0
                                        [25] di_gid:            0
[9] di_atime.tj_nsec:   0x266642ca      [26] di_atime.tj_sec:0x0000000049632a81
[10] di_ctime.tj_nsec:  0x2747ead0      [27] di_ctime.tj_sec:0x0000000049632991
[11] di_mtime.tj_nsec:  0x26aed9a9      [28] di_mtime.tj_sec:0x0000000049632991
[12] di_otime.tj_nsec:  0x30d07c96      [29] di_otime.tj_sec:0x000000004963296a
[13] di_ea.flag:        0x00            [30] di_ea.len:         0
     EAv1                               [31] di_ea.addr1:       0x00
[15] di_ea.nEntry:      0x00            [32] di_ea.addr2:       0x00000000
[16] di_ea.type:        0x0000               di_ea.address:     0
                                        [34] di_ea.nblocks:     0
change_inode: [m]odify, [e]a, [t]ree, or e[x]it > t
Root D-Tree Node of inode 32

[1] flag        0x83            BT_ROOT  BT_LEAF 
[2] nextindex   0
[3] freecnt     8       Actual Free Count: 8
[4] freelist    1       type 'f' to walk
[5] idotdot     3
    stbl        {2,2,0,0,0,0,0,0}       type '#' for specific stbl entry

       Slots:   next    cnt     type 's' to modify slot
     slot[1]:   2       1
     slot[2]:   3       0
     slot[3]:   4       0
     slot[4]:   5       0
     slot[5]:   6       0
     slot[6]:   7       0
     slot[7]:   8       0
     slot[8]:   -1      0
dtree: [h]ex dump, [u]p, [m]odify, [f]reelist, [s]lot, [#], or e[x]it: h
Empty tree.  Displaying all entries.

Slot:      Inum              Next  NamLen    Name
00000000:  00000000 00000003 00000000 00000000   |................|
00000010:  83000801 00000000 02020000 00000000   |................|
00000020:  02010000 00000021 FF016100 00000000   |.......!..a.....|
00000030:  00000000 00000000 00000000 00000000   |................|
00000040:  03000000 00000022 FF016200 00000000   |......."..b.....|
00000050:  00000000 00000000 00000000 00000000   |................|
00000060:  04000000 00000000 00000000 00000000   |................|
00000070:  00000000 00000000 00000000 00000000   |................|
00000080:  05000000 00000000 00000000 00000000   |................|
00000090:  00000000 00000000 00000000 00000000   |................|
000000a0:  06000000 00000000 00000000 00000000   |................|
000000b0:  00000000 00000000 00000000 00000000   |................|
000000c0:  07000000 00000000 00000000 00000000   |................|
000000d0:  00000000 00000000 00000000 00000000   |................|
000000e0:  08000000 00000000 00000000 00000000   |................|
000000f0:  00000000 00000000 00000000 00000000   |................|
-hit enter for more-
00000100:  FF000000 00000000 00000000 00000000   |................|
00000110:  00000000 00000000 00000000 00000000   |................|
dtree: Press [u]p, [#], or e[x]it > x
> i 33
Inode 33 at block 40, offset 0x200:

[1] di_fileset:         16              [18] di_inostamp:       0x4963295c
[2] di_number:          33              [19] di_gen:            694231675
[3] di_size:    0x000000000000001f      [20] di_ixpxd.len:      4
[4] di_nblocks: 0x0000000000000001      [21] di_ixpxd.addr1:    0x00
[5] di_nlink:           0               [22] di_ixpxd.addr2:    0x00000028
[6] di_mode:            0x000081a4           di_ixpxd.address:  40
                0100644 -rw-r--r--      [24] di_uid:            0
                                        [25] di_gid:            0
[9] di_atime.tj_nsec:   0x34fce4c0      [26] di_atime.tj_sec:0x000000004963297f
[10] di_ctime.tj_nsec:  0x26aed9a8      [27] di_ctime.tj_sec:0x0000000049632991
[11] di_mtime.tj_nsec:  0x1e569262      [28] di_mtime.tj_sec:0x0000000049632975
[12] di_otime.tj_nsec:  0x1dbdf9a6      [29] di_otime.tj_sec:0x0000000049632975
[13] di_ea.flag:        0x00            [30] di_ea.len:         0
     EAv1                               [31] di_ea.addr1:       0x00
[15] di_ea.nEntry:      0x00            [32] di_ea.addr2:       0x00000000
[16] di_ea.type:        0x0000               di_ea.address:     0
                                        [34] di_ea.nblocks:     0
change_inode: [m]odify, [e]a, [t]ree, or e[x]it > m 5 1
Inode 33 at block 40, offset 0x200:

[1] di_fileset:         16              [18] di_inostamp:       0x4963295c
[2] di_number:          33              [19] di_gen:            694231675
[3] di_size:    0x000000000000001f      [20] di_ixpxd.len:      4
[4] di_nblocks: 0x0000000000000001      [21] di_ixpxd.addr1:    0x00
[5] di_nlink:           1               [22] di_ixpxd.addr2:    0x00000028
[6] di_mode:            0x000081a4           di_ixpxd.address:  40
                0100644 -rw-r--r--      [24] di_uid:            0
                                        [25] di_gid:            0
[9] di_atime.tj_nsec:   0x34fce4c0      [26] di_atime.tj_sec:0x000000004963297f
[10] di_ctime.tj_nsec:  0x26aed9a8      [27] di_ctime.tj_sec:0x0000000049632991
[11] di_mtime.tj_nsec:  0x1e569262      [28] di_mtime.tj_sec:0x0000000049632975
[12] di_otime.tj_nsec:  0x1dbdf9a6      [29] di_otime.tj_sec:0x0000000049632975
[13] di_ea.flag:        0x00            [30] di_ea.len:         0
     EAv1                               [31] di_ea.addr1:       0x00
[15] di_ea.nEntry:      0x00            [32] di_ea.addr2:       0x00000000
[16] di_ea.type:        0x0000               di_ea.address:     0
                                        [34] di_ea.nblocks:     0
change_inode: [m]odify, [e]a, [t]ree, or e[x]it > x
> i 34
Inode 34 at block 40, offset 0x400:

[1] di_fileset:         16              [18] di_inostamp:       0x4963295c
[2] di_number:          34              [19] di_gen:            694231676
[3] di_size:    0x000000000000001f      [20] di_ixpxd.len:      4
[4] di_nblocks: 0x0000000000000001      [21] di_ixpxd.addr1:    0x00
[5] di_nlink:           0               [22] di_ixpxd.addr2:    0x00000028
[6] di_mode:            0x000081a4           di_ixpxd.address:  40
                0100644 -rw-r--r--      [24] di_uid:            0
                                        [25] di_gid:            0
[9] di_atime.tj_nsec:   0x34fce4c0      [26] di_atime.tj_sec:0x000000004963297f
[10] di_ctime.tj_nsec:  0x26aed9a8      [27] di_ctime.tj_sec:0x0000000049632991
[11] di_mtime.tj_nsec:  0x11d5fae3      [28] di_mtime.tj_sec:0x0000000049632979
[12] di_otime.tj_nsec:  0x11d5fae2      [29] di_otime.tj_sec:0x0000000049632979
[13] di_ea.flag:        0x00            [30] di_ea.len:         0
     EAv1                               [31] di_ea.addr1:       0x00
[15] di_ea.nEntry:      0x00            [32] di_ea.addr2:       0x00000000
[16] di_ea.type:        0x0000               di_ea.address:     0
                                        [34] di_ea.nblocks:     0
change_inode: [m]odify, [e]a, [t]ree, or e[x]it > m 5 1
Inode 34 at block 40, offset 0x400:

[1] di_fileset:         16              [18] di_inostamp:       0x4963295c
[2] di_number:          34              [19] di_gen:            694231676
[3] di_size:    0x000000000000001f      [20] di_ixpxd.len:      4
[4] di_nblocks: 0x0000000000000001      [21] di_ixpxd.addr1:    0x00
[5] di_nlink:           1               [22] di_ixpxd.addr2:    0x00000028
[6] di_mode:            0x000081a4           di_ixpxd.address:  40
                0100644 -rw-r--r--      [24] di_uid:            0
                                        [25] di_gid:            0
[9] di_atime.tj_nsec:   0x34fce4c0      [26] di_atime.tj_sec:0x000000004963297f
[10] di_ctime.tj_nsec:  0x26aed9a8      [27] di_ctime.tj_sec:0x0000000049632991
[11] di_mtime.tj_nsec:  0x11d5fae3      [28] di_mtime.tj_sec:0x0000000049632979
[12] di_otime.tj_nsec:  0x11d5fae2      [29] di_otime.tj_sec:0x0000000049632979
[13] di_ea.flag:        0x00            [30] di_ea.len:         0
     EAv1                               [31] di_ea.addr1:       0x00
[15] di_ea.nEntry:      0x00            [32] di_ea.addr2:       0x00000000
[16] di_ea.type:        0x0000               di_ea.address:     0
                                        [34] di_ea.nblocks:     0
change_inode: [m]odify, [e]a, [t]ree, or e[x]it > x
> q
17:58:38 ]#
17:58:49 -y /jfs2

 

The current volume is: /dev/fslv01
Primary superblock is valid.
*** Phase 1 - Initial inode scan
*** Phase 2 - Process remaining directories
*** Phase 3 - Process remaining files
*** Phase 4 - Check and repair inode allocation map
File system inode map is corrupt (FIXED)
Superblock marked dirty because repairs are about to be written.
*** Phase 5 - Check and repair block allocation map
Block allocation map is corrupt (FIXED)
Inodes not connected to the root directory
         tree have been detected.  Will reconnect.
File system is clean.
Superblock is marked dirty (FIXED)
All observed inconsistencies have been repaired.
17:59:14 /jfs2
17:59:17 /jfs2
17:59:20 -l
total 0
drwxr-xr-x   3 root     system          256 Jan 06 17:50 lost+found
17:59:21 ]#
17:59:23 *
17:59:27 . -ls
    3    1 drwxr-xr-x  3 root      system         256 Jan  6 17:50 .
   32    1 drwxr-xr-x  2 root      system         256 Jan  6 17:51 ./32
   33    1 -rw-r--r--  1 root      system          31 Jan  6 17:50 ./33
   34    1 -rw-r--r--  1 root      system          31 Jan  6 17:50 ./34

17:59:45 33
Tue Jan  6 17:50:45 BEIST 2009
17:59:49 34
Tue Jan  6 17:50:49 BEIST 2009
17:59:52 ]#


========================================================================
任何形式的转载,请写明出处:
email:
blog:    http://www.cublog.cn/u/739/
========================================================================

阅读(2814) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~