How to recover a deleted file in linux ?
Answers were Sorted based on User's Feedback
Answer / senthil
Determine the partition in which the file you wish to
recover was located by using the command pwd (present work
directory)
and unmount the current directory by using the command
umount. Use the "debugfs" command. The "debugfs" command is
used to handle most major errors and bugs that can occur in
Linux by using #debugfs /usr/directory name.Use the "lsdel"
once you have begun the debug of the file system.Recover
those files you wish to undelete and take backup of that file.
| Is This Answer Correct ? | 6 Yes | 4 No |
Answer / sureshkumar
Photorec is data recovery tool. using this tool you can
recovery files from your hard dsik.it's running in the
console mode...
| Is This Answer Correct ? | 2 Yes | 0 No |
single user mode
#init 1
#grep -b 'search-text' /dev/partition > file.txt
To recover text file starting with "nixCraft" word on
/dev/sda1 you can try following command:
# grep -i -a -B10 -A100 'nixCraft' /dev/sda1 > file.txt
Next use vi to see file.txt. This method is ONLY useful if
deleted file is text file. If you are using ext2 file
system, try out recover command. .
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / prakash
Determine the partition in which the file you wish to
recover was located by using the command pwd (present work
directory)
and unmount the current directory by using the command
umount. Use the "debugfs" command. The "debugfs" command is
used to handle most major errors and bugs that can occur in
Linux by using #debugfs /usr/directory name.Use the "lsdel"
once you have begun the debug of the file system.Recover
those files you wish to undelete and take backup of that file.
Note- all the right but when my directory use to web server
and running some live domain and site then do's not umount
possible
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / suri
Determine the partition in which the file you wish to
recover was located by using the command pwd (present work
directory)
and unmount the current directory by using the command
umount. Use the "debugfs" command. The "debugfs" command is
used to handle most major errors and bugs that can occur in
Linux by using #debugfs /usr/directory name.Use the "lsdel"
once you have begun the debug of the file system.Recover
those files you wish to undelete and take backup of that file
| Is This Answer Correct ? | 4 Yes | 4 No |
what is difference between TFTP abd FTP?
how can i make an user to nologin without locking the account for the user
Through ssh whole directory structure from / is shared regardless the user we have connected with ....... how do i prevent sharing ??
How to check all open ports on linux machine and block unsed ports????????
Which directory is closer to the top of the file system tree, parent directory or current directory?
How does the boot process[init levels] work on Linux? How is it different from Solaris?
i installed clustering packages.When i try to run it getting LUCI error...what is it..??
What is the complete name of the default configuration file for LILO?
Tell me command which is use for create quota database in Linux.
What file should you examine to determine the defined runlevels for your system?
what is kernel panic error ? how will you fix it if you have face it after rebooting without the the help of rescue disk ?
Give a Linux shell command to find all files in a directory which contain ip addresses.