[Samba] Cloning Samba equipped VM

L.P.H. van Belle belle at bazuin.nl
Tue Dec 15 08:10:14 UTC 2020


# Clone VM to new copy. 
1. ok, as your showed 
2. ok, as your showed
3. cleanup /var/(lib/cache)/samba/* 
   Clean/clear all logs in /var/log 
4. rgrep oldhostname /etc/* 
   Change hostnames where needed. 
5. reboot. 
   Check : hostname -f, hostname -d, hostname -s outputs. 
6. change/verify /etc/samba/smb.conf
7. join samba again. 
8. reboot
9. verify logs. 
10. get coffee your done. 


# Example clone exact as is to "move" an os from old to new hardware. 

1. install rsync on both servers. 
2. down all services on both servers execpt ssh. 
3. install a minimal OS, as minimal as possible, but the same as the old one. 
4. login in destination server.
5. run:   

rsync -auHxv –numeric-ids –exclude=/etc/fstab –exclude=/etc/network/* –exclude=/proc/* –exclude=/tmp/* –exclude=/sys/* –exclude=/dev/* –exclude=/mnt/* –exclude=/boot/* –exclude=/root/* root at SRC-HOST-IP:/* / 

verify any udev rules for you nic. 
reboot, check logs, but should be ok now. 

Thats how i recently moved a full server from old hardware to new(er) hardware.

Greetz, 

Louis



> -----Oorspronkelijk bericht-----
> Van: samba [mailto:samba-bounces at lists.samba.org] Namens Paul Paku via
> samba
> Verzonden: maandag 14 december 2020 22:04
> Aan: samba at lists.samba.org
> Onderwerp: [Samba] Cloning Samba equipped VM
> 
> Hi,
> 
> I would like to smoothly clone VM running Samba.
> As I understand there have to be a kind if machine ID which became
> duplicated in such a case.
> Are there any command to clear cloned VM data so it will advertise itself
> as virgin new one?
> 
> My ideal scenario would be to:
> 
>   1.  Clone Samba to new Copy
>   2.  Run, network isolated, Copy
>   3.  Perform magic cleaning
>   4.  Change Copy name and IP
>   5.  Connect network and join AD as new VM.
> 
> What should I do in step 3?
> 
> Paku.
> 
> 
> --
> To unsubscribe from this list go to the following URL and read the
> instructions:  https://lists.samba.org/mailman/options/samba





More information about the samba mailing list