I got the question regardin SWAP in gentoo, I got swap created on /dev/sda2 , it is created as primary partition, teoreticaly if I destroy /dev/sda2 and will comment the line in /etc/fstab where /dev/sda2 swap is defined, will I boot my system without this? If I got my RAM big enough?

( to explain I need to destroy 1 partition to be able to create extended partitions, because I got 4 primary now and after that I want to create swap for gentoo on another newly created extended partiotion with: mkswap /dev/sdaX && swapon /dev/sdaX and add the line back to /etc/fstab , will this work like that? )

Opinion and use cases vary regarding swap, a lot of people say if you have more than 2GB then you don't need swap. I've never maxed out my 2GB on any of the distros I've used but then I'm just on a laptop with a fairly minimal setup. (I do have a swap partition ftr, swappiness=1)

Most desktio linux systems don't ever use swap, even if it's setup. That's the nice thing about linux. It won't put things in swap unless it really needs to. However, disk space is rather cheap these days if you're building something like a file server with virtual machines running on it. There, I've found having a few gigs of swap can make things safer and gives you a nice safety net to recover if you do something stupid like start too many VMs. On my own server, I have 10G of swap for 8G of ram. The most it as ever used is a few hundred megs, but it did keep the system from freezing on those few occasions.

Unless you're really strapped for disk space, I'd say having a few gigs of swap just means a more stable system in case you ever do run out of ram._________________Someone asked me once if I suffered from mental illness. I told him I enjoyed every second of it.
www.madchaz.com A small candle of a website. As my lab specs on it.

After swapoff /dev/sda2, you don't really need to suppress /dev/sda2 to create an extended partition with, you can just change it ID that is 82 (Linux swap) for 5 (Extended) or 85 (Linux extended) and create logical partitions in like a swap.

I prefer that the number of each partition reflect it's disk space position from left to right, so my extended partition would be at the end of the disk with the number four, /dev/sda4. In practice, it's not an obligation in a DOS/MBR partitions table.

You don't need to comment the swap line in fstab but change it accordingly to the new swap partition. You have to change the number 2 for the new one, 5 or higher in the swap line of fstab. You can use a LABEL and/or a UUID. You have to reboot only if the new partitions table cannot be use immediately by Linux. It's often the case when the running host have it's root partition on the disk you are modifying.

If you don't have to reboot you can do

Code:

swapon -a

for the new swap be active.

I use the same amount of swap space than the Ram even if I don't need it, just to have enough space if I suspend on disk, hibernate. It can be more if I have few Ram._________________Paul

You can do as you say but all the space being donated to the extended partition must be in one piece.
This means that the space where your /dev/sda2 is now will become inaccessable.

If sda1 is /boot, think about leaving swap where it is and moving the content of sda1 to your /boot directory, so that the partition table entry for sda1 can be reused for an extended partition. swap stays at sda2.

This is a little more complex as you need to reinstall grub to the MBR, update grub.conf and fstab now but in exchange, the space now occupied by sda2 is still accessable._________________Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.

Thank you for all comments, this is my test computer, so nothing really absolutely important is running on it, I just need to create some extra partition only for storage, to place some files on it. I got 1 Gentoo and 1 Debian running on it and I need another 1 partition to create (5th).