LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Resizing Linux Partition (https://www.linuxquestions.org/questions/linux-newbie-8/resizing-linux-partition-336920/)

the99ebookstore 06-24-2005 07:01 PM

Resizing Linux Partition
 
I have dual operating system, Windows XP and Suse Linux 9.1. As of now, I got 14 GB partitioned to my Windows, 15 GB for my Linux and 1 Gb for swap space. M quesetion is, How do I resize the partition so that I could have 20 GB for my windows and only 9 GB for Linux? Also, is it okay to decrease the partition for my swap space?

rjlee 06-24-2005 07:23 PM

For resizing partitions, look at gnuparted or commercial software like PartitionMagic. This is not a simple process because the filesystems on the partitions that you are trying to resize weren't ever designed to be resized. However, software tends to do a good job of this these days (though it's a good idea to take a backup first anyway).

Changing swap space is a more difficult question.

Under Linux, swap space is used for two reasons. The first use is to store data that doesn't fit in RAM (effectively giving you more memory), and the second, less common, use is to store data that won't be used for a long time, to make more free RAM available for disk and I/O caching.

The amount of swap that you need is equal to the maximum amount of memory that you might be using instantaneously, minus the amount of physical RAM that you have. This can be difficult to determine, but typically having more swap is good because it either makes things marginally faster or stops programs from crashing with out of memory errors.

You can see the amount of memory that you are using (swap and RAM) at any point in time in /proc/meminfo.

You could always turn swap off
Code:

swapoff -a
and see if it makes any noticable effect on your system, before messing with the swap partition. You can also use a swap file
Code:

dd if=/dev/zero of=/swapfile; mkswapfs /swapfile bs=1024 count=size_in_kb && mkswap /swapfile
You will also need to add the swap file to /etc/fstab in this case.

nevarlen 06-24-2005 07:31 PM

First, whatever I am about to write depends on how your partitions are setup..

You can decrease your swap partition space but you may experience reduced performance..But usually twice the size of ram is okay..I have some units running with no swap partition, it does not seem to effect the performance much, then again those units are not production servers...
Partitioning the drives, I suggest you resize your linux partition with something like qparted while RUNNING linux (do not do this from windows, it may corrupt your data). When you reduce the partition size, you will have some space freed, go into windows and use something like partition magic (this is not free) or some other choice of free partitioning tool (maybe dos based) to convert this newly freed space. Reboot, and merge your windows partition with the one you have just created.

bp12345 06-27-2005 03:55 AM

Using a live CD (MEPIS works well; it has QTParted) to resize partitions is a good idea because you can get problems when resizing a mounted partition. (I have tried this and I had to reinstall Debian). You can also check the filesystems from the live CD both before and after you resize it to make sure everything works right.
I have 512 MB of RAM and use about 520 MB Swap. It works fime. I have tried increasing it and there is no performance increase, but having less makes it somewhat slower. I'd reccomend the same amount as you have RAM, perhaps more if you have under 256MB.


All times are GMT -5. The time now is 01:06 AM.