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?
closed as off topic by Michael Hampton♦, ewwhite, Chris S Oct 3 '12 at 14:26
Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.
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: