CLI wins where PartitionMagic and QTparted failed

C M Reinehr cmr
Wed Jan 17 12:28:32 PST 2007


On Wednesday 17 January 2007 13:55, Bob Hemus wrote:
> On Wed, 2007-01-17 at 11:46 -0600, C M Reinehr wrote:
> > On Wednesday 17 January 2007 11:20, Matthew Carpenter wrote:
>
> <snip>
>
> > You've really got to admire someone brave enough to edit their partition
> > table manually! ;-)
> >
> > cmr
>
> Am I kinda dumb, is there another way?  Or do you mean let it do it in
> one partition plus swap?
> Bob

Using fdisk, cfdisk, etc. allows you to indicate your desired partitions, but 
the program does the actual block counting and writing. Using sfdisk in the 
manner described allows you to manually edit the block numbers and and 
partition types yourself. For example, on my system the output of 
sfdisk -d /dev/sda > sda.out is:

# partition table of /dev/sda
unit: sectors

/dev/sda1 : start=       63, size=   979902, Id=fd
/dev/sda2 : start=   979965, size=292061700, Id=fd
/dev/sda3 : start=        0, size=        0, Id= 0
/dev/sda4 : start=        0, size=        0, Id= 0

Matthew then edited this text file to suit his needs and reversed the process:

sfdisk < sda.out

You don't want to miscount or you will clobber your file system.

Cheers!

cmr

-- 
Debian 'Etch' - Registered Linux User #241964
--------
"More laws, less justice." -- Marcus Tullius Ciceroca, 42 BC



More information about the Linux-users mailing list