(Re)partitioning advice needed
It started out with a missing swap partition, which I've come to understand that I dearly need/want. I was never asked/urged to make one when I installed, but I've experienced so many freezes, especially when using gimp and the likes (I tend to keep many programs running at the same time), that I think I need one, even though I have 512Mb RAM, which I've frequently seen being said to be enough.
So I fired up Qtparted from a liveCD and tried to shrink one of the existing partitions to make room for a 512Mb swap partition, but nothing worked. Here's my (current) partition table, from fdisk:
This is after an attempt to shrink the NTFS partition to make room for a new one, which resulted in the following table, from cfdisk:
Disk /dev/hda: 40.0 GB, 40007761920 bytes
255 heads, 63 sectors/track, 4864 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 2295 18434556 7 HPFS/NTFS
/dev/hda2 2698 3082 3092512+ b W95 FAT32
/dev/hda3 3083 3973 7156957+ 83 Linux
/dev/hda4 3974 4864 7156957+ 83 Linux
Three Gb of unusable space -- that hurts...
Disk Drive: /dev/hda
Size: 40007761920 bytes, 40.0 GB
Heads: 255 Sectors per Track: 63 Cylinders: 4864
Name Flags Part Type FS Type [Label] Size (MB)
hda1 Boot Primary NTFS  18877.02
hda2 Primary W95 FAT32 3166.74
hda3 Primary Linux ext3 7328.73
hda4 Primary Linux ext3 7328.73
I've now found out that the reason I can't make a swap partition, ot use those 3 Gb, is that all my partitions are primary, and that there is only room for four, so my only option is to repartition completely. I want to take the opportunity to remake my partitions from scratch. This is what I want:
a) shrink hda1 to the minimum, i.e. the OS and the program files, and move all the user files to the fat32-partition (hda2). This should leave this partition with c. 12 Gb
b) grow hda2 to make room for all the files that I want to use under both OSs: c. 9 Gb.
c) make a swap partition - 0.5 Gb should be enough, am I right?
d) the two linux partitions - hda3=/ and hda4=/home - could stay the way they are, I guess.
d) make a new partition for /usr. I've read that that's a good option, because I will then not have to reinstall all my software if/when I upgrade the OS, or install a different distro.
so here are my questions:
1. General question: is there a way for me to clean up this mess without reformatting or deleting a lot of partitions...?
2. Is it possible to move the existing partitions and make use of the currently unusable space by adding it to an existing partition (other than hda1, from which it was originally taken?)
3. Is it possible to turn one of the existing linux-partitions into an extended partition without deleting it first? I.e., is there a command or something whereby I can call, say, hda4 an extended partition, and then add a logical partition under it?
4. The swap partition, should it be a primary partition, or does that not matter?
5. Is my suggested partition scheme sensible? I'm a software junkie, so I want the projected /usr partition to be quite big. This probably means that the root partition can shrink to - what? 3 Gb?
6. I also read somewhere that there were some files under /usr which were needed at bootup, when only / is mounted, so that I perhaps shouldn't place the entire /usr directory on a separate partition - is this correct? In which case I could place the /usr/share and /usr/local in a separate partition and mount them from there? Should they also have each their partitions, or doesn't that matter?
7. While I'm at it, are there other parts of the file system which could use their own partitions?