lunes, 21 de julio de 2014

Recuperar Datos Eliminados en AIX

Esta probado, si funciona por lo menos en AIX 7.10

Le paso la receta.

Ser_01 / #df     
Filesystem    512-blocks      Free %Used    Iused %Iused Mounted on
/dev/hd4         2097152    566624   73%    10738    15% /
/dev/hd2        14680064   6688552   55%    57845     8% /usr
/dev/hd9var      2097152    939816   56%     3572     4% /var
/dev/hd3         4194304    649736   85%      282     1% /tmp
/dev/hd1          131072    123664    6%      163     2% /home
/dev/hd11admin     131072    130328    1%        7     1% /admin
/proc                  -         -    -         -     -  /proc
/dev/hd10opt      917504    530912   43%     7095    11% /opt
/dev/fslv04    167772160  58539504   66%        5     1% /unidad_prueba
Ser_01 / #cd /unidad_prueba
Ser_01 /unidad_prueba #ls
ARCHIVOPARA.BORRAR.dmp  lost+found

Ser_01 /unidad_prueba #ls -ltr
total 109206376
drwxr-xr-x    2 root     system          256 Jan 30 15:59 lost+found
-rw-r--r--    1 oracle   oinstall 55913664512 Jul 14 17:49 ARCHIVOPARA.BORRAR.dmp
Ser_01 /unidad_prueba #
Ser_01 /unidad_prueba #ls -id /unidad_prueba
    2 /unidad_prueba
Ser_01 /unidad_prueba #ls -ilt
total 109206376
    5 -rw-r--r--    1 oracle   oinstall 55913664512 Jul 14 17:49 ARCHIVOPARA.BORRAR.dmp //anotar el numero 5 id del archivo
    3 drwxr-xr-x    2 root     system          256 Jan 30 15:59 lost+found
Ser_01 /unidad_prueba #
Ser_01 /unidad_prueba #rm ARCHIVOPARA.BORRAR.dmp  // aqui es borrado
Ser_01 /unidad_prueba #cd           
Ser_01 / #umount /unidad_prueba
Ser_01 / #df
Filesystem    512-blocks      Free %Used    Iused %Iused Mounted on
/dev/hd4         2097152    566584   73%    10738    15% /
/dev/hd2        14680064   6688552   55%    57845     8% /usr
/dev/hd9var      2097152    939800   56%     3572     4% /var
/dev/hd3         4194304    649736   85%      282     1% /tmp
/dev/hd1          131072    123664    6%      163     2% /home
/dev/hd11admin     131072    130328    1%        7     1% /admin
/proc                  -         -    -         -     -  /proc
/dev/hd10opt      917504    530912   43%     7095    11% /opt
Ser_01 / #fsdb /dev/fslv04

File System:                    /dev/fslv04

File System Size:               167766632       (512 byte blocks)
Aggregate Block Size:           4096
Allocation Group Size:          262144  (aggregate blocks)

> dir 2
 idotdot = 2

 3      lost+found
> i 5                // el numero que anotamos 5
Inode 5 at block 2587, offset 0xa00:

[1] di_fileset:         16              [18] di_inostamp:       0x52eaaf0b
[2] di_number:          5               [19] di_gen:            2885078955
[3] di_size:    0x0000000d04b6d000      [20] di_ixpxd.len:      4
[4] di_nblocks: 0x0000000000d04b6d      [21] di_ixpxd.addr1:    0x00
[5] di_nlink:           0               [22] di_ixpxd.addr2:    0x00000a1b
[6] di_mode:            0x000081a4           di_ixpxd.address:  2587
                0100644 -rw-r--r--      [24] di_uid:            203
                                        [25] di_gid:            203
[9] di_atime.tj_nsec:   0x3155d248      [26] di_atime.tj_sec:0x0000000053c49b66
[10] di_ctime.tj_nsec:  0x2a6c4fa5      [27] di_ctime.tj_sec:0x0000000053cd6ec6
[11] di_mtime.tj_nsec:  0x352b4fdb      [28] di_mtime.tj_sec:0x0000000053c45071
[12] di_otime.tj_nsec:  0x1a363f6a      [29] di_otime.tj_sec:0x0000000053c44bb0
[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       //modificamos
Please enter: field-number value > 5 1           // el campo 5 modificamos a 1
Inode 5 at block 2587, offset 0xa00:

[1] di_fileset:         16              [18] di_inostamp:       0x52eaaf0b
[2] di_number:          5               [19] di_gen:            2885078955
[3] di_size:    0x0000000d04b6d000      [20] di_ixpxd.len:      4
[4] di_nblocks: 0x0000000000d04b6d      [21] di_ixpxd.addr1:    0x00
[5] di_nlink:           1               [22] di_ixpxd.addr2:    0x00000a1b
[6] di_mode:            0x000081a4           di_ixpxd.address:  2587
                0100644 -rw-r--r--      [24] di_uid:            203
                                        [25] di_gid:            203
[9] di_atime.tj_nsec:   0x3155d248      [26] di_atime.tj_sec:0x0000000053c49b66
[10] di_ctime.tj_nsec:  0x2a6c4fa5      [27] di_ctime.tj_sec:0x0000000053cd6ec6
[11] di_mtime.tj_nsec:  0x352b4fdb      [28] di_mtime.tj_sec:0x0000000053c45071
[12] di_otime.tj_nsec:  0x1a363f6a      [29] di_otime.tj_sec:0x0000000053c44bb0
[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
> quit
Ser_01 / #fsck -yp /dev/fslv04

The current volume is: /dev/fslv04
Primary superblock is valid.
J2_LOGREDO:log redo processing for /dev/fslv04                     
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.
Ser_01 / #mount /unidad_prueba
Ser_01 / #lsvg -l unidad_pruebavg
unidad_pruebavg:
LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
loglv04             jfs2log    1       1       1    open/syncd    N/A
fslv04              jfs2       640     640     1    open/syncd    /unidad_prueba
Ser_01 / #df
Filesystem    512-blocks      Free %Used    Iused %Iused Mounted on
/dev/hd4         2097152    566536   73%    10738    15% /
/dev/hd2        14680064   6688552   55%    57845     8% /usr
/dev/hd9var      2097152    939800   56%     3572     4% /var
/dev/hd3         4194304    649736   85%      282     1% /tmp
/dev/hd1          131072    123664    6%      163     2% /home
/dev/hd11admin     131072    130328    1%        7     1% /admin
/proc                  -         -    -         -     -  /proc
/dev/hd10opt      917504    530912   43%     7095    11% /opt
/dev/fslv04    167772160  58539504   66%        5     1% /unidad_prueba
Ser_01 / #cd /unidad_prueba
Ser_01 /unidad_prueba #ls                //parece que no hay archivo
lost+found
Ser_01 /unidad_prueba #cd lost+found     //ingresarmos a esta carpeta
Ser_01 /unidad_prueba/lost+found #ls
5                                     //dentro ay un archivo con nombre 5
Ser_01 /unidad_prueba/lost+found #ls -ltr
total 109206376
-rw-r--r--    1 oracle   oinstall 55913664512 Jul 14 17:49 5    //si!!! es el nuestro archivo
Ser_01 /unidad_prueba/lost+found #mv 5 /unidad_prueba/ARCHIVOPARA.BORRAR.dmp  // lo renombramos
Ser_01 /unidad_prueba/lost+found #cd ..
Ser_01 /unidad_prueba #ls
ARCHIVOPARA.BORRAR.dmp  lost+found 
Ser_01 /unidad_prueba #ls -ltr
total 109206376
-rw-r--r--    1 oracle   oinstall 55913664512 Jul 14 17:49 ARCHIVOPARA.BORRAR.dmp   //ahi esta.
drwxr-xr-x    2 root     system          256 Jul 21 15:59 lost+found
Ser_01 /unidad_prueba #

Salu2.