Those who are playing with fire sometimes they just get burned.
I was trying to create a backup for one of my HDD partition, some kind of partition-to-partition backup. After playing a while with dd and experimenting different CLI options I decide to try Clonezilla which basically do the same things but faster (well, there are some differences but I'm not going to get into this right now).
When you want to clone a source partition to a target destination (partition), the destination partition should be at least as large as the source partition. Clonezilla alerted me that my target partition was 4 cylinders smaller (that's about 255 x 63 x 512 x 4 bytes) than the source partition. So I decide to delete the target partition and to create it 4 cylinders larger.
Recover deleted partition
Instead of deleting the destination I've deleted the source partition ð¯
Because I had (on the screen) all the deleted partition information it was piece of cake to recover it:
In such kind of situations the simples, fastest and (I guest) safest way of recovering is the same fdisk (or parted) utility. All you have to do is to create a partition with exactly the same parameters. At prompter run the following commands:
- fdisk (run the utility)
- n (create a new partition)
- l (when asked specify the l=logical partition type; in my case it was logical, in your case could be primary, depending of your particular partitioning scheme)
- 2111 (when asked specify the starting sector of partition, as it was originally)
- 104859710 (when asked specify the ending sector of partition, as it was originally)
- w (after creating don't forget to write the new partition table to the physical disk)
That's all folks!
Note: You could also try TestDisk (I was tempted to gave it a try but in my case it was easier/faster with fdisk).
Now, if you think that this article was interesting don't forget to rate it. It shows me that you care and thus I will continue write about these things.
Latest posts by Eugen Mihailescu (see all)
- Symfony Compile Error Failed opening required Proxies - January 22, 2018
- Symfony authentication redirect after each request - January 22, 2018
- Emerging Perl without Perl in Gentoo - September 26, 2017