View previous topic :: View next topic |
Author |
Message |
L41n Tux's lil' helper
Joined: 21 Jul 2004 Posts: 85
|
Posted: Sun May 22, 2005 1:07 am Post subject: |
|
|
I clean my system regulary with:
Code: | emerge depclean -vp and emerge depclean -v
localepurge
rm -rf /var/tmp/portage |
and this one is the result:
Code: | 1,7G /usr
897M /proc |
11 months since last Gentoo install. _________________ Emerge your liberty. |
|
Back to top |
|
|
russianpirate Veteran
Joined: 26 Sep 2004 Posts: 1167 Location: Detroit, MI
|
Posted: Sun May 22, 2005 1:09 am Post subject: |
|
|
can i see the whole HD layout (cd / & du -ms */)... and ur world list
cause i do clean it too but i just cant give up gnome and some of huge apps (ut2004, cedega,..) |
|
Back to top |
|
|
Lokheed Veteran
Joined: 12 Jul 2004 Posts: 1295 Location: /usr/src/linux
|
Posted: Sun May 22, 2005 1:22 am Post subject: |
|
|
Hauser wrote: | NeddySeagoon wrote: | Did you make a partition for /proc ? |
No, I didn't make any partition for /proc, (Who would think of doing that?). I'm aware that /proc is a virtual filesystem which contains runtime system information, but:
# du -h /proc
0 /proc/asound/seq
0 /proc/asound/oss
0 /proc/asound
0 /proc/ide/ide1/hdc
0 /proc/ide/ide1
0 /proc/ide/ide0/hda
0 /proc/ide/ide0
2.0K /proc/ide
........
5.0K /proc/10050/task/10050/fd
5.0K /proc/10050/task/10050
5.0K /proc/10050/task
5.0K /proc/10050/fd
10K /proc/10050
514M /proc
this is why I'm beginning to wonder.
El_Presidente_Pufferfish wrote: | i think proc has a fake file that shows it has the same size as your ram, but doesnt actually
|
This is correct, I've got 514M ram. |
Nothing in /proc takes up any space on your filesystem. If you want to test this, plop in a 32MB stick of ram and watch it shoot down. Proc is completely virtual, I know because I was alarmed at my 514MB file and did some research.
Code: | Filesystem Size Used Avail Use% Mounted on
/dev/hda5 2.0G 299M 1.7G 16% /
proc 0 0 0 - /proc
sysfs 0 0 0 - /sys
udev 252M 600K 251M 1% /dev
devpts 0 0 0 - /dev/pts
/dev/hda6 981M 84M 898M 9% /var
/dev/hda7 2.9G 1.6G 1.3G 55% /usr
/dev/hda8 108G 47G 62G 43% /home
none 252M 0 252M 0% /dev/shm
usbfs 0 0 0 - /proc/bus/usb
|
_________________ You're not afraid of the dark are you? |
|
Back to top |
|
|
codergeek42 Bodhisattva
Joined: 05 Apr 2004 Posts: 5142 Location: Anaheim, CA (USA)
|
Posted: Sun May 22, 2005 5:55 am Post subject: |
|
|
Code: | Filesystem Type Size Used Avail Use% Mounted on
/dev/hda6 ext3 15G 1.7G 12G 13% /usr
/dev/hdb2 ext3 4.7G 1.8G 2.7G 40% /usr/portage
/dev/hdb4 ext3 6.4G 1.4G 4.7G 23% /usr/src | Cheers. _________________ ~~ Peter: Programmer, Mathematician, STEM & Free Software Advocate, Enlightened Agent, Transhumanist, Fedora contributor
Who am I? :: EFF & FSF |
|
Back to top |
|
|
russianpirate Veteran
Joined: 26 Sep 2004 Posts: 1167 Location: Detroit, MI
|
Posted: Sun May 22, 2005 3:03 pm Post subject: |
|
|
why did u split it up like that?
wont it be difficult to keep organized? (no space on one.. too much space on other) |
|
Back to top |
|
|
Genone Retired Dev
Joined: 14 Mar 2003 Posts: 9526 Location: beyond the rim
|
Posted: Sun May 22, 2005 5:43 pm Post subject: |
|
|
Hauser wrote: | NeddySeagoon wrote: | Did you make a partition for /proc ? |
No, I didn't make any partition for /proc, (Who would think of doing that?). I'm aware that /proc is a virtual filesystem which contains runtime system information, but:
# du -h /proc
0 /proc/asound/seq
0 /proc/asound/oss
0 /proc/asound
0 /proc/ide/ide1/hdc
0 /proc/ide/ide1
0 /proc/ide/ide0/hda
0 /proc/ide/ide0
2.0K /proc/ide
........
5.0K /proc/10050/task/10050/fd
5.0K /proc/10050/task/10050
5.0K /proc/10050/task
5.0K /proc/10050/fd
10K /proc/10050
514M /proc
|
Well, that's because du just asks the kernel and teh kernel tells it those sizes (the same way it tells df that /proc doesn't occupy any space). You might want to read up on the VFS code for more details. |
|
Back to top |
|
|
Lokheed Veteran
Joined: 12 Jul 2004 Posts: 1295 Location: /usr/src/linux
|
Posted: Sun May 22, 2005 6:11 pm Post subject: |
|
|
russianpirate wrote: | why did u split it up like that?
wont it be difficult to keep organized? (no space on one.. too much space on other) |
Not at all. Its perfect. Everything is on /home, even my portage tmp directory. /usr is for anything that gets installed so it really doesnt matter as I wont be installing another 1G of stuff thats for sure. It works perfectly. No space is wasted where it shouldnt be and the left over is alloted to where it would be put to the most use _________________ You're not afraid of the dark are you? |
|
Back to top |
|
|
russianpirate Veteran
Joined: 26 Sep 2004 Posts: 1167 Location: Detroit, MI
|
Posted: Sun May 22, 2005 7:39 pm Post subject: |
|
|
well if u just make 3 partitions boot, swap and root.. u definetely wont waste space |
|
Back to top |
|
|
Lokheed Veteran
Joined: 12 Jul 2004 Posts: 1295 Location: /usr/src/linux
|
Posted: Sun May 22, 2005 8:28 pm Post subject: |
|
|
russianpirate wrote: | well if u just make 3 partitions boot, swap and root.. u definetely wont waste space |
That sucks if you ever want to reformat and start anew. Boot partitions suck too, never used them, waste of space.
/ is required but since not many things intall into /opt (unless you want to mount it on its own), so it doesnt really need to be that big.
/usr is only for installed programs and whatevers in distfiles. For me the size is perfect if I want to fetch everything in my tree and run an emerge -e world, I have plenty of room
/var is pretty much a waste but never been bothered to remove it...I just dont need the extra 700MBs that much.
/home is the big sucker with everything. It really benefits having it on its own mount point as mentionned above. If I want to redo my system, I dont have to worry about backing anything up at all or losing data. I wipe out /, /usr, /var, and I am off. Structuring Linux to your needs is an art. To have them all lumped under / removes much of the power that Linux has. _________________ You're not afraid of the dark are you? |
|
Back to top |
|
|
96140 Retired Dev
Joined: 23 Jan 2005 Posts: 1324
|
Posted: Sun May 22, 2005 11:15 pm Post subject: |
|
|
du -h /usr tells me:
2.4G /usr
906M /usr/portage
But then again, I haven't bothered to clean anything out of my /usr directory yet, especially not from /usr/portage or /usr/src, so go figure.
Edit: My conscience couldn't let me continue on without spring cleaning.
1.8G /usr
400M /usr/portage |
|
Back to top |
|
|
TrueDFX Retired Dev
Joined: 02 Jun 2004 Posts: 1348
|
Posted: Sun May 22, 2005 11:27 pm Post subject: |
|
|
Code: | # du -hs /proc /usr /usr/portage
576K /proc
2,0G /usr
4,0K /usr/portage |
|
|
Back to top |
|
|
Hauser l33t
Joined: 27 Dec 2003 Posts: 650 Location: 4-dimensional hyperplane
|
Posted: Mon May 23, 2005 1:29 am Post subject: |
|
|
TrueDFX wrote: | Code: | # du -hs /proc /usr /usr/portage
576K /proc
2,0G /usr
4,0K /usr/portage |
|
Impressively clean! 576K for /proc? What do you do on your system?
P.S. hard to believe this old thread is still alive! _________________ AMD Athlon XP 2600+; 512M RAM;
nVidia FX5700LE; Hitachi 120Gb
2.6.9-nitro4, reiser4, linux26-headers+nptl
Do I like to compile everything?
Positive definite! |
|
Back to top |
|
|
TrueDFX Retired Dev
Joined: 02 Jun 2004 Posts: 1348
|
Posted: Mon May 23, 2005 1:58 am Post subject: |
|
|
Hauser wrote: | Impressively clean! 576K for /proc? What do you do on your system? | To be honest, I'm not sure. Maybe it's something in my kernel configuration, maybe it's the fact that I don't use swap, or maybe it's something entirely else... |
|
Back to top |
|
|
kashani Advocate
Joined: 02 Sep 2002 Posts: 2032 Location: San Francisco
|
Posted: Tue May 24, 2005 4:24 pm Post subject: |
|
|
From man proc
Code: |
/proc/kcore
This file represents the physical memory of the system and is
stored in the ELF core file format. With this pseudo-file, and
an unstripped kernel (/usr/src/linux/vmlinux) binary, GDB can be
used to examine the current state of any kernel data structures.
The total length of the file is the size of physical memory
(RAM) plus 4KB.
|
I assume that it's limited to 1GB because of the 1GB/3GB kernel/userspace split, which seems to make sense in that all my servers 2GB, 3GB, or 4GB have the same size kcore.
kashani _________________ Will personally fix your server in exchange for motorcycle related shop tools in good shape. |
|
Back to top |
|
|
JRV Apprentice
Joined: 10 Jan 2004 Posts: 291
|
Posted: Tue May 24, 2005 10:52 pm Post subject: |
|
|
kashani wrote: | I assume that it's limited to 1GB because of the 1GB/3GB kernel/userspace split, which seems to make sense in that all my servers 2GB, 3GB, or 4GB have the same size kcore. |
Well, if you want to know the exact calculation, have a look at /usr/src/linux/fs/proc/kcore.c. Find the function:
Code: | static size_t get_kcore_size(int *nphdr, size_t *elf_buflen)
{
size_t try, size;
/* ... */
size = 0;
for (m=kclist; m; m=m->next) {
try = kc_vaddr_to_offset((size_t)m->addr + m->size);
if (try > size)
size = try;
*nphdr = *nphdr + 1;
}
/* ... */
return size + *elf_buflen;
}
|
Looks as if a list of virtual addresses is iterated over and "size" is set to the highest physical address mapping found. So I guess the returned size (without *elf_buflen) is smaller than your memory size if the kernel hasn't mapped the highest physical memory location.
Greets,
Julius
[EDIT] I've been wrong about the virtual <=> physical memory translation, but the overall idea is still correct:
"The second piece of abstraction is the kc_vaddr_to_offset() and
kc_offset_to_vaddr() macros. These provide mappings from kernel
virtual addresses to offsets in the virtual file that /proc/kcore
instantiates."
(http://seclists.org/lists/linux-kernel/2003/May/6049.html) |
|
Back to top |
|
|
|