Do I only need one swap partition for multiple Linux distros? (and other questions)

Short answer: You can use the same swap partition as the data in swap is not preserved from one boot to the next. It is totally normal to have multiple linux installations on a disk with a single swap.

There is one exception/caveat I know of, however: if you use hibernate (aka, 'suspend to disk'), hibernate uses your swap space for storage. If you then boot another system that also uses hibernate (or perhaps even one that doesn't), you could create some very nasty problems.

Most likely you would know and have some understanding of this if you are using hibernation, but I noticed recently that KDE seems to have included a "hibernate" option in one of its default menus. So to be clear: hibernate is like "sleep" (most people use that at least on laptops), except the computer does not require any power at all (the state is stored on disk, not in ram, and reloaded by the kernel at boot time).

So you only have to worry if you have been making use of some such feature but are unfamiliar with how it works. Normal "sleep" (aka, suspend-to-ram) is fine as it does not involve the swap partition.


do I need to have a swap partition for each distro or can LFS use the swap partition I already have?

As goldilock says, unless you are hibernating (suspend to disk), yes. Otherwise no, because you could overwrite swap of a hibernated system - either it's saved state or the part that was used as regular swap at suspend time.

If so, would the swap partition have to be a primary partition, or does it not matter?

No, it doesn't matter at all. You can use swap in file on a regular filesystem, if need be (there is a small overhead, but it's also more flexible). You can even swap to NFS, if you're bold enough.

On the other hand, if you ran Windows 7 on the machine, chances are you have enough memory not to need swap at all under normal circumstances - even with "just" 2GB RAM you can do a whole lot of stuff without swap (basic desktop environment will use ~200MB). Not that swap would be unnecessary, but the need for it these days is much smaller then 10 years ago.

since deleting Windows 7 (sda 1-3), my Linux partitions are still numbered 5-7. If I create a new partition, will it be called sda1?

Since the disk is using the MBR partitioning scheme, the numbers, all logical partitions will have number 5 and higher. Unless you expand the extended partition that contains the logical ones, the only remaining space is likely available only for primary partitions, which will be numbered 1-3, provided the extended partition has number 4. See wiki on MBR for more details.

Is there any practical difference between a primary and a logical partition?

Not these days. BIOSes usually weren't able to boot from logical partitions (because they only read the MBR). Today the bootloaders usually know how to do this, so the only thing BIOS does in the system loading process is to read the bootloader trampoline from MBR (or boot sector in a primary partition) and that takes care of everything else by first loading rest of the bootloader, which in turn loads the kernel.

is an extended partition just a primary partition that contains logical partitions?

Yes, you can view it as such with a tiny bit of abstraction - it behaves as such, but the partition metadata is stored differently (as a linked list instead of an array with 4 elements which is what MBR is). As for question in the comment - yes you can only have one extended partition. But once you finalize your setup a bit (or even earlier), you might want to switch to GPT. It might even be possible to do it non-destructively (depends on the exact partitions layout).