From owner-freebsd-questions Thu Jan 30 23:46:25 2003 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 2D9F937B401 for ; Thu, 30 Jan 2003 23:46:24 -0800 (PST) Received: from ei.bzerk.org (ei.xs4all.nl [213.84.67.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id E2CBE43F79 for ; Thu, 30 Jan 2003 23:46:18 -0800 (PST) (envelope-from fbsd-q@bzerk.org) Received: from ei.bzerk.org (BOFH@localhost [127.0.0.1]) by ei.bzerk.org (8.12.6/8.12.6) with ESMTP id h0V7lgJi071312; Fri, 31 Jan 2003 08:47:42 +0100 (CET) (envelope-from stable@ei.bzerk.org) Received: (from stable@localhost) by ei.bzerk.org (8.12.6/8.12.6/Submit) id h0V7ld18071311; Fri, 31 Jan 2003 08:47:39 +0100 (CET) Date: Fri, 31 Jan 2003 08:47:39 +0100 From: Ruben de Groot To: bastill@adam.com.au Cc: Lowell Gilbert , freebsd-questions@FreeBSD.ORG Subject: Re: Ooops. Message-ID: <20030131074739.GA71255@ei.bzerk.org> References: <005601c2c8c5$47735b10$6501a8c0@grant> <1043981504.3e39e4c0b6e66@webmail.adam.com.au> <44znpinhl7.fsf@be-well.ilk.org> <1043983614.3e39ecfecd509@webmail.adam.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1043983614.3e39ecfecd509@webmail.adam.com.au> User-Agent: Mutt/1.4i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, Jan 31, 2003 at 01:56:54PM +1030, bastill@adam.com.au typed: > Quoting Lowell Gilbert : > > > bastill@adam.com.au writes: > > Can you explain what you think is a problem? > > Well - it's happened to two uf us in the past month! > In both cases the operator was copying files from one drive to another and > wished to delete files from the second drive on which the copy resided. In > both cases rm -rf removed both copy AND source! :-( > > In my case I was setting up a larger hard drive from a smaller one using > dump/restore, partition by partition. I had just completed copying one smallish > partition and began copying the next, larger partition having forgotten to > change directories. Naturally I soon ran out of room. ("Bother", said Pooh). > No problem, I'll delete the wrongly copied directories from that smaller > partition, move to the larger one, and try again. Unfortunately, rm -rf home > removed home from the source /usr directory as well! :-( I presume that this > was due to /home being a symlink to /usr/home, and somehow that link remained, > so that -r referred to everything below the symlink as well as to the directory > I was trying to remove. > > Whatever the explanation, IMHO rm -r should NOT do this by default. The manpage rm(1) says: The rm utility removes symbolic links, not the files referenced by the links. So what you describe shouldn't have happened. There is one case where removing symlinks can be confusing: rm -rf /home # removes only the symbolic link rm -rf /home/ # removes directory tree /home is linked to So what were the exact commands you issued? > > -- > Brian > > > > ----------------------------------------------- > This message sent through Adam Internet Webmail > http://www.adam.com.au > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message