找回密码
 注册
搜索
热搜: 回贴
微赢网络技术论坛 门户 服务器 Linux/BSD 查看内容

在Ubuntu中恢复NTFS分区中被ubuntu误删除的文件

2009-12-20 13:44| 发布者: admin| 查看: 85| 评论: 0|原作者: 韩菱纱



(转载自ubuntu中文社区
http://forum.ubuntu.org.cn/viewtopic.php?f=122&t=158497

严重提示:请非常谨慎执行本文操作,操作前备份有用重要文件,出现问题请快回帖或向版主举报,以警示后人,切记切记。

前已经发了一个叫做
《[教学]使用ext3grep恢复ext3文件系统中误删除文件(我在ubuntu中恢复文件的心得)》,说明了我最近老是误删文件。ext3文件系统
还好说,再怎么说也是重要的开源文件系统,还是有几篇误删文件恢复的参考的文章,NTFS文件系统就更郁闷了。
咳,双系统,前几天在ubuntu下不小心删除了NTFS分区中文件,
这是我自己使用linux系统以来好多问题的解决方法,太重要了,因为我也没记住那么多命令,都存在这个文本文件中阿。居然误删那,马上去回收站找,据然
没有,去lost+found里找,也没有。于是想到在windows时,是可以去那个分区的$Recycle.Bin文件夹里找删除文件的,可是也许
ubuntu删除NTFS文件系统中文件的方法和我windows删除文件的方法不一样吧,愣是找不到。超级郁闷。
中途还去
ubuntu官方英文论坛发了个贴求助,只有一人回了说用recuva(windows下恢复软件),试试,还是没有恢复我的文件
阿,easyrecovery,winhex也都试过,无效。继续我的搜索,gg,百度把,中文,英文关键词全用上。还真被找到了类似文章。在
ubuntu wiki中的(文献1)
http://wiki.ubuntu.org.cn/index.php?title=UbuntuHelp:DataRecovery/zh&diff=prev&oldid=76543
说了好多数据恢复的方法,(注意其中有错误)还有(文献2)
http://www.linux-ntfs.org/doku.php?id=ntfsprogs
和(文献3)
http://www.linuxsir.org/bbs/printthread.php?p=1466533
就这三篇东西讲了在linux下恢复NTFS误删文件。
下面记下我恢复在ubuntu下误删NTFS文件系统中一个文件的方法。对大家绝对有用,因为貌似网络上中文的只有文献1中说到用ntfsprogs文件恢复软件恢复在ubuntu下误删NTFS文件系统中一个文件的方法(而且包含错误!)。所以写下本文为大家服务。
0。先让大家看一下我的分区情况(代码:df -h查看):
Filesystem Size Used Avail Use% Mounted on
...
...
/dev/sda5 206M 59M 136M 31% /boot
/dev/sda7 19G 15G 3.5G 81% /home
/dev/sda1 31G 17G 15G 53% /home/hp/Windows/C
/dev/sda2 35G 26G 9.7G 73% /home/hp/Windows/D
/dev/sda3 28G 3.2G 25G 12% /home/hp/Windows/E 这里就是我误删文件的分区
1。安装ntfsprogs包
代码:代码:sudo apt-get install ntfsprogs
2。卸载误删文件的NTFS分区
代码: 代码:umount /home/hp/Windows/E
3.查看我最近五天删除的文件
代码:代码:ntfsundelete /dev/sda3 -t 5d
出现提示
Error: Volume name could not be converted to current locale: Invalid or incomplete multibyte or wide character.
Inode Flags %age Date Size Filename
---------------------------------------------------------------
10869 FR.. 100% 2008-10-22 24
10870 D... 0% 2008-10-22 0
10900 FN.. 100% 2008-10-19 35534
10901 FN.. 100% 2008-10-19 4253501
12866 D... 0% 2008-10-19 0
12872 D... 0% 2008-10-19 0
12880 FN.. 100% 2008-10-19 27612
12881 FR.. 100% 2008-10-19 78
Files with potentially recoverable content: 5
注意:上面说明我有5个删除文件还可以恢复,观察删除日期和大小,发现Inode为10900的那个就是我不小心删除的文件拉。兴奋起来
4。最后一步,恢复文件
代码:代码:ntfsundelete /dev/sda3 -u -i 10900 -d /home/hp/cd
他提示
Error: Volume name could not be converted to current locale: Invalid or incomplete multibyte or wide character.
Inode Flags %age Date Size Filename
---------------------------------------------------------------
10900 FN.. 0% 2008-10-19 35534
Undeleted '(null)' successfully.

screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://forum.ubuntu.org.cn/images/smilies/em05.gif');}" onmousewheel="return imgzoom(this);" alt="" />

这样我的文件就恢复到/home/hp/cd文件夹下了,名字为unknown
----------------------------------------
用gedit打不开,换vim,打开了,但是是乱马,删除了最后段一些奇怪的@@@@@@@@@,保存,再用gedit居然能打开了,而且东西大部分都在,,耶,成功。菜鸟成功都很兴奋,见谅

外提示中Error: Volume name could not be converted to current locale:
Invalid or incomplete multibyte or wide character.不知什么意思,反正文件恢复过来了,不管他了。
http://wiki.ubuntu.org.cn/index.php?title=UbuntuHelp:DataRecovery/zh&diff=prev&oldid=76543
说的其中有一个错误。就是如下恢复命令
ntfsundelete /dev/sda3 -u -i 10901 -d /home/hp/cd
要加 -i 参数的,他没写上,害的我经过无数次失败后找到man,man真是最好的好老师,就是说英语。
{刚才我去wiki改了他,
screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://forum.ubuntu.org.cn/images/smilies/em06.gif');}" onmousewheel="return imgzoom(this);" alt="" />
怎么是不是什么人都可以改的马?奇怪}
ntfsprogs介绍与下载(英语):
http://www.linux-ntfs.org/doku.php?id=ntfsprogs
用ntfsprogs备份NTFS分区:
http://www.linuxsir.org/bbs/printthread.php?p=1466533
linux中文件恢复相关wiki:
http://wiki.ubuntu.org.cn/index.php?title=UbuntuHelp:DataRecovery/zh&diff=prev&oldid=76543














最新评论

QQ|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )

GMT+8, 2024-9-30 07:27 , Processed in 0.162700 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

返回顶部