[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Swap partition and fdisk



Hi --
You said:
> Currently, I have a DOS partition that takes up 25% of the
> total disk space and the rest is empty. My concern was if I would lose
> any data on the DOS partition if I create two Linux partitions using
> Linux fdisk on the empty disk space. 

I suppose the installation notes are conservative because
cfdisk is not too forgiving if you incorrectly set your disk partition
table and then write the new table to disk.  But note that you have
to do two things wrong in order to mess yourself up with cfdisk.
First you have to set up a bad partition table, then you have to
write that to disk.

It sounds like you have one entry in your disk partition table now.
It probably looks something like this:
/dev/hda1   Boot          Primary        DOS 16-bit >=32Mb           200.52

Just move your cursor down one line (so that it is NOT highlighting the
line where DOS is), then select the option [New] by pressing your
right arrow key until [New] is highlighted.  Hit CR.  Then specify how much
space you want for your new partition.  When you are asked whether you
want to put that partition at the beginning (meaning, at the beginning
of the existing unpartitioned space), just say yes.  The revised
partition table will then be presented to you.  It should show DOS
in the same place it was.  Do the same thing for 1 more partition.
Then change the type of that partition to a Linux swap by using the right
arrow key again to highlight the word [Type], then answering the prompt
by giving the number 82, which is the value for a linux swap partition.
Again, you'll see the revised partition table.  Still, nothing has
happened to your disk.  Only if and when you use the right arrow key
to highlight the [Write] button, and then hit the [ENTER] key, will
you have written your new partition table to disk.

One thing you might do before starting (and this is a good idea anyway)
is to keep a record of your existing disk partition.
You can do this with this command:

cfdisk /dev/hda -P t > part_hda.tbl

or, if you want to keep a record of the partition table using the
sector format, use:

cfdisk /dev/hda -P s > part_hda.sec

(I'm assuming the disk you're working on is the master on your primary
IDE controller.  If not, adjust hda to the appropriate value.)

HTH,
Susan Kleinmann



Reply to: