CLI wins where PartitionMagic and QTparted failed

Bob Hemus ol.bob
Wed Jan 17 17:33:01 PST 2007


On Wed, 2007-01-17 at 14:28 -0600, C M Reinehr wrote:
> 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

It's been awhile since I did it with fdisk, but when I "fdisk"ed hdb
just now, I got this:
Disk /dev/hdb: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdb1   *           1        4519    36290835   83  Linux
/dev/hdb2            4519        4865     2787246   82  Linux swap /
Solaris

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
The start& stop numbers are there. I don't remember having to fill in
the Blocks number.  When I then installed the distro I just assigned the
Directory names, bin, etc, et cetera.
Bob




More information about the Linux-users mailing list