LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-21-2011, 08:49 AM   #1
Blackened Justice
Member
 
Registered: Jun 2011
Posts: 82

Rep: Reputation: Disabled
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?
 
Old 06-21-2011, 09:05 AM   #2
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,819
Blog Entries: 1

Rep: Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200
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.
 
Old 06-21-2011, 11:44 AM   #3
Blackened Justice
Member
 
Registered: Jun 2011
Posts: 82

Original Poster
Rep: Reputation: Disabled
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.
 
Old 06-21-2011, 12:06 PM   #4
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,819
Blog Entries: 1

Rep: Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200
Quote:
Originally Posted by Blackened Justice View Post
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.
 
Old 06-21-2011, 12:17 PM   #5
Blackened Justice
Member
 
Registered: Jun 2011
Posts: 82

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by sycamorex View Post
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?
 
Old 06-21-2011, 12:19 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 15,268

Rep: Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624
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.
 
Old 06-21-2011, 12:30 PM   #7
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,819
Blog Entries: 1

Rep: Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200
I always do manual setup, but I'm surprised that the automatic option doesn't always detect the existing swap system.
 
Old 06-21-2011, 12:38 PM   #8
Blackened Justice
Member
 
Registered: Jun 2011
Posts: 82

Original Poster
Rep: Reputation: Disabled
Okay, thank you for the explanation, I'll do a manual installation next time

Cheers
 
Old 06-21-2011, 06:17 PM   #9
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 249Reputation: 249Reputation: 249
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.
 
Old 06-22-2011, 11:42 AM   #10
Blackened Justice
Member
 
Registered: Jun 2011
Posts: 82

Original Poster
Rep: Reputation: Disabled
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
 
Old 06-22-2011, 11:35 PM   #11
Willrandship
Member
 
Registered: Oct 2009
Location: Utah
Distribution: Debian Testing (Wheezy atm.)
Posts: 109

Rep: Reputation: 17
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.
 
Old 06-23-2011, 05:04 AM   #12
michaelk
Moderator
 
Registered: Aug 2002
Posts: 15,268

Rep: Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624
Willrandship,
No need for a startup script, just add the appropriate line to your /etc/fstab.
 
Old 06-23-2011, 12:03 PM   #13
Willrandship
Member
 
Registered: Oct 2009
Location: Utah
Distribution: Debian Testing (Wheezy atm.)
Posts: 109

Rep: Reputation: 17
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux Installation vitually, services for Virtual Installations, Partitions LVM Muhammad Shakir Linux - General 1 02-21-2009 07:34 PM
Linux Installation vitually, services for Virtual Installations, Partitions LVM Muhammad Shakir Linux - Distributions 1 02-21-2009 07:29 PM
Linux Installation vitually, services for Virtual Installations, Partitions LVM Muhammad Shakir Linux - Server 1 02-21-2009 07:26 PM
Linux Installation vitually, services for Virtual Installations, Partitions LVM Muhammad Shakir Linux - Newbie 1 02-21-2009 07:25 PM
Linux Installation vitually, services for Virtual Installations, Partitions LVM, Muhammad Shakir Linux - Enterprise 1 02-21-2009 07:24 PM


All times are GMT -5. The time now is 05:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration