[ltp] Wasted Free Space

M. Leo Cooper linux-thinkpad@www.bm-soft.com
Mon, 27 Mar 2000 22:56:12 -0700 (MST)


On Mon, 27 Mar 2000, Alex Bell wrote:

> 
> Because of mistakes I made when installing Corel Linux on my ThinkPad
> 385XD the computer has a small swap partition and about 23Mb wasted
> free space at the end of the hard drive right next to the swap
> partition.
> 
> Is there any way I can delete the swap partition so as to merge it with
> the free space, and then format the resulting free space as a swap
> partition?  I've looked at linux Fdisk and FIPS but find them hard to
> understand.  

The easiest remedy is to use 'fdisk'. You do this as root, and of course you
risk hosing your entire installation if you make a misstep.

Use the fdisk 'a' command to add a partition on the 23 megs. This new
partition will be a swap partition, or type 82. Write down the device
number (/dev/hda?) and the number of blocks (KB) for the new partition.

Now, initialize the new swap partition.
/sbin/mkswap -c /dev/hda? number-of-blocks

Finally, you'll have to modify /etc/fstab to automatically mount the
new partition at every bootup.  Just copy the line from the previous
swap partition, modifying only the device name (/dev/hda?).

The next time you boot up, you will have 2 swap partitions active (up to 8 are
permitted). The effect will be the same as a single larger one.

You do all of the above as root. Good luck!


Mendel



----- The Linux ThinkPad mailing list -----
The linux-thinkpad mailing list home page is at:
http://www.bm-soft.com/~bm/tp_mailing.html