Rm and linuxrm in linux
At the moment, I was negligent. I shook my hand and deleted half of the mounted F disk! Dumb !!
The deleted F disk is an NTFS partition in Windows. It is attached to the f disk in Ubuntu12.04. When using the rm command, half of the data is accidentally deleted.
The lessons of blood tell us how to useRm-rThe command must contain-IOtherwise, you will regret it!
In Linux, there is another way to restore the deleted NTFS partition file.
Address: http://www.cnblogs.com/yhLinux/p/4106099.html
After the file is accidentally deleted, do not write data to the partition! Remember.
First, let's take a look at the deleted F Disk:
$ Df-Th file system type capacity in use % available mount point/dev/sda9 ext4 35G 18G 15G 55%/udev devtmpfs 1.9G 4.0 K 1.9G 1%/devtmpfs tmpfs 384 M 936 K 383 M 1%/runnone tmpfs 5.0 M 0 5.0 M 0%/run/locknone tmpfs 1.9G 272 K 1.9G 1%/run/shm/dev/sda10 ext4 38G 5.8G 30G 17%/home/Dev/sda7Fuseblk 121G 52G 69G 43%/Media/Recreation
Second, unmount:
umount /media/Recreation
Install the ntfsprogs package:
sudo apt-get install ntfsprogs
Scan the file information that can be recovered in drive F (here, I specify to restore two important files first, these two files are relatively large, about 10 Gb ):
$ Sudo ntfsundelete/dev/sda7-S 8g-30gInode Flags % age Date Size Filename variable failed: magic: 0x00000000 size: 1024 usa_ofs: 0 usa_count: 65535: Invalid parameter ntfs_attr_find: upload upt inode (-1): Input/Output Error ntfs_attr_find: Upload upt inode (-1): Input/Output Error ntfs_attr_find: Upload upt inode (-1): Input/Output Error ntfs_attr_find: upload upt inode (-1): Input/Output Error ntfs_attr_find: Upload upt inode (-1): Input/Output Error ntfs_attr_find: Upload upt inode (-1): Input/Output Error failed: magic: 0x00000000 size: 1024 usa_ofs: 0 usa_count: 65535: Invalid parameter ....... (There are many error messages in the middle) ntfs_mst_post_read_fixup_warn: magic: 0x00000000 size: 1024 usa_ofs: 0 usa_count: 65535: The parameter ntfs_attr_find: Invalid upt inode (-1 ): input/Output Error ntfs_attr_find: Upload upt inode (-1): Input/Output Error ntfs_attr_find: Upload upt inode (-1): Input/Output Error ntfs_attr_find: Upload upt inode (-1 ): input/Output Error ntfs_attr_find: Invalid upt inode (-1): Input/Output Error ntfs_attr_find: Incorrect upt inode (-1): Input/Output Error40FN ..100%2013-10-05 10737418240FeMilm7610521FN ..100%2014-08-20 21474836480<None>FilesPotentially recoverableContent: 2
We can see that there are two files to be restored. 100% indicates that they can be completely restored! Hope!
Note that the name of the second file is<None>. A name will be provided later.
Now, we mount other NTFS partitions (Make sure there is enough space to restore the deleted files) and check:
$ Df-Th file system type capacity in use % available mount point/dev/sda9 ext4 35G 18G 15G 55%/udev devtmpfs 1.9G 4.0 K 1.9G 1%/devtmpfs tmpfs 384 M 924 K 383 M 1%/runnone tmpfs 5.0 M 0 5.0 M 0%/run/locknone tmpfs 1.9G 204 K 1.9G 1%/run/shm/dev/sda10 ext4 38G 5.8G 30G 17%/home/dev/sda5Fuseblk81G 49G 32G 62%/Media/0001_c0000e41a3/Dev/sda1Fuseblk50 GB 30G 21G 59%/Media/66A09271A0924787
Create a new folder named 21 GB in sda1 to store files.FeMilm76
Create a folder named 32 GB in sda5 to store files.<None>
$ Mkdir/media/66A09271A0924787/21g/$ ls/media/66A09271A0924787/21g/-la total usage 16drwx ------ 1 ovonel 0 Nov 18. drwx ------ 1 ovonel 16384 Nov 18 :47 ..
Everything is ready. Start:
$ sudo ntfsundelete /dev/sda7 -u -i 40 -o FeMilm76 -d /media/66A09271A0924787/21g/Inode Flags %age Date Size Filename---------------------------------------------------------------40 FN.. 0% 2013-10-05 10737418240 FeMilm76Undeleted 'FeMilm76' successfully.
A message indicating successful recovery is displayed!
Look at the Second file <none>:
$ Sudo ntfsundelete/dev/sda7-u-I 10521-o<None>-D/media/000131c%e41a3/32g/bash: none:There is no file or directory
Give a file name and replace none:
$ sudo ntfsundelete /dev/sda7 -u -i 10521 -o PaiZi -d /media/000131C0000E41A3/32g/Inode Flags %age Date Size Filename---------------------------------------------------------------10521 FN.. 0% 2014-08-20 21474836480 <none>Undeleted '(null)' successfully.
Successful!
The whole recovery time is not long and the speed is fast. Good luck to you.
(End)
References:
Https://help.ubuntu.com/community/DataRecovery
Https://help.ubuntu.com/community/DataRecovery/NtfsUndelete
Http://forum.ubuntu.org.cn/viewtopic.php? F = 122 & t = 158497 (this method is incomplete and the-o option is not specified)