Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
What can I do to save diskspace on my root partision?
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
EnlightedGnome
Tux's lil' helper
Tux's lil' helper


Joined: 07 Jun 2005
Posts: 126
Location: Denmark, Odense

PostPosted: Tue Aug 09, 2005 4:58 pm    Post subject: What can I do to save diskspace on my root partision? Reply with quote

I'm constantly running out of diskspace on my root partision, so I wondered if anyone had some good advices on how to save some diskspace there? I have an other partision with tons of diskspace, if any idear would include something like moving directories.
_________________
checking for -lifesign in -Kenny... no
- oh my god, they killed Kenny
Back to top
View user's profile Send private message
EzInKy
Veteran
Veteran


Joined: 11 Oct 2002
Posts: 1742
Location: Kentucky

PostPosted: Tue Aug 09, 2005 5:07 pm    Post subject: Re: What can I do to save diskspace on my root partision? Reply with quote

EnlightedGnome wrote:
I'm constantly running out of diskspace on my root partision, so I wondered if anyone had some good advices on how to save some diskspace there? I have an other partision with tons of diskspace, if any idear would include something like moving directories.

You certainly can move things to the other partition, but what to move depends on what it taking up all the space on /. If it's things like large multimedia files, create a multimedia directory, say /porn, there and move all your movies and music there. If its /var or /usr, move them there. You can even copy a whole partition to another with:

Code:

cp -a from_partition to_partition


How you orginize things is totally up to you.
_________________
Time is what keeps everything from happening all at once.
Back to top
View user's profile Send private message
psyqil
Advocate
Advocate


Joined: 26 May 2003
Posts: 2767

PostPosted: Tue Aug 09, 2005 6:08 pm    Post subject: Reply with quote

Moving /usr/portage and /usr/src can save you a lot.
Back to top
View user's profile Send private message
Cinder6
l33t
l33t


Joined: 05 Aug 2004
Posts: 767
Location: California

PostPosted: Tue Aug 09, 2005 6:52 pm    Post subject: Reply with quote

Another idea is to use the -Os CFLAG, which will make your binaries as small as possible. If you copy your root fs to a new partition, I recommend going into a livecd and doing this:
Code:
mkdir /mnt/new
mount /dev/hdxy /mnt/gentoo    #your old partition
mount /dev/hdxy /mnt/new         #your new partition
cp -Rvp /mnt/gentoo /mnt/new

Then you should edit your config files to point to the new partition. Example: /etc/fstab, /boot/grub/grub.conf
_________________
Knowledge is power.
Power corrupts.
Study hard.
Be evil.

Ugly Overload
Back to top
View user's profile Send private message
nephros
Advocate
Advocate


Joined: 07 Feb 2003
Posts: 2139
Location: Graz, Austria (Europe - no kangaroos.)

PostPosted: Tue Aug 09, 2005 6:56 pm    Post subject: Reply with quote

In case you are using ccache with portage, make sure it is configured to use a cache dir different from the default (which is /root/.ccache).
You can set this with the variable CCACHE_DIR.

(I have set this in make.conf and pointing to /var/tmp/ccache which is on another partition.)
_________________
Please put [SOLVED] in your topic if you are a moron.
Back to top
View user's profile Send private message
EnlightedGnome
Tux's lil' helper
Tux's lil' helper


Joined: 07 Jun 2005
Posts: 126
Location: Denmark, Odense

PostPosted: Tue Aug 09, 2005 9:21 pm    Post subject: Reply with quote

When moving big stuff like /usr/src is it right to do it like this?
Code:
#mkdir /somewhere_on_another_partion
#cp -av /usr/src /somewhere_on_another_partion
#rm -Rv /usr/src
#ln -s /somewhere_on_another_partion /usr/src

_________________
checking for -lifesign in -Kenny... no
- oh my god, they killed Kenny
Back to top
View user's profile Send private message
EzInKy
Veteran
Veteran


Joined: 11 Oct 2002
Posts: 1742
Location: Kentucky

PostPosted: Wed Aug 10, 2005 12:50 am    Post subject: Reply with quote

EnlightedGnome wrote:
When moving big stuff like /usr/src is it right to do it like this?
Code:
#mkdir /somewhere_on_another_partion
#cp -av /usr/src /somewhere_on_another_partion
#rm -Rv /usr/src
#ln -s /somewhere_on_another_partion /usr/src


Alternatively you could create a mount point, as is done with /boot, but mounted automatically.

fstab entry example:
Code:

/dev/hdb2   /home   ext3   defaults   0 2

_________________
Time is what keeps everything from happening all at once.
Back to top
View user's profile Send private message
EnlightedGnome
Tux's lil' helper
Tux's lil' helper


Joined: 07 Jun 2005
Posts: 126
Location: Denmark, Odense

PostPosted: Wed Aug 10, 2005 1:00 am    Post subject: Reply with quote

Which is best/most effective, creating a symbolic link or mounting at startup using a fstab entry?
_________________
checking for -lifesign in -Kenny... no
- oh my god, they killed Kenny
Back to top
View user's profile Send private message
EzInKy
Veteran
Veteran


Joined: 11 Oct 2002
Posts: 1742
Location: Kentucky

PostPosted: Wed Aug 10, 2005 3:12 am    Post subject: Reply with quote

EnlightedGnome wrote:
Which is best/most effective, creating a symbolic link or mounting at startup using a fstab entry?

I prefer the using the mount point as Linux is specifically designed to efficiently integrate multiple drives and filesystems into a single hierarchy.
_________________
Time is what keeps everything from happening all at once.
Back to top
View user's profile Send private message
Cinder6
l33t
l33t


Joined: 05 Aug 2004
Posts: 767
Location: California

PostPosted: Wed Aug 10, 2005 6:27 am    Post subject: Reply with quote

EzInKy wrote:
EnlightedGnome wrote:
Which is best/most effective, creating a symbolic link or mounting at startup using a fstab entry?

I prefer the using the mount point as Linux is specifically designed to efficiently integrate multiple drives and filesystems into a single hierarchy.

I second that opinion.
_________________
Knowledge is power.
Power corrupts.
Study hard.
Be evil.

Ugly Overload
Back to top
View user's profile Send private message
psyqil
Advocate
Advocate


Joined: 26 May 2003
Posts: 2767

PostPosted: Wed Aug 10, 2005 11:54 am    Post subject: Reply with quote

EnlightedGnome wrote:
Which is best/most effective, creating a symbolic link or mounting at startup using a fstab entry?
Both, of course, you don't need seperate partitions if you already have a big one. And it's
Code:
ln -s /usr/src /somewhere_on_another_partion
Back to top
View user's profile Send private message
EnlightedGnome
Tux's lil' helper
Tux's lil' helper


Joined: 07 Jun 2005
Posts: 126
Location: Denmark, Odense

PostPosted: Wed Aug 10, 2005 12:22 pm    Post subject: Reply with quote

psyqil wrote:
EnlightedGnome wrote:
Which is best/most effective, creating a symbolic link or mounting at startup using a fstab entry?
Both, of course, you don't need seperate partitions if you already have a big one. And it's
Code:
ln -s /usr/src /somewhere_on_another_partion

from the ln manual pages:
ln [options] source [dest]
_________________
checking for -lifesign in -Kenny... no
- oh my god, they killed Kenny
Back to top
View user's profile Send private message
psyqil
Advocate
Advocate


Joined: 26 May 2003
Posts: 2767

PostPosted: Wed Aug 10, 2005 12:45 pm    Post subject: Reply with quote

EnlightedGnome wrote:
ln [options] source [dest]
Oh, my bad, sorry! :oops: I must have thought of another scenario...
Back to top
View user's profile Send private message
ph03n1x
l33t
l33t


Joined: 06 Feb 2003
Posts: 756

PostPosted: Wed Aug 10, 2005 4:30 pm    Post subject: Reply with quote

You can also try to clean

/usr/tmp/ that freed about 2 gig here :) I have made a cron job now.
/usr/portage/distfiles is usually also taking quite a few hundred mbs
Back to top
View user's profile Send private message
lenbro
n00b
n00b


Joined: 11 Aug 2005
Posts: 5

PostPosted: Thu Aug 11, 2005 3:03 pm    Post subject: RE: moving /usr to new partition Reply with quote

Thanks for making Gentoo forums the best!

Regarding EnlightedGnome's question:

Are the commands for relocating /usr any different if you are copying/moving /usr
to a new partition on a different hard disk?

For instance, what is the right way to move /usr off /dev/hda1 and onto /dev/hdb1 ?
I am concerned that if I do it wrong, I will (once again), hose my wonderful new OS!

Thanx
Back to top
View user's profile Send private message
Cinder6
l33t
l33t


Joined: 05 Aug 2004
Posts: 767
Location: California

PostPosted: Thu Aug 11, 2005 5:49 pm    Post subject: Reply with quote

There isn't really a right way. Just copy it over, then delete the old entries, and update /etc/fstab. If you are changing your root partition, you want to update your bootloader, of cource. For copying, I recommend the -p flag, to insure your permissions are preserved.
_________________
Knowledge is power.
Power corrupts.
Study hard.
Be evil.

Ugly Overload
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