From owner-freebsd-hackers@freebsd.org Tue Jan 31 00:30:58 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61DB6CC75FA for ; Tue, 31 Jan 2017 00:30:58 +0000 (UTC) (envelope-from heisenbug.bala@gmail.com) Received: from mail-it0-x22a.google.com (mail-it0-x22a.google.com [IPv6:2607:f8b0:4001:c0b::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2C3B11914; Tue, 31 Jan 2017 00:30:58 +0000 (UTC) (envelope-from heisenbug.bala@gmail.com) Received: by mail-it0-x22a.google.com with SMTP id k200so25224526itb.1; Mon, 30 Jan 2017 16:30:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=XmhuB0lBiKFaecSLTEtziNWG3E+A+LiRrYhjIqwEEJA=; b=UgUz7TxnIlcMKzcNRkLedX595Ubk1wlXavboTXMWQpYRmwL4UFHBFo++LHd2AjD317 a4mUw1G6OnmjhxhWvTBG2OLgHkaxvIpKdB4VXYk8A/XbnM1erSn99WI1E6WFqTN6sxkn W9LJgc8WVjPrkVgraPcR7wBcDmTAsyf1YDKqNlZmxKEOjLloaf/cgwEZN+GHXBrP+R/r XS3JFTfSoeFnjYWd7y+mZOH13/9ycOWLPc1arQiGJFgdf6bcuKHR9BzribRRl/wdtSPu tmpD/zXWR3KaJWpy9VZkZIXbmkN6kPrYQ0qaHfO1+/WunDAWGmJMbxxpMHsAEMLssD+4 F1fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=XmhuB0lBiKFaecSLTEtziNWG3E+A+LiRrYhjIqwEEJA=; b=ddjCYCIGM2z27v5rOy8UV3PLYLAVusEQxMu51lKx+54DrTCLe9ncSDTiGyv8ZdeNVu ghtwcKBZN9ud/bME03rG0fec3K2Di6QloqASvg1iERs2SV8nMhVU02jK1YGjDSq+jG5x oQRPimbhrsx2Ctie0DKb7FhVzrv+tiTe3c9I8vsweOVIoGSHDUnb2eq6XO8KPI8xOXVH phEdvQZcjUlp9BH4a6Na5LUdeqD4EusfJp4ZV9kvbjuVZW1pJzFXSSYXlcU7RABiGlaX D4k0cMJqu74Kmz1sRBvCFvc3HF2ja/7P8kJaZifYv+WCkzP1lGBhfjegDKvcGHg/HST4 eotw== X-Gm-Message-State: AIkVDXKNOIQJAhN1UzEZQjZHAqsfF2vO19Qq6PpWc7h/JVE5gY+8Paf4rFgN325Dm1iPumvx6ZQhYb454QENZg== X-Received: by 10.36.246.1 with SMTP id u1mr18816078ith.107.1485822657433; Mon, 30 Jan 2017 16:30:57 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.70.84 with HTTP; Mon, 30 Jan 2017 16:30:57 -0800 (PST) In-Reply-To: <1485821962.3017.32.camel@freebsd.org> References: <1485821962.3017.32.camel@freebsd.org> From: Balaji Palaniswami Date: Mon, 30 Jan 2017 16:30:57 -0800 Message-ID: Subject: Re: How to delete read only files. To: Ian Lepore Cc: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 00:30:58 -0000 On Mon, Jan 30, 2017 at 4:19 PM, Ian Lepore wrote: > On Mon, 2017-01-30 at 16:12 -0800, Balaji Palaniswami wrote: > > Hi, > > > > I am trying to delete read only files. > > > > # pwd > > /usr/home/bp/nfsroot/lib > > # whoami > > root > > # ls > > libc.so.7 libcrypt.so.5 libthr.so.3 > > # ls -ltr > > total 3264 > > -r--r--r-- 1 root wheel 1460592 Jan 29 12:07 libc.so.7 > > -r--r--r-- 1 root wheel 51640 Jan 29 12:07 libcrypt.so.5 > > -r--r--r-- 1 root wheel 109568 Jan 29 12:08 libthr.so.3 > > # rm -rf libc.so.7 > > rm: libc.so.7: Operation not permitted > > > > # chmod 777 libc.so.7 > > chmod: libc.so.7: Operation not permitted > > > > Please suggest me some ways to delete these files. > > > > Thanks, > > Balaji > > Those libraries typically have the 'schg' flag set on them, as do some > others in the tree. If you need to wipe everything under nfsroot, the > typical incantation is > > rm -rf nfsroot/ ; chflags -R noschg nfsroot/; rm -rf nfsroot/ > > that deletes everything it can first, then changes the flags on what's > left, then deletes them too. (Doing the noschg first requires > examining/changing 145,000 files.) > > -- Ian > It wiped off all files under nfsroot. Thank you so much for your quick help.