Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 Oct 2008 09:26:55 +1000
From:      Gary Newcombe <gary@pattersonsoftware.com>
To:        "Redd Vinylene" <reddvinylene@gmail.com>, freebsd-questions@freebsd.org
Subject:   Re: Problems moving my jails (mv: Operation not permitted)
Message-ID:  <20081005092655.7e64f180.gary@pattersonsoftware.com>
In-Reply-To: <f1019d520810041327u1cb710ebya0b9de9fa5eaea50@mail.gmail.com>
References:  <f1019d520810041135s509ef5f4tdf9be77b4a3d8df3@mail.gmail.com> <48E7B80F.8040602@gmail.com> <f1019d520810041140t6d6cdb42w94d9696448db406f@mail.gmail.com> <f1019d520810041153p3f7d1058lcea5defdf4f44613@mail.gmail.com> <f1019d520810041156o53cb86c3ua74da1a76cf7c11a@mail.gmail.com> <18663.48601.45230.57747@almost.alerce.com> <f1019d520810041204n276a7dabvd881dab396ac512e@mail.gmail.com> <18663.49808.808955.271579@almost.alerce.com> <f1019d520810041327u1cb710ebya0b9de9fa5eaea50@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 4 Oct 2008 22:27:09 +0200, "Redd Vinylene"
<reddvinylene@gmail.com> wrote:

> On Sat, Oct 4, 2008 at 9:22 PM, George Hartzell <hartzell@alerce.com> wrote:
> > Redd Vinylene writes:
> >  > On Sat, Oct 4, 2008 at 9:02 PM, George Hartzell <hartzell@alerce.com> 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"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20081005092655.7e64f180.gary>