2

I have a dedicated server. I've been developing an app to handle my music collection, and I had in the past set up a backup solution for my code, but I blacklisted the /music folder . And the worst has happened, I've accidentally recursively deleted the folder using unlink and rmdir php's function. There was about 50GB of data, .mp3, .ogg and .m4a .

I know there is solutions around, like foremost, scalpel , photorec, extundelete to recover deleted data.

Mostly, my problem is that the partition where data stood /dev/sda2 is 897Gb, and the system partition is only 20Gb. I asked my system provider OVH if I can add some more space via another DD or USB drive, but it's impossible. I also asked if I can pay for a copy of the entire disk, but it's also not possible.


I'm thinking about three possible solutions:

  • Use one of the program and copy to the available space in /, and do it several times, each time I'll scp the current recovered data to another server I own.

  • Other solution would be to make an image of the partition and scp it progressively to the second server ( I really don't know if it's possible )

  • Third solution, would be to repartition the /home sda2 main partition, but I'm afraid this will corrupt / erase / overwrite the not yet recovered data.

What can I do to recover my data in this special case?

2

Use one of the program and copy to the available space in /, and do it several times, each time i 'll scp the current recovered data to another server i owe.

This might work. Though it is going to take some time.

Other solution would be to make an image of the partition and scp it progressively to the second server ( I really don't know if it's possible )

It will create a file on the server 1st so you would need the space there 1st... so no... Example of this

dd if=/dev/{partition} ibs=4096 conv=notrunc,noerror | 
(ssh {IP} dd of=/partition.img obs=4096)

Third solution, would be to repartition the /home sda2 main partition, but i'm afraid this will corrupt / erase / overwriting the data

It will.


Alternative:

Can you use sshfs? That would save your life if you can: mount the disk on your desktop, and you can use ddrescue to make an image.

7
  • The alternative solution is a fantastic idea... +1 I would use ddrescue instead of dd tough... – Fabby Oct 26 '15 at 21:43
  • You're solution looks amazing @Rinzwind ! i didn't know the existence of sshfs, thank you very much. I m going to try it tomorrow. – rubberscotch Oct 27 '15 at 16:51
  • I'm trying your solution @Rinzwind, but i get : root@123.123.123.123:/dev/sda2: Not a directory, I'm a bit lost, how can i make a disk image if i can't mount the device ? Should i mount / ? Thanks again – rubberscotch Oct 28 '15 at 9:40
  • I've just mount /, it works ... I'm in awe ! – rubberscotch Oct 28 '15 at 9:47
  • @rubberscotch cool :D Now make a backup (dd or ddrescue) of it and try to get all your stuff back. Extract your files from the backup, not the original disk. – Rinzwind Oct 28 '15 at 10:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.