-1

I got a panicked call for help from a mate who's been tinkering with a Raspberry Pi. Turns out it auto-updated his install of Raspbmc (RPi-build Debian with XBMC over the top, for non-RPi-fanatics) when he turned it on, and it wasn't until it'd finished that he realised he'd left his external hard drive plugged into it. He didn't think much of it at the time, not knowing (as most sysadmins should) that drives left connected during a Linux OS install are liable to be overwritten with the distro's filesystem. When the drive wouldn't read, he called his technically-minded friend... me. I'm not much of a Linux user, though (I dabble, but nothing advanced) and this is a little beyond my experience. Can anything be done, or is his data lost?

  • 1
    Well, this happens with _Debian_ installs, anyway. It is by no means a Linux thing. – Michael Hampton Oct 03 '12 at 13:22
  • possible duplicate of [Recover overwritten filesystem](http://serverfault.com/questions/209396/recover-overwritten-filesystem) – Michael Hampton Oct 03 '12 at 13:26
  • While Michael's suggestion may help, this question is essentially Off-Topic for [SF] as we only work with Professional System Administrators in the course of their Job. If you need more help with this than the Answer below, please take a look at [unix.se]. Thank you! – Chris S Oct 03 '12 at 14:27

1 Answers1

4

It would be difficult to recover as any automated recovery will discover the new fs. However the data is there and because ext4 is using extents the data of the same file would tend to be in the same extent.

I would first make an image of the drive and use a VM that will mount that image with discard option (when you shutdown the VM the image will remain unchanged). Recover to a network drive, FTP... You will need some infrastructure for all of this, but is the safest way.

Some tools to consider:

See also: https://android.stackexchange.com/questions/7069/data-recovery-how-to-restore-deleted-formatted-files-on-hd-micro-sd-card/7072#7072

Mircea Vutcovici
  • 16,706
  • 4
  • 52
  • 80