moving /var & symlink to /usr/var isn't working, now broke mysql

Matthew Seaman m.seaman at
Wed May 12 10:52:51 PDT 2004

On Wed, May 12, 2004 at 08:54:08AM -0700, carvin5string wrote:
> rm -rf /var

> I am using FreeBSD-5.2. Everything works except the rm -rf /var, I get
> a 
> message that it is not empty. I look in /var and see a subdirectory
> called empty, which is empty. But I cannot delete it. 

See chflags(1) -- /var/empty has had the 'schg' flag applied to it to
make it immutable.  You can see that by:

    % ls -ldo /var/empty
    dr-xr-xr-x  2 root  wheel  schg 512 Jun 25  2002 /var/empty/

Now, to get rid of the schg (or any other) flag you need to run:

    # chflags -R 0 /var/empty

however that will only work at a low securelevel.  If you have raised
the securelevel -- ie if:

    # sysctl kern.securelevel

tells you securelevel is anything other than '-1' or '0' then you will
need to reboot the system into single user mode in order to do that.

Also see init(8) where the details of securelevel settings are



Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP:         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url :

More information about the freebsd-questions mailing list