Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Dec 2004 20:43:19 +0100
From:      Kiffin Gish <kiffin.gish@planet.nl>
To:        "'Kevin D. Kinsey, DaleCo, S.P.'" <kdk@daleco.biz>
Cc:        freebsd-newbies@freebsd.org
Subject:   RE: Root directory filling up...
Message-ID:  <000101c4e215$2cdfedc0$9900000a@ZGISH>
In-Reply-To: <41BE0F64.7060303@daleco.biz>

next in thread | previous in thread | raw e-mail | index | archive | help
Wow, that seems like a lot of work. Suppose instead I choose just to
reinstall everything all over again...

What stuff do I need to save and restore later so that I don't have to
reinstall all my applications all over again (Internet, mail, gnome,
x-windows)?

Like the /etc/* , etc. Is there a standard way to do this?

-- 

Kiffin Rex Gish
Gouda, The Netherlands

 


> -----Original Message-----
> From: Kevin D. Kinsey, DaleCo, S.P. [mailto:kdk@daleco.biz]
> Sent: Monday, December 13, 2004 22:54
> To: kiffin.gish@planet.nl
> Cc: Nikolas Britton; freebsd-newbies@freebsd.org
> Subject: Re: Root directory filling up...
> 
> Kiffin Gish wrote:
> 
> > Nikolas Britton wrote:
> >
> >> Kiffin Gish wrote:
> >>
> >>> I recently decided to dump windows and take a much deserved breather
> >>> with
> >>> FreeBSD. So I installed 5.3 and was in for a real treat!
> >>>
> >>> However, I created a /-directory with 4G and installed the complete
> >>> ports
> >>> stuff from the CD. Now my root directory is almost filled up (after I
> >>> installed all the Gnome Desktop stuff).
> >>>
> >>> I always do a make clean. Is there an easier way to only keep the
> ports
> >>> stuff that is 'really' required?
> >>>
> >>> I noticed that there are tons of tarballs etc. in the
> >>> /usr/ports/distfiles
> >>> directory. Is it safe to delete all of these?
> >>>
> >>> Are there any other suggestions to keep my root directory from
> >>> filling up?
> >>>
> >> What do you mean / is filling up? the default during install is to make
> >> 5 partitions /, Swap, /tmp, /var, and /usr.
> >>
> >> See mine for example:
> >> Filesystem     Size    Used   Avail Capacity  Mounted on
> >> /dev/ad0s1a    739M     64M    616M     9%    /
> >> devfs                1.0K    1.0K      0B   100%    /dev
> >> /dev/ad0s1e    739M     15M    665M     2%    /tmp
> >> /dev/ad0s1f     69G     25G     38G    40%    /usr
> >> /dev/ad0s1d    739M     59M    621M     9%    /var
> >> /dev/ad1s1      28G     24G    3.8G    86%    /mnt
> >> linprocfs          4.0K    4.0K      0B   100%
> /usr/compat/linux/proc
> >>
> >> The most you should need for / is 128MB (I think that is default during
> >> install)
> >>
> >>
> >> please sent the output of these commands "df -h", "more /etc/fstab",
> and
> >> "disklabel ad0s1"
> >>
> > bash-2.05b$ df -h
> > Filesystem     Size    Used   Avail Capacity  Mounted on
> > /dev/ad0s4a    3.9G    2.5G    1.1G    70%    /
> > devfs          1.0K    1.0K      0B   100%    /dev
> > /dev/ad0s4d    7.4G    5.9M    6.8G     0%    /home
> >
> > This was the recommended setup according to the book The Complete
> > FreeBSD, but now I realize this is probably not the best choice.
> >
> > bash-2.05b$ more /etc/fstab
> > # Device                Mountpoint      FStype  Options
> > Dump    Pass#
> > /dev/ad0s4b             none            swap    sw              0
> 0
> > /dev/ad0s4a             /               ufs     rw              1
> 1
> > /dev/ad0s4d             /home           ufs     rw              2
> 2
> > /dev/acd0               /cdrom          cd9660  ro,noauto       0
> 0
> >
> > su-2.05b# disklabel ad0s1
> > disklabel: /dev/ad0s1: no valid label found
> 
> 
> That would need to be `disklabel /dev/ad0s4`, then.
> 
> As to the distfiles question, you can safely remove all
> of them as long as you don't mind downloading them
> again if, for some reason, something needs to be
> recompiled.
> 
> Your real problem is that you've got /tmp (temporary
> disposable stuff, generally), /var/ (mail, logs, database
> storage, etc.) and /usr (programs, source, documents,
> the ports tree, the buildworld target directory, etc), all
> in your root partition, which is just barely big enough to
> hold all that stuff unless you do your housekeeping very
> regularly (and thoroughly).
> 
> A possible hack, in case you don't wish to backup and
> reinstall, or learn about growfs(8), [which may be what
> Nick is getting at by asking for disklabel output]:
> 
> Move some stuff to your /home partition, and then
> create symlinks to it from its original location.
> 
> Some candidates:  /tmp, /var/log, /root/, /usr/ports,
> /usr/src, /usr/obj, /usr/local ...
> 
> Now, I can't say which would be best; it depends
> on what's filling up so fast (probably /usr, if you've
> added X, or really many ports at all) and there might
> be some security or other issues I'm not aware of,
> but it's a valid strategy for at least the short term.
> 
> So, let's say we wanted to move the ports tree and
> our source tree to /home.  As root:
> 
> # cd /usr
> # mv ports /home/
> # mv src /home/
> # ln -s /home/ports ports
> # ln -s /home/src src
> 
> Like I said, it's a hack, but it's an available one ;-)
> 
> Another possibility, though it's possibly more
> nerve wracking, would be to do something like this:
> 
> 1.  Drop to single user mode in console.
> 2.  Do something like this:
> 
> change /etc/fstab from:
>     /dev/ad0s4d             /home           ufs     rw
> 2       2
> to:
>     /dev/ad0s4d             /usr           ufs     rw
> 2       2
> 
> Then:
> #mkdir /home/home
> #mv /home/* /home/home/
>    (*note that this will give you one error message,
>     but should still work.)
> #mv /usr/* /home
> 
> and then reboot.  After rebooting, you will need
> to make sure that it's possible to get to /usr/home by
> typing "cd /home", so another symlink would be required.
> Note that I said, this could be scary --- I don't foresee
> any potential problems, but if you've never had
> to recover from a fuzted command using only
> /bin/sh and the contents of /, it can be a hair-raising
> experience.
> 
> Maybe Nick can chime in and say what he thinks;
> [or someone else --- maybe you should've asked the
> questions@freebsd.org mailing list, instead of newbies]
> It might be that growfs isn't that difficult and it is,
> after all, designed for this purpose.
> 
> HTH,
> 
> Kevin Kinsey



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?000101c4e215$2cdfedc0$9900000a>