0

I am working in Embedded domain. While creating file system for one project i kept file system name as ~. It was write protected. Then tried to remove that whole file system by command rm -rf ~ in the directory of where file system(embedded project) is present. But, this command removed my system home directory files,Because of ~ is refers to home directory in ubuntu. It was taking more times. Then i stopped and came to know that it was deleting my system home directory files.

So, How can get all deleted files again..?? Please give me an exact solution.My system details are

Distributor ID: Ubuntu
Description:    Ubuntu 14.04.2 LTS
Release:    14.04
Codename:   trusty

I dont have any partition in HDD.i am using it as a single drive. My disk details

   *-disk                  
   description: ATA Disk
   product: ST500LM012 HN-M5
   vendor: Seagate
   physical id: 0.0.0
   bus info: scsi@0:0.0.0
   logical name: /dev/sda
   version: 2BA3
   serial: S316J90F200261
   size: 465GiB (500GB)
   capabilities: partitioned partitioned:dos
   configuration: ansiversion=5 sectorsize=512 signature=0002c421

Give me the most favorable solutions......

Anbu.Sankar
  • 103
  • 5
  • Different source of difficulty, same solution: http://askubuntu.com/questions/463076/partitions-disappeared-after-power-loss-while-installing/463094#463094 – Elder Geek Mar 25 '15 at 14:31

1 Answers1

1

Firstly you should not use OS until the files will be restored, because your data which still present in disk may be overwritten. You should use live-cd/live-usb (maybe Ubuntu DVD) for data recovery and save files on different disk. If data is really valuable you should make image your disk (byte-by-byte copy), and work with them:

dd if=/dev/sda1 of=/home/user/image.bin bs=1048576

where /dev/sda1 is partition with data, /home/user/image.bin - name example for disk image file. You should be sure that disk image file will be located in another disk or partition.

No simple ways to undelete files removed by rm if your file system is ext2/3/4.

If you filesystem in ext2/3/4, see this: https://superuser.com/questions/171673/how-to-recover-files-from-linux-ext4-harddrive

You can try extundelete: https://unix.stackexchange.com/questions/122305/undelete-a-just-deleted-file-on-ext4-with-extundelete

If this does not give the desired result you can use TestDisk: http://www.cgsecurity.org/wiki/TestDisk

  • 1
    This is a great start! Perhaps you could expand this answer by including how to make a byte by byte copy and how to work on that copy so that the inexperienced user could follow it. – Elder Geek Mar 25 '15 at 14:36