Tar'ing CentOS installation and transferring it to new server
CentOSThis forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Fedora, CentOS, and would like to get back to Gentoo
Posts: 332
Rep:
Tar'ing CentOS installation and transferring it to new server
Current Installation: CentOS 7.1503 with SerNet Samba 4 ver. 4.1.17 configured as Active Directory Domain Controller.
Current Installation: HP Workstation with dual Xeon quadcore cpu's and 4 x SATA hard drives NOT configured in RAID array.
New Installation: CentOS 7.1503 minimal install
New Installation: SuperMicro with single Xeon quadcore cpu and 4 x SATA hard drives configured in two pairs of RAID 1.
The Current Install is about 3.5 GB's and has my Samba 4 setup all solid and working well. I want to know if it's possible to simply:
- tar up the whole root partition
- put it on a USB drive
- boot the New server with a livecd and unpack the tar'ed root (/) from the USB drive into the New server root (/) filesystem.
Both installs used the automatic partitioning from anaconda, so /boot is on a separate partition and has a working initrd and kernel on each computer. Both CentOS installs are setup using the xfs filesystem on the root (/) partition.
I saw someone do it successfully once but they left out certain directories like /srv , /tmp , and /var.
But I'm not 100% certain which directories need to be left out of the tarball.
Has anyone done this before?
Do you know if it's doable?
Directories to skip should be at least: /proc /sys /dev /tmp /var
There are a bunch of things to worry about when saving and restoring tar formats. Consider links, path and name length, timestamps, owners and attributes, sparse files, etc: http://www.gnu.org/software/tar/manu...71.html#SEC138
Distribution: Fedora, CentOS, and would like to get back to Gentoo
Posts: 332
Original Poster
Rep:
Thank you, SmallPond! :-)
I'm reading through the tar link, very informative, and many issues I've overlooked.
But, I think it may work well because of the simplicity of my installation --
There's only one posix user account besides root, thus almost all files on the system are user: root group: root.
I'll be using the same version of tar on both the Current Installation and the New Installation.
All other user data will be mounted on the other set of hard drives and not a part of the base installation I'm un-tarring into (/).
I'll also update each server install prior to transfer so all base install items on both match x.y.z to x.y.z.
Distribution: Fedora, CentOS, and would like to get back to Gentoo
Posts: 332
Original Poster
Rep:
Quote:
Originally Posted by smallpond
Directories to skip should be at least: /proc /sys /dev /tmp /var
After some review of the directories mentioned, I think it's necessary to include /var .
Critical parts of the samba 4 installation are stored under /var/lib/samba .
Without it, there's no more Active Directory Domain Controller, and I definitely want to avoid re-provisioning a new/different AD DC.
I have inatalled samba on centos 7 DC with server 2008 domain/forest functional level. I have tested that if one day it will die how do I recover. I saved smb.conf kerb5.conf, nsswitch.conf, hosts, resolve.conf, /etc/default/samba.conf files then tarred /var/lib/samva with cvpf options. on new server installed samba again promoted ad dc with same domain name raised domain/forest level it was installed with internal samba dns and made same installation restored config files than untarred /var/lib/samba and everything was working. sysvol and gpo was in /var/lib/samba.
Distribution: Fedora, CentOS, and would like to get back to Gentoo
Posts: 332
Original Poster
Rep:
Paul, thank you for sharing your restore procedure.
It looks very efficient too.
I have a question about the part where you promoted AD DC with same domain name.
Why did you need to do this?
And what commands did you use to do it?
Is that part necessary if you copied everything from the original provisioned AD DC?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.