LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Linux installations leaving behind 4 GB swap partitions (https://www.linuxquestions.org/questions/linux-newbie-8/linux-installations-leaving-behind-4-gb-swap-partitions-887532/)

Blackened Justice 06-21-2011 07:49 AM

Linux installations leaving behind 4 GB swap partitions
 
I've installed some Linux distributions over the past few weeks, and I've recently noticed that previous installations of Linux have left my hard drive cluttered with numerous 4 GB swap partitions. I've since deleted them, but is there any way to avoid this a priori in the future?

sycamorex 06-21-2011 08:05 AM

Please note that you don't need a separate swap partition for each linux distro. It can be shared by systems. For example, If you dual/triple boot, there's no need to create more than 1 swap filesystem:
eg.

/dev/sda1 Slackware
/dev/sda2 SWAP
/dev/sda3 Debian
/dev/sda4 Arch

Each distro can utilise /dev/sda2 as swap filesystem
I hope it makes sense.

Blackened Justice 06-21-2011 10:44 AM

I'm not installing simultaneous OSs, I install a distribution and then when I install the next one, I choose to install over the current one.

sycamorex 06-21-2011 11:06 AM

Quote:

Originally Posted by Blackened Justice (Post 4391830)
I'm not installing simultaneous OSs, I install a distribution and then when I install the next one, I choose to install over the current one.

That's fine. It was just an example. Just make sure you don't CREATE a new swap partition each time you install a new distro. Use the one that you created during the previous installation.

Blackened Justice 06-21-2011 11:17 AM

Quote:

Originally Posted by sycamorex (Post 4391850)
That's fine. It was just an example. Just make sure you don't CREATE a new swap partition each time you install a new distro. Use the one that you created during the previous installation.

Hmm, how can I control if the installation will or won't create a new swap partition? Do I have to select custom partition options instead of just selecting the overwrite option? Shouldn't the overwrite option use the existing partition by default?

michaelk 06-21-2011 11:19 AM

It depends on the distribution and the options available during the installation. The manual/custom partition option will allow one to create and assign partitions as desired and use the same swap. If you select automatically create partitions the installer may not search for or use existing partitions.

sycamorex 06-21-2011 11:30 AM

I always do manual setup, but I'm surprised that the automatic option doesn't always detect the existing swap system.

Blackened Justice 06-21-2011 11:38 AM

Okay, thank you for the explanation, I'll do a manual installation next time ;)

Cheers

smoker 06-21-2011 05:17 PM

You don't have to do a manual install. Most automatic installs will give you the option to check the partition layout before proceeding. Do it, and delete any existing swap before the install starts.

Blackened Justice 06-22-2011 10:42 AM

Well, I had to reinstall Mint and this time chose the custom partitions option. I think I did everything well, my partitions are nice and tidy as they should be ;)


Cheers

Willrandship 06-22-2011 10:35 PM

Just make sure you have swap partitions set to mount to the "swap" option, or you'll have to do "sudo swapon sda*" every time you boot. I learned that the hard way. Nothing a simple startup bash scripting can't handle, but still an unnecessary pain.

michaelk 06-23-2011 04:04 AM

Willrandship,
No need for a startup script, just add the appropriate line to your /etc/fstab.

Willrandship 06-23-2011 11:03 AM

not an issue anymore anyways, since that particular distro is now gone, thanks to a horrible GRUB-related mistake :P but it's nice to learn new things. I'll keep that in mind.


All times are GMT -5. The time now is 10:53 PM.