Instead of expanding your existing partition, you may want to consider creating a new partition to use the unallocated space. This will be safer, since you won't need to move a bunch of critical data structures, which is what will happen if you try to expand your /dev/sda9
into the free space preceding it. Chances are a new /home
partition would be the best use for (most of) that free space; this is where your user files go, so it's the partition that's most likely to need to increase in size. This question and answers describes how to create a /home
partition after installing Ubuntu. OTOH, if you want to increase the size of your current partition because of non-user files (say, if you're installing tons of software or if you're running a server that stores lots of data in /var
), either creating a new partition for the relevant directory (like /var
) or resizing the current partition (despite the risks) may be the best approach.
As to swap space, the old rule was to create swap space equal to 1-2 times your RAM, which would be 16 to 32 GiB, in your case. Today, it's rarely helpful to have this much swap space. The main reason to have even as much swap as you've got RAM is if you want to use hibernation (suspend-to-disk) operations, which are disabled by default in Ubuntu. That said, the Linux kernel can make effective use of swap space even if you've got lots of RAM -- the kernel will swap out long-inactive data from RAM, freeing the RAM for use as disk caches, thus improving performance. With 16 GiB of RAM, this might or might not be important to you, depending on how much of that RAM is used by programs. If this answer seems a bit wishy-washy, I apologize; but it's impossible to give a blanket statement about how much swap space is necessary or helpful without detailed system usage information.