LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-01-2006, 04:14 PM   #1
AGazzaz
Member
 
Registered: Nov 2005
Location: Egypt
Distribution: Fedora 17 KDE
Posts: 393

Rep: Reputation: 31
how to expand linux partition & how much swap do i I need?


hello
i have linux installed for over 5 months now without new install and it is running out of space and actually i want to solve the problem without reinstalling

i want to increase the size of the partition holding linux by using the free space on the other drives without affecting them
is that possible

and here is how my 80GB hard drive look like

http://www.boomspeed.com/darkknight/freespace.jpg

the other thing is how much space is needed for the swap drive as i have 700 MB swap drive

Thanks in advance.
 
Old 05-01-2006, 05:21 PM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
Manipulating partitions can be done with parted, or its GUI version qtparted. I'm not sure how good it is at splitting existing partitions though, as I've never used it for that personally.

Note, you won't "increase the size of your linux partition" this way, but you will gain one or more extra Linux-formatted partitions that you can transfer files to. Moving existing partitions around on a disk can be really tricky (read, dangerous).

A good rule of thumb is to make your swap partition equal to your physical memory. Use more (up to 2x) if you have little physical memory to start with or often use memory-hogging programs such as graphic editors. 700mb is a pretty good middle ground.

Last edited by David the H.; 05-01-2006 at 05:23 PM.
 
Old 05-01-2006, 05:27 PM   #3
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
In the old days swap used to be twice the size of ram. Reason was ram was expensive. Today it is pretty cheap overall. Normally if you have 256meg or more ram then maybe 128meg swap is fine. Best way to determine is after running linux for a period of time run the top command and see if any free ram is left and see if swap is being used. May increase to whatever but keep in mind swap is consider slow versus the price of ram today. Add more ram would make the system run better overall.

To resize I would download an ISO of System Rescue CD from and burn to a cd. http://freshmeat.net/projects/systemrescuecd/
Only about 140meg if I remember. Boot with that and use the qtparted tool. Check out the link for qtparted and see if it can do what you need to do. On say reiserfs it can resize by expanding or shrinking but the begining blocak can never be moved. So you can't shrink a partition before the reiserfs one and then try to move it to fill the gap. It just not able to do that. http://qtparted.sourceforge.net/

Note: Even if you have qtparted installed you cannot resize a mounted partition. It must be unmounted before it can be resized.

Brian1
 
Old 05-01-2006, 06:27 PM   #4
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
Quote:
Originally Posted by Brian1
In the old days swap used to be twice the size of ram. Reason was ram was expensive. Today it is pretty cheap overall. Normally if you have 256meg or more ram then maybe 128meg swap is fine.
That's true, but then again, disk space is also pretty cheap these days, so there's no real reason not to have a large swap space either. You may not use it normally, but it could come in handy on occasion when you're working with really large amounts of data.

That's why I suggested equal-to-ram. It's not as much as was necessary in the past, but, assuming he doesn't have gigabytes of it, it's a good, easy to remember compromise.
 
Old 05-02-2006, 04:56 AM   #5
AGazzaz
Member
 
Registered: Nov 2005
Location: Egypt
Distribution: Fedora 17 KDE
Posts: 393

Original Poster
Rep: Reputation: 31
Exclamation

Thank you very much for your replies i can not be any happier

i will try them as soon as i can but first i would like to ask about the mounting trick
where are the RPM based programs installed and if i can mount the directory on another partition as it is possible in window$ so it would be physically on another drive and logically on the linux partition
 
Old 05-03-2006, 05:20 PM   #6
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
Nearly all programs get installed to /usr and its subdirectories. And yes, it's quite easy to have it on a different partition or drive. I have it set up that way myself, in fact. All you need to do is set up fstab so that '/usr' is the mount point for the partition.

I'm not sure how easy it would be to change your current setup to that though. *Probably* all it would take would be to mount the partition to a temporary mount point, copy all of your current /usr files to it, then remount it as /usr in place of the originals. It would probably be much easier to boot into a live CD or something to do it however, since bad things might happen if you're running your regular system at the time.

Maybe someone else can give you better advice about this though.
 
  


Reply



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
Swap file & Boot Partition Resize surfer2k3 Linux - Newbie 4 07-17-2008 07:50 PM
common swap partition for XP & Linux jadukor Slackware 2 12-22-2005 02:09 PM
Can I expand a reiserfs partition? LeftyAce Debian 4 12-13-2005 12:51 PM
Need to expand /usr partition marenkiapina Linux - Software 2 05-22-2004 06:27 AM
how to expand my /tmp...partition Zvezda Linux - General 2 07-03-2003 07:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:14 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
Open Source Consulting | Domain Registration