对于linux的用户来说,不小心删除了文件系统是一件很苦恼的事情,当文件被删除时我们怎样才能恢复呢?很多情况下是无法恢复的,但是我们可以通过其他方法去恢复被删除文件,现在我们去看看恢复linux文件系统的方法。旗胜站长目录
[root@woody root]# fdisk -l devhda
disk devhda: 5368 mb, 5368709120 bytes
255 heads, 63 sectorstrack, 652 cylinders
units = cylinders of 16065 * 512 = 8225280 bytes
device boot start end blocks id system
devhda1 * 1 13 104391 83 linux
devhda2 14 523 4096575 83 linux
devhda3 524 588 522112+ 82 linux swap
devhda4 589 652 514080 5 extended
devhda5 589 652 514048+ 83 linux
[root@woody root]# mount
devhda2 ontype ext3 (rw)
none on proc type proc (rw)
usbdevfs on procbususb type usbdevfs (rw)
devhda1 on boot type ext3 (rw)
none on devpts type devpts (rw,gid=5,mode=620)
devhda5 on home type ext3 (rw)
none on devshm type tmpfs (rw)
先删除boot分区试着恢复一下
[root@woody root]# fdisk devhda
command (m for help): p
disk devhda: 5368 mb, 5368709120 bytes
255 heads, 63 sectorstrack, 652 cylinders
units = cylinders of 16065 * 512 = 8225280 bytes
device boot start end blocks id system
devhda1 * 1 13 104391 83 linux
devhda2 14 523 4096575 83 linux
devhda3 524 588 522112+ 82 linux swap
devhda4 589 652 514080 5 extended
devhda5 589 652 514048+ 83 linux
command (m for help): d
partition number (1-5): 1
command (m for help): w
the partition table has been altered!
calling ioctl() to re-read partition table.
warning: re-reading the partition table failed with error 16: device or resource busy.
the kernel still uses the old table.
the new table will be used at the next reboot.
syncing disks.
reboot
没有找到boot分区直接进入grub界面中
这时候放入第一张安装光盘进入rescue模式,新建一个boot分区,然后重启就可以了。
在 windows 系统中回收站中保存了最近使用资源管理器时删除的文件,因此我们可以利用上面介绍的工具去恢复这些已经删除的文件。