Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Short of space on / partition
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Duplicate Threads
View previous topic :: View next topic  
Author Message
nichocouk
Guru
Guru


Joined: 10 Mar 2005
Posts: 585
Location: Glasgow

PostPosted: Fri Oct 28, 2005 9:29 am    Post subject: Short of space on / partition Reply with quote

Hello,

I seem to run short of space on my / partition:
Code:
# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/hda5             7.4G  6.0G 1023M  86% /
udev                  251M  136K  251M   1% /dev
/dev/hda6             9.2G  5.6G  3.2G  65% /usr
/dev/hda8              19G   14G  3.6G  80% /home
none                  251M     0  251M   0% /dev/shm


I'm quite surprised because I have another Gentoo box which is using 1.2G only in the / partition. The 2 boxes are not exactly the same, but still I'd expect to have roughly similar figures.
Anyway, I'm thinking of booting on the LiceCD and switching the / and the /usr partition. This should leave me with ~ 3.2 G available on the / and ~ 1.8 G on the /usr. Would that be a good idea?
It's actually the second time I'm doing something like this, my first experience is described here. In short I had to switch my /usr and /home partitions.
It's probably the last time I can use this trick because if I ever run short of space again, I will have to resize my partitions (they are ext3). Is that possible to resize partitions without loosing files?

Cheers,
_________________
nichocouk

L'Etat, c'est moi.
Back to top
View user's profile Send private message
DDV01
n00b
n00b


Joined: 08 Jul 2003
Posts: 70
Location: The Netherlands

PostPosted: Fri Oct 28, 2005 9:40 am    Post subject: Reply with quote

Perhaps you could clean out /usr/portage/distfiles?
Back to top
View user's profile Send private message
fangorn
Veteran
Veteran


Joined: 31 Jul 2004
Posts: 1886

PostPosted: Fri Oct 28, 2005 9:47 am    Post subject: Reply with quote

AFAIK it is possible to resize partitions (for example with parted or its gui frontends like qtparted).

But first I would check for cleanup possibilities (/tmp and /var/tmp, no longer used kernel sources in /usr/src, ...). Also you could move /usr/portage/distfiles to another directory and define this in /etc/make.conf as portage mirror and do a "emerge -ef world" to only copy the distfiles needed in the moment to /usr/portage/distfiles. Or if you dont do recompiles or fresh installations frequently you could delete distfiles completely, because updates will be loaded automatically from the mirrors. This resulted in 2.4 GB free space for me once :wink:

Edit:
too slow again :cry:
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Fri Oct 28, 2005 9:52 am    Post subject: Reply with quote

Safe portage cleanup command (as long as you're not emerging an ebuild while you run it):
Code:
rm -rf /var/tmp/portage/* && rm -rf /usr/portage/distfiles/*
Back to top
View user's profile Send private message
nichocouk
Guru
Guru


Joined: 10 Mar 2005
Posts: 585
Location: Glasgow

PostPosted: Fri Oct 28, 2005 10:47 am    Post subject: Reply with quote

OK, thanks everyone for your answers.
Actually I should have mentioned that I've been doing this (cleaning directories) about once a day for the past couple of days. I have a script that I run at least once a week (except that now I have to run it more often) to clean everything:
Code:

# User-specific directories
rm -Rf ~nic/.Trash/*
find ~nic/ -name "*~" -exec rm {} \;
find ~nic/ -name ".*~" -exec rm {} \;
find ~nic/ -name "*.old" -exec rm {} \;

# Global directories
rm -Rf /var/tmp/portage/*
find /tmp/ -mtime +30 -type f -not -name .keep -exec rm {} \;
find /usr/portage/distfiles/ -mtime +30 -type f -exec rm {} \;

# log files
# Find old compressed logs (older than one month) and remove them
find /var/log/ -mtime +30 -name "*.bz2" -exec rm {} \;
# Find old logs (older than 48 hours) and bzip them
find /var/log/ -mtime +2 -type f -not -name "*.bz2" -not -name .keep -not -name .timestamp -exec bzip2 -z {} \;


I've actually just added the line for distfiles. I've chosen to keep the most recent files (less than a month old) to save bandwidth in case of recompiles, although I don't do it too often. Running this command brings now my /usr partition to 4.5 G used (instead of 5.6). :)

I've cleaned /var/tmp/portage several times, and /var/tmp does not have anything else atm.
I always keep 2 kernels in my /usr/src in case something goes wrong with the one I'm running.
I'm actually not to keen to move /usr/portage/distfiles out of /usr as I still have room there but not in /

So I think I've already done quite a lot for cleaning directories. That's why I feel stuck now with my / filling up. It reaches very quickly 100% of disk usage, and for example I wanted to emerge openoffice2 this morning but it failed because there was no space left on the device. Had to opt for the bin version.
_________________
nichocouk

L'Etat, c'est moi.
Back to top
View user's profile Send private message
nichocouk
Guru
Guru


Joined: 10 Mar 2005
Posts: 585
Location: Glasgow

PostPosted: Fri Oct 28, 2005 11:09 am    Post subject: Reply with quote

About parted. This looks nice but I'd be happy to have some advice. AFAIK to resize a ext2/ext3 partition, whatever the tool is, one has to keep the start of the partition fixed. Now I have the following configuration:
Code:

hda5          /
hda6          /usr
hda7          swap
hda8          /home


Assuming I want to increase the hda5 partition, the only thing I can see is to decrease the /usr partition size, therefore I would need to move the start of the hda6 partition.
Now I removed all the /usr/portage/distfiles files, which brings me to this:
Code:
# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/hda5             7.4G  6.0G  1.1G  86% /
udev                  251M  136K  251M   1% /dev
/dev/hda6             9.2G  4.1G  4.7G  47% /usr
/dev/hda8              19G   14G  3.6G  80% /home
none                  251M     0  251M   0% /dev/shm

To decrease the /usr partition, having to move the start of this hda6 partition, implies that I copy all the /usr files somewhere before doing this, otherwise I loose them. Where can I put 4.1 G on my hard drive ?
_________________
nichocouk

L'Etat, c'est moi.
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Fri Oct 28, 2005 11:32 am    Post subject: Reply with quote

nichocouk wrote:
hda5 /
hda6 /usr
hda7 swap
hda8 /home

If you end up having to repartition totally, then I would recommend scrapping the separate /usr and /home partitions, when you have so little space available anyway - they just create more artificial space restrictions.
Back to top
View user's profile Send private message
syg00
l33t
l33t


Joined: 23 Aug 2004
Posts: 907
Location: Brisbane, AUS

PostPosted: Fri Oct 28, 2005 11:54 am    Post subject: Reply with quote

wtf ??? - have a look at /home !!!!
Way more than half the total allocation - piss off some of that crap, and you'll have plenty to play with.

Maybe even get radical, and archive some of it to DVD for a while.

Sheesh ...
Back to top
View user's profile Send private message
nichocouk
Guru
Guru


Joined: 10 Mar 2005
Posts: 585
Location: Glasgow

PostPosted: Fri Oct 28, 2005 11:55 am    Post subject: Reply with quote

Yeah, it looks more and more likely that I'll have to redesign the partitions. It's a shame because I've reached 99.9% of my time quota!
Anyway, maybe someone could also advise me on something to redo the partitioning. What are the advantages / disadvantages of different methods? In the Gentoo handbook they use fdisk, but man fdisk says cfdisk is actually better. How does (c)fdisk compare to parted?
_________________
nichocouk

L'Etat, c'est moi.
Back to top
View user's profile Send private message
syg00
l33t
l33t


Joined: 23 Aug 2004
Posts: 907
Location: Brisbane, AUS

PostPosted: Fri Oct 28, 2005 12:14 pm    Post subject: Reply with quote

My number one rule is "don't fuck with partitions without good backup".
I always have two backups - on separate media.

{c}fdisk only change the partition definition - i.e. the start and extent (size) in sectors.
They do *NOT* accomodate changes to the filesystem contained there-in. This is especially important to remember when shrinking a partition.

Parted is supposed to work, but I have had failures on ext3 - gparted is supposed to be better.

Personally I back it all up, delete and redefine partitions as needed, and restore.

Simple and known to work.
Both desirable attributes when your data is potentially at risk.
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 18070

PostPosted: Fri Dec 23, 2005 4:16 am    Post subject: Reply with quote

See the FAQ Forum entry regarding disk space.
_________________
Those who know what's best for us must rise and save us from ourselves.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Duplicate Threads 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