OpenBSD Journal

Cleaning Up After Patching

Contributed by jose on from the keeping-tidy dept.

almeida writes: "After applying the latest patches and rebuilding the necessary stuff, I discovered that I've exhausted all the space on my /usr partition. df tells me that I have -22602 blocks left and that I'm using 101% of my drive. The negative space is kind of weird, but my real question is what can I safely remove from /usr/src to free up some space? Before I blow away my whole src tree, I figured I'd get some advice from people who know what they're doing. Thanks everyone."

(Comments are closed)


Comments
  1. By Anonymous Coward () on

    If you're low on space, there's no need to keep the entire source tree.

    On the machines where I'm low on diskspace, I just mount a large partition from an nfs server with a freshly unpacked source tree on it, and then apply all patches. After the update, the scratch partition can be wiped again.

  2. By Mike Gevaert () deadly@guarded.org on mailto:deadly@guarded.org

    It's handy:
    http://www.rocketaware.com/man/man8/mount_union.8.htm

    Snip>>
    EXAMPLES
    The commands

    mount -t cd9660 -o ro /dev/cd0a /usr/src
    mount -t union /var/obj /usr/src

    mount the CD-ROM drive /dev/cd0a on /usr/src and then attaches /var/obj on top. For most purposes the effect of this is to make the source tree appear writable even though it is stored on a CD-ROM.

    Snip>>

    MikeG

    Comments
    1. By Anonymous Coward () on

      For me (3.4 release) it worked more like

      mount -o union /dev/wd0e /unionmountpoint

      I.e. union is an option, not a file system type.

      Comments
      1. By Mike Gevaert () deadly@guarded.org on mailto:deadly@guarded.org

        Well, /sbin/mount_union exists, so it's a valid -t type.

        This way you don't have to use a block device like /dev/wd0e, and can use pretty much anything else for the upper layer.

        MikeG

        Comments
        1. By Anonymous Coward () on

          Oh cute, I didn't know this. Thanks.

          Does that mean it is impossible to union-mount different file systems? (I guess so..)

          Regards

          Comments
          1. By tedu () on

            the top layer has to be ffs, since that's the only fs that supports whiteouts. the bottom can be anything.

    2. By Peter Hessler () spambox@theapt.org on http://www.theapt.org

      union mount is still broken on OpenBSD. There is some work being done on it, but its not in-tree. I don't have a copy of it, and I dont' think his code is ready for people to use.

      Comments
      1. By Sean () null-spam@tfh.ca on mailto:null-spam@tfh.ca

        I keep hearing and reading this but there is no detailed information about what is broken in regards to union mounts.

        Comments
        1. By tedu () on

          deadlocks, panics, broken getcwd, the list goes on. maybe it works for you, and maybe it doesn't.

        2. By Dan Brosemer () odin@cleannorth.org on mailto:odin@cleannorth.org

          http://www.monkey.org/openbsd/archive/misc/0302/msg01264.html

          I don't know if that list is still authoritative or not, but it's a good start at least.

  3. By ViPER () viper@dmrt.net on http://www.dmrt.net

    When you have a partition left where you do have the space needed lets say '/usr/local'
    You can just symlink the dir.

    export CVS_RSH="/usr/bin/ssh"
    export CVSROOT=anoncvs@anoncvs.nl.openbsd.org:/cvs
    cd /usr/local
    cvs -q checkout -P -rOPENBSD_3_4 src
    ln -s /usr/local/src /usr/src

    Comments
    1. By Gerardo Santana Gómez Garrido () santana at openbsd.org.mx on http://www.openbsd.org.mx/santana/

      from Makefile:
      "setenv BSDSRCDIR to point to the real location."

  4. By Anonymous Coward () on

    how about remove the object files? is there no "make clean"?

    Comments
    1. By Dan Brosemer () odin@cleannorth.org on mailto:odin@cleannorth.org

      The easiest thing is to make obj when you still have a clean source tree. Then just blow away /usr/obj and make obj again when you want to get rid of the object files.

      That target makes a bunch of directories and symlinks so that building doesn't pollute the /usr/src hierarchy.

      Comments
      1. Comments
        1. By Dan Brosemer () odin@cleannorth.org on mailto:odin@cleannorth.org

          odin@akbar:p1[/usr/obj]$ du -sh .
          287M .

          Might want to give it a little headroom, but that's how big mine is after a build of -current last night.

  5. By Ben () on

    Most Unix systems reserve a little bit of space for the root user - and don't allow any other user to use it. Hence, when you run things as root - you can eat into that reserved space and make the flie system appear over-full.

    Comments
    1. By Anonymous Coward () on

      default is 5% on openbsd, can be changed using tunefs. be sure to man tunefs before playing with this...

    2. By Anonymous Peon () on

      You also risk fragmentation when you dip into that space (well, generally at some point in it, anyway), and while it's exceptionally_not_a_big_deal if the files created are just going to get blown away afterwards, it might leave you a vaguely sad panda.

      (As I understand it, nothing in any BSD's base install will defragment you save a newfs'd partition and copying the data over, but I could be mistaken.)

  6. By Anonymous Coward () on

    My solution, since I placed /usr and / on a 1.3 gig disk, was to link /usr/src to /var/system/src on a seperate disk. This also comes in handy since I keep /usr mounted read only.

Credits

Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original deadly.org with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]