You are not logged in.

#1 2009-03-01 13:59:02

Lazze
Member
From: Bangkok, Thailand
Registered: 2008-09-28
Posts: 133

Help! Cleaned my partition table using fdisk

Hi

I've accidentally cleaned my partition table on my main harddrive using the fdisk o command (create a new empty DOS partition table).
The changes are written but I Haven't rebooted my computer yet so I'm still running arch on the kernels partition table.

Is there any way to undo this? My old partition table looked like this:

Device    Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       26133   209913322    b  W95 FAT32
/dev/sda3           26134       48641   180787808+   5  Extended
/dev/sda5           26134       26632     4000153+  82  Linux swap / Solaris
/dev/sda6   *       26632       26756      995998+  83  Linux
/dev/sda7           26756       30403    29294496   83  Linux
/dev/sda8           30403       48641   146497034+  83  Linux

Thanks
// Lazze

Offline

#2 2009-03-01 15:04:57

evilgold
Member
Registered: 2008-10-30
Posts: 120

Re: Help! Cleaned my partition table using fdisk

just rewrite your old partition table exaclty as you had it before and it should be fine. I had my table get messed up a couple of weeks ago (showed only one partition instead of 2), As long as you know how your table was setup you can restore it wouldnt loosing any data or anything.

Offline

#3 2009-03-01 15:46:11

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: Help! Cleaned my partition table using fdisk

Maybe testdisk can help you, if it can sort out where all your partitions are them I guess you can recover from that quite easily.
Writing it by hand (read: recreate it with fdisk) as it was before may be a little prone to a mistake but whatever gets you out of there will make you happy smile


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#4 2009-03-01 15:54:42

Lazze
Member
From: Bangkok, Thailand
Registered: 2008-09-28
Posts: 133

Re: Help! Cleaned my partition table using fdisk

Thanksfor the quick replies, I tried rewriting it but fdisk won't let me do it exactly like it was before, as you see in my first post it looked like this:

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       26133   209913322    b  W95 FAT32
/dev/sda3           26134       48641   180787808+   5  Extended
/dev/sda5           26134       26632     4000153+  82  Linux swap / Solaris
/dev/sda6   *       26632       26756      995998+  83  LinuxI guess it wont accept my current
/dev/sda7           26756       30403    29294496   83  Linux
/dev/sda8           30403       48641   146497034+  83  Linu

When rewriting it manually I can get it like this:

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       26133   209913291    7  W95 FAT32
/dev/sda3           26134       48641   180795510    5  Extended
/dev/sda5           26134       26632     4008186   82  Linux swap / Solaris
/dev/sda6   *       26633       26756      995998+  83  Linux
/dev/sda7           26757       30403    29294496   83  Linux
/dev/sda8           30404       48641   146496703+  83  Linux

If you look at /dev/sda6 for instance it starts at 26633 instead of 26632 as the old one did.
Fdisk wont allow me to start it at the same cylinder as the previous ended as fdisk shown before it was mssed up.

Any ideas why?

Offline

#5 2009-03-01 16:11:49

evilgold
Member
Registered: 2008-10-30
Posts: 120

Re: Help! Cleaned my partition table using fdisk

I dont know if it will work any differently but have you tried cfdisk instead of fdisk?

Offline

#6 2009-03-01 16:26:53

Lazze
Member
From: Bangkok, Thailand
Registered: 2008-09-28
Posts: 133

Re: Help! Cleaned my partition table using fdisk

The old partition table was created using cfdisk when I installed arch so maybe it will work better, but how can I specify size in cylinders when creating a partition in cfdisk, it ask for size in mb even if set units to cylinders.

Offline

#7 2009-03-01 17:22:44

akira86
Member
Registered: 2009-01-16
Posts: 119

Re: Help! Cleaned my partition table using fdisk

you can try to use testdisk, it can recover old partitions ...

(I have already test it and it worked..)

(you can find it in the community repo)

Last edited by akira86 (2009-03-01 17:25:05)

Offline

#8 2009-03-01 17:35:39

Lazze
Member
From: Bangkok, Thailand
Registered: 2008-09-28
Posts: 133

Re: Help! Cleaned my partition table using fdisk

I'll give testdisk a try, seems to take a while to scan all cylinders, I will return with the result.

Offline

#9 2009-03-01 18:07:16

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: Help! Cleaned my partition table using fdisk

As a last resort you can try sfdisk, its harder to use than fdisk and cfdisk but will let you do everything that you want, even the most stupid things you can think of, but in times of crisis nothing better than a program like that big_smile


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#10 2009-03-01 23:11:10

Lazze
Member
From: Bangkok, Thailand
Registered: 2008-09-28
Posts: 133

Re: Help! Cleaned my partition table using fdisk

I ended up saving my important data an reinstalling arch, after a while it seemed like the fastet way smile

Offline

Board footer

Powered by FluxBB