From owner-freebsd-questions@FreeBSD.ORG Sat Oct 4 23:27:03 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76284106568E for ; Sat, 4 Oct 2008 23:27:03 +0000 (UTC) (envelope-from gary@pattersonsoftware.com) Received: from mail.pattersonsoftware.com (mail.pattersonsoftware.com [121.52.192.10]) by mx1.freebsd.org (Postfix) with ESMTP id 2AE7F8FC15 for ; Sat, 4 Oct 2008 23:27:03 +0000 (UTC) (envelope-from gary@pattersonsoftware.com) Received: from localhost (mail [127.0.0.3]) by mail.pattersonsoftware.com (Postfix) with ESMTP id 2FC9B4B7B5F; Sun, 5 Oct 2008 09:27:02 +1000 (EST) X-Virus-Scanned: amavisd-new at pattersonsoftware.com Received: from mail.pattersonsoftware.com ([127.0.0.3]) by localhost (mail.pattersonsoftware.com [127.0.0.3]) (amavisd-new, port 10024) with ESMTP id ehijb5sFNMz7; Sun, 5 Oct 2008 09:26:57 +1000 (EST) Received: from elegia (60-242-254-180.static.tpgi.com.au [60.242.254.180]) by mail.pattersonsoftware.com (Postfix) with ESMTPSA id 8797D4B7B5B; Sun, 5 Oct 2008 09:26:56 +1000 (EST) Date: Sun, 5 Oct 2008 09:26:55 +1000 From: Gary Newcombe To: "Redd Vinylene" , freebsd-questions@freebsd.org Message-Id: <20081005092655.7e64f180.gary@pattersonsoftware.com> In-Reply-To: References: <48E7B80F.8040602@gmail.com> <18663.48601.45230.57747@almost.alerce.com> <18663.49808.808955.271579@almost.alerce.com> Organization: Patterson Software X-Mailer: Sylpheed 2.5.0rc2 (GTK+ 2.12.12; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Subject: Re: Problems moving my jails (mv: Operation not permitted) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Oct 2008 23:27:03 -0000 On Sat, 4 Oct 2008 22:27:09 +0200, "Redd Vinylene" wrote: > On Sat, Oct 4, 2008 at 9:22 PM, George Hartzell wrote: > > Redd Vinylene writes: > > > On Sat, Oct 4, 2008 at 9:02 PM, George Hartzell wrote: > > > > > > > > If you do an ls -lo /home/jail/box/usr/bin/chpass, you'll probably see > > > > the schg flag set. Man chflags for more info and instructions on how > > > > to unset it > > > > > > > > g. > > > > > > > > > > Yes: > > > > > > -r-sr-xr-x 6 root wheel schg 18468 Aug 2 19:47 /usr/jail/box/usr/bin/chpass > > > > > > So I'd simply have to "chflags noschg /usr/jail/box/usr/bin/chpass" > > > and then "cp /usr/jail/box/usr/bin/chpass > > > /home/jail/box/usr/bin/chpass"? > > > > I think that you ought to be able to cp it as is. You're just not > > allowed to change the original (e.g. remove it), which is why your mv > > and rm failed. > > > > g. > > > > I've been told that changing flags might seriously mess things up. Is > there any way to copy the remaining files from /usr/jail into > /home/jail, or do I have to rebuild everything from scratch? Try copying the jail first as follows to retain permissions: stop the jail mkdir /usr/jail/newjail cd /usr/jail/origjail tar -cpf - . | tar -C /usr/jails/newjail -xpf - (don't worry about sockets not copying) If you want to copy the jail, change hostname, delete ssh public keys and change any other info pertinent to the jail. I just grep the hostname and ip in /etc and /usr/local/etc. Test the jail. It should work fine. If you want to remove the original jail, chflags -R noschg origjail rm -rf /usr/jail/origjail Ezjail really is very good too. You can convert your existing jails into the ezjail framework easily. Gary > > Much obliged. > > -- > http://www.home.no/reddvinylene > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"