Restoring data form swap partition - possible?
Good morning everyone
My problem is: during installation (bodhi linux) i’ve chosen the wrong partition for swap. Partition with 80 GB of data (real data, not games, movies…). Is there any way to restore them? At the time it is still a linux swap partition, Gparted says it is completely empty, i don't see it in linux. Didn't want to format it to ntfs (to try some windows undelete program), until i see what to do. I tried testdisk, but just like gparted it finds it, sees it as a linux swap, but no data. Even after “deeper search”. I uninstalled bodhi so it wouldn't start writing on that swap partition and currently am running windows (and slax from live CD). Any way to restore data, or are they gone forever? Thanks in advance! |
Hi, welcome to LQ!
If bodhi ran a mkswap against it (most distros will) chances are it zero'd everything out. You could try just changing the partition type to what it was before the bodhi install (that's non-destructive, it just changes a few bytes in the partition table) using slax; just switch from 82 to whatever it was, and try running testdisk again ... If that still says nuh you may be sh*t out of luck, or try an expensive professional service (the kind of people who get data off physically defunct HDDs). And this emphasises the need for back-ups, even in this day and age. Cheers, Tink |
Quote:
Your suggestion helped me google this out: http://forums.techguy.org/linux-unix...swap-file.html I'll try it in a couple of hours when i get home, and report back. |
mkswap only writes a few sectors at the front of the partition - so the majority is left untouched. Once Bohdi started it may have actually used the swap - as may any liveCD. "used the swap" in this context probably means "some (more) data lost".
You don't say what the type of filesystem was on there previously. NTFS is pretty robust if there is only minimal damage - I have also had some success with ext[34] without any external tools. Also (internal) RAID on btrfs. Depends ... A LOT. Forensic tools may work to get the majority back if you're lucky, but it's hard to have confidence in the results unless you can verify the data recovered. And it will take a similar amount of (currently free) space, and time. Maybe days. |
I tried to follow along, but can't get it. Problem is sda disk. It should have two partitions, and it did, until i ran "mkdir /mnt/sda2" when trying to mount sda5, after i ran cfdisk for the first time. Sda2?! Why don't i think before hitting enter?
Now, fdisk lists me this, looks like three partitions: Code:
root@ubuntu:/home/ubuntu# fdisk -l Code:
root@ubuntu:/home/ubuntu# mount -t ntfs /dev/sda5 /mnt/sda5 Not only that, but cfdisk still sees it as swap (and no that third phantom partition). Code:
cfdisk (util-linux 2.19.1) However, even though it says "swap" when i try to change it's type, type is 83, not 82: Code:
cfdisk (util-linux 2.19.1) Code:
cfdisk (util-linux 2.19.1) The only option, from the three bolded ones above, that i know how to do is - reboot. But that does nothing, everything just stays like it is. Fdisk says NTFS id 7, cfdisk says swap but 83. I'm running Lubuntu live CD btw. (if that has anything to do with anything, this is my first real contact with linux). This is how Partition Table Doctor in Windows saw it: http://img585.imageshack.us/img585/2082/53248956.jpg http://img713.imageshack.us/img713/5740/73288388.jpg After trying to fix it: http://img252.imageshack.us/img252/6690/56531911.jpg What can i do? Can i do anything? Thanks in advance! |
All times are GMT -5. The time now is 05:02 AM. |