From owner-freebsd-questions@FreeBSD.ORG Sun May 18 04:14:26 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 93DBB37B407 for ; Sun, 18 May 2003 04:14:24 -0700 (PDT) Received: from mail.munk.nu (213-152-51-194.dsl.eclipse.net.uk [213.152.51.194]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7FDC743FAF for ; Sun, 18 May 2003 04:14:21 -0700 (PDT) (envelope-from munk@mail.munk.nu) Received: from munk by mail.munk.nu with local (Exim 4.20) id 19HM7Q-000PsR-0M for FreeBSD-questions@FreeBSD.org; Sun, 18 May 2003 12:14:20 +0100 Date: Sun, 18 May 2003 12:14:19 +0100 From: Jez Hancock To: FreeBSD Questions Message-ID: <20030518111419.GA99297@users.munk.nu> Mail-Followup-To: FreeBSD Questions References: <20030518110213.GA88040@dds.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030518110213.GA88040@dds.nl> User-Agent: Mutt/1.4.1i Sender: User Munk Subject: Re: problem removing directory X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2003 11:14:26 -0000 On Sun, May 18, 2003 at 01:02:13PM +0200, Alex de Kruijff wrote: > Hi, > > I wanted to move /var/tmp to /tmp and symlink it for security reasons. > I move /var/tmp to /var/tmp-old and copied the files to /tmp and them > symlink /var/tmp to /tmp. So far so good. > > However, now i am unable to remove one directory and need some help in > removing this. > > Intranet# ll > total 1 > dr-xr-xr-x 2 root wheel 512 Mar 16 22:04 empty/ > Intranet# pwd > /var/tmp-old/temproot/var > Intranet# ll > total 1 > dr-xr-xr-x 2 root wheel 512 Mar 16 22:04 empty/ > Intranet# rm -rf * Try: chflags -R noschg * in /var/tmp/ Presumably you ran mergemaster at some point which creates the /var/tmp/temproot hierarchy and sets some system 'immutable' flags on some of the files in there to stop them being modified. Running 'chflags noschg' removes the immutable flag. For more info, man chflags and man ls Specifically try ls -loR /var/tmp/ For example on my system: [12:13:19] munk@users /home/munk# ls -lo /kernel -r-xr-xr-x 1 root wheel schg 3132649 Apr 18 14:42 /kernel you can see the 'schg' flag is set on kernel to stop it being modified. Jez