[clug] Re: cfdisk

Algis Kabaila akabaila at pcug.org.au
Sun Jul 1 02:00:56 GMT 2007


First and foremost, "thank you" to all, who patiently followed this thread, 
but particularly to Stephen Rothwell and Rod Peters, who bothered to reply.  
I asked a question about cfdisk in a desperate situation: I had wiped out the 
MBR, including the partition table for all my 15 partitions on a new amd 64 
bit PC.  I did that by trying to assign label names to some partitions and 
managed to assign 'disk label', which is another name for partition table 

However, the biggest "Thank You" goes to Rainer Klein, who throughout my 
ordeal insisted that the partitions could be recovered, as long as I did not 
attempt to write anything on the disk with lost partition table.  He also 
persistently sent me more URL's for better information.  

All partitions, 1 to 15, were successfully recovered and the data has is now 
backed up.  Where was it? Partition 15, of course - the only law that allways 
works is Murphy's law!

cfdisk was useful, particularly when used to print out sector list with

cfdisk -Ps /dev/sda

but in the end it was "parted" that was used to recover the partitions.  As a 
first step on Rainer's suggestion I scanned the hard disk, having booted on 

gpart /dev/sda

That gave a list of all suspected partition locations in long mb's (1024*1024 
bytes each "long mb").

 Then the "parted" interactive environment was invoked by for the PC booted 
with the gparted CD, with the following command:

parted -i  /dev/sda

whereupon it responded with a prompt


Commands entered at that stage were of a "sudden death"  nature. Some 
experimentation was required to determine that "parted" used short mb (1 000 
000 bytes) for input/output.  The main command was "rescue", to which 
the "parted" asked for the approximate start of the partition and approximate 
end. It then located the partition and asked if the information was to be 
added to the partition table.  On answering "y" it did add the info to the 
table. In this manner all partitions, 1..3 and 5..15 were recovered, 
including kubuntu, which worked pretty well as if nothing had happened.

Thank you all once more for helping this old newbie to get out of the hole!


On Thursday 28 June 2007 22:00:27 Rod Peters wrote:
> Date: Wed, 27 Jun 2007 22:49:36 +1000
> From: Rodney Peters <rodneyp at pcug.org.au>
> Subject: [clug] Re: cfdisk
> To: linux at lists.samba.org
> Message-ID: <200706272249.36643.rodneyp at pcug.org.au>
> Content-Type: text/plain;  charset="utf-8"
> Al,
> The "subtle" way is called hacking.  Partitions on large disks are
> allocated in increments of about 7.8 MB.  So guess the size in MB then
> change units display to sectors.  If the number of sectors in the "new"
> partition does not match that of the lost partition then "delete" the "new"
> partition and try again with an amended number of MB.
> cfdisk & parted may define "MB" differently.  Try to use what was
> originally used to partition the disk.
> Rod
Algis Kabaila (Dr)

More information about the linux mailing list