Cloning and permissions [message #25195] |
Mon, 17 December 2007 12:40 |
Peter Machell
Messages: 5 Registered: December 2007
|
Junior Member |
|
|
After cloning a Debian host, I found everything working except MySQL.
I had to chown its binaries, databases and log folder back to mysql
from root.
Is this normal and should I expect other permissions to have changed?
When copying the VZ does the ownership of files take on whatever
matches the UID on the host system?
regards,
Peter.
|
|
|
|
Re: Cloning and permissions [message #25203 is a reply to message #25198] |
Mon, 17 December 2007 14:51 |
Jean-Michel Caricand
Messages: 4 Registered: December 2007
|
Junior Member |
|
|
Le lundi 17 décembre 2007 15:15, Kirill Korotaev a écrit :
> Peter,
>
> It depends on what you mean by "cloning". What exact command/operations
> you did?
>
> BTW, do you mean OpenVZ or Virtuozzo?
>
> Thanks,
> Kirill
>
> Peter Machell wrote:
> > After cloning a Debian host, I found everything working except MySQL.
> >
> > I had to chown its binaries, databases and log folder back to mysql
> > from root.
> >
> > Is this normal and should I expect other permissions to have changed?
> > When copying the VZ does the ownership of files take on whatever
> > matches the UID on the host system?
> >
> > regards,
> > Peter.
Hi Peter,
If you use rsync to copy your VE, you must add this option : --numeric-ids
Cheers.
--
Jean-Michel Caricand
Tél: 03.81.66.20.63
E-mail: jean-michel.caricand@lifc.univ-fcomte.fr
Equipe systèmes
Laboratoire d'Informatique de l'Université de Franche-Comté
16, route de Gray - 25030 BESANÇON CEDEX
|
|
|
|
|
Re: Cloning and permissions [message #25212 is a reply to message #25210] |
Mon, 17 December 2007 23:16 |
Gregor Mosheh
Messages: 62 Registered: April 2007
|
Member |
|
|
Peter Machell wrote:
> vzctl stop xx
> cp -R /vz/private/xx /vz/private/xxx
> cp -R /etc/vz/conf/xx.conf /etc/vz/conf/xxx.conf
> vzctl start xxx
To have cp preserve permissions, use the -p flag.
I use tar instead of cp, for situation like this. Tar, unlike cp, is
smart enough to handle symbolic links, permissions, ownerships, and
sparse files. Use this age-old Unix Jedi trick:
mkdir /home/vz/private/2
cd /home/vz/private/1
tar cf - * | ( cd ../2 ; tar xvf - )
--
Gregor Mosheh / Greg Allensworth
System Administrator, HostGIS cartographic development & hosting services
http://www.HostGIS.com/
"Remember that no one cares if you can back up,
only if you can restore." - AMANDA
|
|
|
|
|
|
Re: Cloning and permissions [message #25261 is a reply to message #25226] |
Wed, 19 December 2007 10:13 |
Peter Machell
Messages: 5 Registered: December 2007
|
Junior Member |
|
|
On 18/12/2007, at 5:14 PM, Jean-Michel Caricand wrote:
>
> Hi Peter,
>
> I think rsync is the best solution to copy a VE :-)
>
> Example :
>
> # rsync -av -numeric-ids /vz/private/101 /vz/private/102 (on the
> same host)
Thanks Jean-Michel that works a treat. You forgot a - though, for the
record the right command (at least on Debian) is:
# rsync -av --numeric-ids /vz/private/101 /vz/private/102
regards,
Peter.
|
|
|