LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Optimizing Linux (https://www.linuxquestions.org/questions/linux-newbie-8/optimizing-linux-760099/)

mortonmorton 10-06-2009 12:21 PM

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

lutusp 10-06-2009 12:42 PM

Quote:

Originally Posted by mortonmorton (Post 3709823)
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.

mortonmorton 10-06-2009 01:00 PM

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?

lutusp 10-06-2009 01:12 PM

Quote:

Originally Posted by mortonmorton (Post 3709872)
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.

Myiagros 10-06-2009 01:20 PM

Make your swap 2x bigger than your total available memory. If you have 2GB of RAM then make your swap 4GB.

mortonmorton 10-06-2009 01:32 PM

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?

markush 10-06-2009 02:21 PM

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

AlucardZero 10-06-2009 02:47 PM

Quote:

Originally Posted by Myiagros (Post 3709906)
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 (Post 3709823)
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.

linuxpokernut 10-06-2009 03:18 PM

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.

lutusp 10-06-2009 05:47 PM

Quote:

Originally Posted by mortonmorton (Post 3709923)
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.

mortonmorton 10-06-2009 05:57 PM

Thank you very much again for all the inputs!!! It's much clearer now, will keep on reading =)


All times are GMT -5. The time now is 11:36 AM.