首页 电脑 电脑学堂 查看内容

testdisk恢复删除的分区

2013-9-25 14:32 679 0

摘要:  1.为了顺利安装testdisk 工具,安装开发四个组包(正确的配制yum)。yum groupinstall " Development ...
关键词: nbsp partition testdisk Development 分区表 localhost Disk Linux Software groupinstall

 1.为了顺利安装testdisk 工具,安装开发四个组包(正确的配制yum)。yum groupinstall " Development Libraries " -y,注意一定要加引号。yum groupinstall " Development Tools " -yyum groupinstall " Legacy Software Development " -yyum groupinstall " X Software Development "  -y注:对应成中文就是:Development Libraries 开发库; Development Tools 开发工具;Legacy Software Development 老的软件开发; X Software Development X软件开发;查看分区表。发现少了一个主分区。2.安装testdisk[root@localhost ~]# tar -jxvf testdisk-6.8.tar.bz2 [root@localhost ~]# cd testdisk-6.83.查看configure帮助[root@localhost testdisk-6.8]# ./configure --help |less预编译。     [root@localhost testdisk-6.8]# ./configure   --prefix=/usr/local/sbin   //指明安装路径。4.编译。产生头文件,库文件,可执行文件,说明文件。[root@localhost testdisk-6.8]# make && make install启动 testdisk: [root@localhost sbin]# lsman  photorec  sbin  share  testdisk  testdisk.log[root@localhost sbin]# ./testdisk第一页屏幕要求选择如何处理记录信息 第二页要求选择磁盘:   TestDisk is free software, andcomes with ABSOLUTELY NO WARRANTY.Select a media (use Arrow keys, then press Enter):Disk /dev/hdc - 3005 MB / 2866 MiB (RO)Disk /dev/sda - 21 GB / 19 GiB[Proceed ]  [  Quit  ]第三页选择分区表类型,一般都是 Intel/PC: Disk /dev/sda - 21 GB / 19 GiBPlease select the partition table type, press Enter when done.[Intel  ]  Intel/PC partition[Mac    ]  Apple partition map[None   ]  Non partitioned media[Sun    ]  Sun Solaris partition[XBox   ]  XBox partition[Return ]  Return to disk selectionNote: Do NOT select 'None' for media with only a single partition. It's veryrare for a drive to be 'N现在可以 Analyse (分析)了: Disk /dev/sda - 21 GB / 19 GiB - CHS 2610 255 63[ Analyse  ]  Analyse current partition structure and search for lost partitions[ Advanced ]  Filesystem Utils[ Geometry ]  Change disk geometry[ Options  ]  Modify options[ MBR Code ]  Write TestDisk MBR code to first sector[ Delete   ]  Delete all data in the partition table[ Quit     ]  Return to disk selectionNote: Correct disk geometry is required for a successful recovery. 'Analyse'process may give some warnings if it thinks the logical geometry is mismatched.列出现有的分区表内容,并提示继续还是备份,这里只有一个分区,实际上另外一个 Linux 分区被删了...所以 1661 之前那些空间就是寻找的目标: Disk /dev/sda - 21 GB / 19 GiB - CHS 2610 255 63Current partition structure:     Partition                  Start        End    Size in sectors 1 * Linux                    0   1  1   130 254 63    2104452 [/boot] 3 P Linux Swap            1661   0  1  1791 254 63    2104515Should TestDisk search for partition created under Vista ? [Y/N] (answer Yes ifunsure)yDisk /dev/sda - 21 GB / 20 GiB - CHS 2611 255 63     Partition               Start        End    Size in sectors* Linux                    0   1  1   130 254 63    2104452 [/boot]P Linux                  131   0  1  1660 254 63   24579450 [/]P Linux Swap            1661   0  1  1791 254 63    2104515Structure: Ok.  Use Up/Down Arrow keys to select partition.Use Left/Right Arrow keys to CHANGE partition characteristics:*=Primary bootable  P=Primary  L=Logical  E=Extended  D=DeletedKeys A: add partition, L: load backup, T: change type, P: list files,     Enter: to continueEXT3 Large file Sparse superblock Recover, 1077 MB / 1027 MiB*=Primary bootable  P=Primary  L=Logical  E=Extended  D=Deleted[Proceed ]  [ Backup ]使用左右方向键将其调整成以前的状态 P(主分区),然后 Enter 继续: Disk /dev/sda - 21 GB / 20 GiB - CHS 2611 255 63     Partition                  Start        End    Size in sectors 1 * Linux                    0   1  1   130 254 63    2104452 [/boot] 2 P Linux                  131   0  1  1660 254 63   24579450 [/] 3 P Linux Swap            1661   0  1  1791 254 63    2104515[  Quit  ]  [Search! ]  [ Write  ]                       Write partition structure to disk选择 Write 保存 Write partition table, confirm ? (Y/N)Y 退出,reboot  
声明:文章版权归原作者所有 部分文章转自互联网 如有侵权请联系 [邮箱地址] 删除

路过

雷人

握手

鲜花

鸡蛋

最新评论

返回顶部