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)

  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 () on

    It's handy:

    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.



    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.

      1. By Mike Gevaert () on

        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.


        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..)


          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 () on

      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.

      1. By Sean () on

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

        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 () on

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

  3. By ViPER () on

    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"
    cd /usr/local
    cvs -q checkout -P -rOPENBSD_3_4 src
    ln -s /usr/local/src /usr/src

    1. By Gerardo Santana Gómez Garrido () santana at on

      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"?

    1. By Dan Brosemer () on

      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.

        1. By Dan Brosemer () on

          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.

    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.


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 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.]