LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 10-06-2009, 12:21 PM   #1
mortonmorton
Member
 
Registered: Sep 2009
Posts: 36

Rep: Reputation: 16
Optimizing Linux


Hi,

Good day! Just want to ask a few questions on this one. I've look on my partitions and it seems like my root directory is near full sometime soon.

Code:
[morton@mortonlx ~]$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2             9.5G  5.4G  3.7G  60% /
/dev/sda5              41G   17G   22G  43% /home
tmpfs                1009M     0 1009M   0% /dev/shm
/dev/sda1              59G   24G   35G  41% /mnt/animex
/dev/sdb2             346G  194G  153G  56% /media/Softwares
/dev/sdb1             586G  553G   34G  95% /media/Data
[morton@mortonlx ~]$
If you look on my /dev/sda drive, I've only got like 3.7gb on root, I think thats because of my frequent updates of softwares, installing unncessary softwares. Now, what would be the steps for me to kind of audit that root directory or my linux to really minimize the applications installed on it. How would I know what are big things that really consumes the space, like on my home directory I have no idea what made that 17G of data, since most of the time I only place the drivers on it.

If all the data on my root is necessary right now, is it possible to kind of add a space on it by taking some gigs out of my /home directory?

And also when I look on "top", I always see that I only have like 500mb memory left out of my 2gb. I haven't installed a database yet on my laptop, the only things I've configured are my hardwares, installed skype, and pidgin. How would I be able to trace which processes I dont really need. For day to day, I only need this IM softwares, browser, and development tools for my database. I think I don't need the sendmail? cups? ( this are the things I see starting up ).

In short, I want to save space, and kind of save memory in hope of speeding up more my pc.

Thank you very much. Any help is really appreciated.

Regards,
morton
 
Old 10-06-2009, 12:42 PM   #2
lutusp
Member
 
Registered: Sep 2009
Distribution: Fedora
Posts: 835

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by mortonmorton View Post
Hi,

Good day! Just want to ask a few questions on this one. I've look on my partitions and it seems like my root directory is near full sometime soon.

Code:
[morton@mortonlx ~]$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2             9.5G  5.4G  3.7G  60% /
/dev/sda5              41G   17G   22G  43% /home
tmpfs                1009M     0 1009M   0% /dev/shm
/dev/sda1              59G   24G   35G  41% /mnt/animex
/dev/sdb2             346G  194G  153G  56% /media/Softwares
/dev/sdb1             586G  553G   34G  95% /media/Data
[morton@mortonlx ~]$
If you look on my /dev/sda drive, I've only got like 3.7gb on root, I think thats because of my frequent updates of softwares, installing unncessary softwares. Now, what would be the steps for me to kind of audit that root directory or my linux to really minimize the applications installed on it. How would I know what are big things that really consumes the space, like on my home directory I have no idea what made that 17G of data, since most of the time I only place the drivers on it.

If all the data on my root is necessary right now, is it possible to kind of add a space on it by taking some gigs out of my /home directory?

And also when I look on "top", I always see that I only have like 500mb memory left out of my 2gb. I haven't installed a database yet on my laptop, the only things I've configured are my hardwares, installed skype, and pidgin. How would I be able to trace which processes I dont really need. For day to day, I only need this IM softwares, browser, and development tools for my database. I think I don't need the sendmail? cups? ( this are the things I see starting up ).

In short, I want to save space, and kind of save memory in hope of speeding up more my pc.

Thank you very much. Any help is really appreciated.

Regards,
morton
Quote:
it seems like my root directory is near full sometime soon
Code:
/dev/sda2             9.5G  5.4G  3.7G  60% /
60% is "nearly full"? Is this one of those deep, philosophical "cup half empty/half full" ideas? But in truth, this partition really is smaller than it should be.

The remedy is to save your important data and reinstall Linux with a reasonable root partition size, like 20 GB (the definition of "reasonable" will change over time). And create a single large partition with the remaining space that contains everything else -- /home, /media/Softwares and /media/Data. There is no earthly purpose to all those extra partitions. All that will happen is that one of the partitions (that should be directories) will fill up sooner than you expect, and you will reinstall again, and again, and again.

Big hard drives serve no purpose if their free space is unavailable to you. The easy way to make your life complicated is to split your drive up into a bunch of pointless partitions, each of which cannot share space with the others. Those partitions should be directories.
 
Old 10-06-2009, 01:00 PM   #3
mortonmorton
Member
 
Registered: Sep 2009
Posts: 36

Original Poster
Rep: Reputation: 16
Thank you very much for the reply. Sorry for my english on that, what I meant is that some time soon it will be filled fast. I got confused on having no partitions? I'm not sure but I got this idea before that if you did that partition on /home like it would be easier to mount or unmount new drives or something, I'm not sure I got that right.

So for now, your suggestion is to reformat and just do 2 partition for my linux? One for root, and the other one for the rest ( /home? )

The sdb is just my external drive.

And as for the memory/processes, do you have something in mind for me to be on the right track of working on that?
 
Old 10-06-2009, 01:12 PM   #4
lutusp
Member
 
Registered: Sep 2009
Distribution: Fedora
Posts: 835

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by mortonmorton View Post
So for now, your suggestion is to reformat and just do 2 partition for my linux? One for root, and the other one for the rest ( /home? )
Well, you should include a swap partition. So three partitions altogether, one for filesystem root (/), a small one for swap, the remainder for everything else.

This way you can reinstall or upgrade Linux without having to restore all your personal data.
 
Old 10-06-2009, 01:20 PM   #5
Myiagros
Member
 
Registered: Mar 2009
Distribution: Ubuntu, CentOS 5.3
Posts: 75

Rep: Reputation: 18
Make your swap 2x bigger than your total available memory. If you have 2GB of RAM then make your swap 4GB.
 
Old 10-06-2009, 01:32 PM   #6
mortonmorton
Member
 
Registered: Sep 2009
Posts: 36

Original Poster
Rep: Reputation: 16
Thanks for the replies.

@lutusp - when you say 'for everything else', do you mean, that partition should not be one of the usual directories of linux, i.e. /usr, /home, so it should be like my own-named-direcotry, like /mydata?
 
Old 10-06-2009, 02:21 PM   #7
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Hello mortonmorton,

as an example my ouput of df -h
Code:
/dev/hda1              15G  9.7G  4.1G  71% /
udev                   10M  116K  9.9M   2% /dev
/dev/hda2              15G  5.7G  8.4G  41% /home
/dev/hda4              48G   26G   20G  57% /usr/local/public
/dev/hda7              28G  6.2G   20G  24% /usr/local/virtualmachines
/dev/hda9              40G   24G   14G  64% /usr/local/music
shm                   752M     0  752M   0% /dev/shm
The disk has 200GB and there are some other partitions with Linux on it which are temporarily not mounted. /dev/hda2 is /home for all my Linux-systems. The directorynames are self-explanatory I think. The PC is about 3 years old and I never reorganized the whole disk. I have 3GB of swap and 1.5GB of physical RAM.
Here the output of free -m
Code:
Gentoo ~ # free -m
             total       used       free     shared    buffers     cached
Mem:          1502       1165        337          0         80        419
-/+ buffers/cache:        665        837
Swap:         2975         42       2933
temporarily kde3.5 is running and I'm compiling OpenOffice.

Markus

Last edited by markush; 10-06-2009 at 02:29 PM.
 
Old 10-06-2009, 02:47 PM   #8
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Quote:
Originally Posted by Myiagros View Post
Make your swap 2x bigger than your total available memory. If you have 2GB of RAM then make your swap 4GB.
Old, outdated "rule" of thumb. Modern systems have so much RAM that this is not a rule anymore. If you're hibernating, then you need swap at least equal to your amount of RAM. If you're hitting swap constantly, then you need more RAM anyway. On the other hand, having some swap is good for the kernel to page out unused memory, and with disk space so cheap it wouldn't hurt. I'd go with 512MB swap max.

Quote:
Originally Posted by mortonmorton View Post
And also when I look on "top", I always see that I only have like 500mb memory left out of my 2gb.
This is not a problem. Using all your memory is a Good Thing. The memory not used for applications is used for buffers and cache to speed up subsequent accesses. Use the "free" command to see where memory is going.
 
Old 10-06-2009, 03:18 PM   #9
linuxpokernut
Member
 
Registered: Jul 2007
Distribution: Slackware 14
Posts: 237
Blog Entries: 8

Rep: Reputation: 59
my suggestion:

Keep it at 60% and install new software to one of the larger drives, and of course download data there also.

Quote:
And also when I look on "top", I always see that I only have like 500mb memory left out of my 2gb.
I used to get so worried about that also. I then found out its ok for the mem to be "full"

Code:
sh-3.1$ cat /proc/meminfo
MemTotal:      2070020 kB
MemFree:         71152 kB
Buffers:        325788 kB
Cached:         568000 kB
SwapCached:         56 kB
Active:        1311532 kB
Inactive:       594352 kB
HighTotal:     1179584 kB
HighFree:        16616 kB
LowTotal:       890436 kB
LowFree:         54536 kB
SwapTotal:     2096472 kB
SwapFree:      2096416 kB
I don't have anything big running and I'm in fluxbox, WTH I thought. Believe it or not, if I reboot and start a huge app (lets say WoW) it will run just the same as if i run it right now with 71 megs free.
 
Old 10-06-2009, 05:47 PM   #10
lutusp
Member
 
Registered: Sep 2009
Distribution: Fedora
Posts: 835

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by mortonmorton View Post
Thanks for the replies.

@lutusp - when you say 'for everything else', do you mean, that partition should not be one of the usual directories of linux, i.e. /usr, /home, so it should be like my own-named-direcotry, like /mydata?
Yes. The big remaining partition is for your data. That way, you can replace or upgrade Linux distributions without having to restore your data.
 
Old 10-06-2009, 05:57 PM   #11
mortonmorton
Member
 
Registered: Sep 2009
Posts: 36

Original Poster
Rep: Reputation: 16
Thank you very much again for all the inputs!!! It's much clearer now, will keep on reading =)
 
  


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
Optimizing Linux Desktop masand Linux - Software 4 06-09-2005 09:19 AM
Optimizing Linux for my processor MarleyGPN Linux - General 6 04-30-2003 11:25 AM
optimizing linux centr0 Linux - General 3 03-13-2003 04:12 PM
optimizing LINUX nautilus_1987 Linux - General 10 11-03-2002 11:24 AM
optimizing linux kernel uttam_h Linux - Hardware 4 09-20-2002 04:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:39 AM.

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