From owner-freebsd-stable@FreeBSD.ORG Fri Jan 27 07:19:38 2006 Return-Path: X-Original-To: stable@freebsd.org Delivered-To: freebsd-stable@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5ADB816A420 for ; Fri, 27 Jan 2006 07:19:38 +0000 (GMT) (envelope-from gmarco@giovannelli.it) Received: from kirk.giovannelli.it (dns01.ablia.net [83.149.160.120]) by mx1.FreeBSD.org (Postfix) with ESMTP id A0F1843D45 for ; Fri, 27 Jan 2006 07:19:36 +0000 (GMT) (envelope-from gmarco@giovannelli.it) Received: from usul.giovannelli.it (freebsd.giovannelli.com [83.149.149.149]) by kirk.giovannelli.it (8.13.4/8.13.4) with ESMTP id k0R7JDmS004194; Fri, 27 Jan 2006 08:19:15 +0100 (CET) (envelope-from gmarco@giovannelli.it) Message-Id: <7.0.0.16.2.20060127075105.0266b6f0@giovannelli.it> X-Mailer: QUALCOMM Windows Eudora Version 7.0.0.16 Date: Fri, 27 Jan 2006 08:14:36 +0100 To: stable@freebsd.org From: Gianmarco Giovannelli Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Milter: Spamilter (Reciever: kirk.giovannelli.it; Sender-ip: 83.149.149.149; Sender-helo: usul.giovannelli.it; ) X-Virus-Scanned: ClamAV devel-20051108/1252/Thu Jan 26 12:03:25 2006 on kirk.giovannelli.it X-Virus-Status: Clean Cc: varie@gufi.org Subject: cpdup, chflags and ext2fs: undeletable forever :-) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2006 07:19:38 -0000 Hi, I have a little problem with chflags and ext2fs partition. My env is : # uname -a FreeBSD multimedia.giovannelli.com 6.0-STABLE FreeBSD 6.0-STABLE #0: Sat Jan 21 22:55:27 CET 2006 gmarco@multimedia.giovannelli.com:/usr/obj/usr/src/sys/FREEBSD i386 I have mounted an ext2fs disk rw and I used part of it for storing a "snapshot" of my / fs. Something like: # mount -t extfs /dev/ad1s1 /mnt/ad1 # mkdir /mnt/ad1/chroot # cpdup -vv / /mnt/ad1/chroot Obviusly cpdup trying to reproduce all the permissions of the srcs file, so also the special flags schg,uchg of some files. The problem is that cpdup was able (or at least seems to be able to set them) but I am not able anymore to remove them :-) So these files are not deletable anymore. One of this file (i.e. rcp) looks in this way: multimedia:/bin# ll -lo rcp -r-sr-xr-x 1 root wheel schg,uchg 18332 Jan 21 09:37 /bin/rcp The copy on the ext2fs look in these other way: multimedia:/mnt/ad1/chroot/bin# ll -lo rcp -r-sr-xr-x 1 root wheel - 18332 Jan 27 07:55 rcp If I try: multimedia:/mnt/ad1/chroot/bin# chflags noschg rcp multimedia:/mnt/ad1/chroot/bin# chflags nouchg rcp multimedia:/mnt/ad1/chroot/bin# chmod 777 rcp multimedia:/mnt/ad1/chroot/bin# ll -lo rcp multimedia:/mnt/ad1/chroot/bin# ll -lo total 20 -rwxrwxrwx 1 root wheel - 18332 Jan 27 07:55 rcp multimedia:/mnt/ad1/chroot/bin# rm -f rcp rm: rcp: Operation not permitted Even running a live linux distro by cdrom seems to be able to remove them anymore giving a strange error 30. Any idea ? I have tried also the obliterate utility from ports which seems able to remove files on ro volume without any results. Probably the only solutions is to newfs the volume but : multimedia:/mnt/ad1/chroot/bin# df -h Filesystem Size Used Avail Capacity Mounted on /dev/ad1s1 275G 254G 7.2G 97% /mnt/ad1 Any idea/tips to remove this folder ? Probably we have to deny the chflags on volume others than ufs even if we can mount them rw ? Best Regards, Gianmarco Giovannelli , "Unix expert since yesterday" http://utenti.gufi.org/~gmarco/