Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to make some disk space?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Bitruder
Tux's lil' helper
Tux's lil' helper


Joined: 04 Jun 2004
Posts: 120

PostPosted: Tue Dec 21, 2004 3:38 pm    Post subject: How to make some disk space? Reply with quote

When I first installed Gentoo last year, I only left 9GB for my root partition (sans /boot). I'm starting to think this was a bad idea as I'm now down to the following:
Code:
 $ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/hda3             8.8G  8.1G  734M  92% /
/dev/hda4              47G   33G   14G  71% /home
none                  442M     0  442M   0% /dev/shm


Are there any common hints fro clearing up some disk space? I've cleaned out /tmp and /usr/tmp but other than that, I'm not really sure where to go looking for unneeded things just taking up space. Any advice?
Back to top
View user's profile Send private message
hensan
l33t
l33t


Joined: 26 Jun 2003
Posts: 868
Location: Sweden

PostPosted: Tue Dec 21, 2004 3:47 pm    Post subject: Reply with quote

You can clear out /usr/portage/distfiles and /var/tmp/portage.

You can also try a emerge -p depclean to see if you have any unneeded packages installed.
Back to top
View user's profile Send private message
blackhorse
Apprentice
Apprentice


Joined: 11 Jul 2004
Posts: 225
Location: edge of a forest

PostPosted: Tue Dec 21, 2004 3:59 pm    Post subject: Reply with quote

Go through your /usr/portage/distfiles by doing this:

Code:
ls /usr/portage/distfiles | less
and then in another window rm all multiple versions of the things. Or, you could just delete the whole thing because it will not do anything to your system except that you will have to download everything again when you emerge. Another thing you could do if you have music on your disk is to change them from .wav files to .ogg files. Trust me, it saves a lot of room. The command for that is
Code:
oggenc <the file you want ogged>
If it does not know the command you need to emerge vorbis-tools. Another, more drastic aproach is to switch from kde or gnome to fvwm or something light like that. Kde was taking up 5% of my disk.
_________________
Rejoice in the Lord always and again I say rejoice.
Back to top
View user's profile Send private message
Karl_R
Tux's lil' helper
Tux's lil' helper


Joined: 21 Mar 2004
Posts: 118
Location: Sydney

PostPosted: Tue Dec 21, 2004 4:50 pm    Post subject: shift some stuff Reply with quote

Hi, Iknow how you feel ( but my disk isn't as big as yours you lucky thing)

Anyway, 9G for root? I make do with 1.2G. basically I shifted /usr/portage out of root (as this is where portage and all of those lovley fat packages go)

Since you seem to have loads of room in /home I'd sugesst that you move it to there.

OK here's what to do:
emerge the automounter so that requests to /usr/portage get magically redirected to /home/usr/portage for instance.
Then copy (using tar) all of the stuff in /usr/portage to /home/usr/portage
restart the automounter and cd to /usr/portage to test that you are actually in /home/usr/portage (may be easier and a better test to reboot?)
If all is good rename /usr/portage to /usr/portage_moved and test again.
happy with all the testing? then delete /usr/portage_moved

eg.
Code:
emerge -auD autofs
rc-update add autofs default


check the man page for autofs and auto.master (the file that tells it what to do)
edit the file /etc/auto.master to include a line like:-

Code:
# special mount point defined by direct map file
/-              auto.direct


this basically tells it to look in another file called auto.direct for more maps, in this case direct maps

create a file
Code:
touch /etc/auto.direct


and edit it to contain this line

Code:
# mount /usr/portage at thishost on /home/usr/portage
# NB you may have to replace localhost by your hostname
/usr/portage_rename         localhost:/home/usr/portage


note that I've called it "/usr/portage_rename" for now so that we don't mask the origional /usr/portage, after it's all working and the data has been copied accross then you can change the moint point to "/usr/portage"

create the dir /home/usr/portage
Code:
mkdir -p /home/usr/portage


and place a file in there to proove that the automounter is working
Code:
echo "You made it" > /home/usr/portage/testfile.txt


start the automounter
Code:
/etc/runleavels/default/autofs start


if all is well when you cd into /usr/portage_rename you will see the file "testfile.txt"

once you have this working, try reboot if necessary or replace the "localhost" with your hostname in /etc/auto.direct

then you can copy all the files there. I'd sugest that you have a good look in the /usr/portage/packages directory and get rid of old pakages that you no longer need (look for packages that have multiple versions and delete the older ones) to save space

then:
Code:
cd /usr;
tar -cf - ./portage | ( cd /home/usr; tar -xf - )


will tar up all the portage directory and untar it in the new location. Be aware of the spaces, especially after the '(' and before the ')' and dots './portage' in this command. (actually I beleive that GNU tar has the ability to do this with the '-C' flag but i always use this archaic method :roll:

When it's finished (could take a long time) you should see all the contents of /usr/portage in the new automount point /usr/portage_rename.

If it's all good then rename /usr/portage to /usr/portage_todelete
Code:
mv /usr/portage /usr/portage_todelete


edit /etc/auto.direct so it now looks like
Code:
# mount /usr/portage at thishost on /home/usr/portage
# NB you may have to replace localhost by your hostname
/usr/portage         localhost:/home/usr/portage


and reload the automounter
Code:
/etc/runlevels/default/autofs reload

NB reload may not be the correct argument but you can always stop it and then start it for the same effect

If its all ok when you restart and emerge works properly (emerge sync) (try re-emerging something or pick a new ebuild) then you can safley delete the origional dir to freeup space
Code:
rm -rf /usr/portage_todelete



Similar things can be done with other directories in root such as "/opt", I didn't move the whole of the /usr dir as some of the important files are found in /usr/bin or /usr/sbin or /usr/lib or of course you can add another disk, format it and create a mountpoint in /etc/fstab for it called "/renametousr" mount it and copy in the whole of the /usr directory in a similar way as above then when it's all done rename the /usr dir to "/usr_to_delete" and rename the mountpoint "/renametousr" in /etc/fstab to "/usr" and reboot.

If all is OK and commands all work you're good and can delete "/usr_to_delete"

In future try to partition your disks so that the big directories /usr /opt /home and /var are not in the root partition. this way "/" will pretty much stay the same size even as your system gets fatter and more importantly it wont be full so the system will keep running allowing you to fix stuff.

Also it's worth looking at using a volume manager (but I've not done this yet) so that when you need more space in a partition (virtual partition) you can just assign another partition from the same or another disk and create more room.

Hope that helps :wink: [/code]
Back to top
View user's profile Send private message
BlackEdder
Advocate
Advocate


Joined: 26 Apr 2004
Posts: 2588
Location: Dutch enclave in Egham, UK

PostPosted: Tue Dec 21, 2004 4:54 pm    Post subject: Reply with quote

The automounter seems a difficult way of doing things.
I would make a portage dir on /home and then or just make a link form /usr/portage to /home/portage. Or (preferably) tell portage that it should use /home/portage as portage dir (there is a setting in make.conf for that).

But 12 gb should be enough and I would guess cleaning the distfiles and /var/tmp/portage should give you a lot of room
Back to top
View user's profile Send private message
Karl_R
Tux's lil' helper
Tux's lil' helper


Joined: 21 Mar 2004
Posts: 118
Location: Sydney

PostPosted: Tue Dec 21, 2004 5:03 pm    Post subject: Reply with quote

I realise that the automounter is probably overkill but I was just showing a way of shifting stuff from a full partition to another one without screwing up the system

Obviosly if you can just change an a config property that tells the system to look elswhere for stuff that is simpler, the automounter will allow you to move binaries and other comands as well without you needing to edit PATH variables

which is handy!
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Tue Dec 21, 2004 5:35 pm    Post subject: Reply with quote

There is a FAQ Forum entry on cleaning out various directories, at least some of which have already been mentioned.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum