LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 06-29-2015, 12:58 PM   #1
Sum1
Member
 
Registered: Jul 2007
Distribution: Fedora, CentOS, and would like to get back to Gentoo
Posts: 332

Rep: Reputation: 30
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?

Thanks for reading.
 
Old 06-29-2015, 01:43 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,138

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
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
 
Old 06-29-2015, 02:57 PM   #3
Sum1
Member
 
Registered: Jul 2007
Distribution: Fedora, CentOS, and would like to get back to Gentoo
Posts: 332

Original Poster
Rep: Reputation: 30
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.

Thank you for your help.
Greatly appreciated.
 
Old 06-30-2015, 04:16 PM   #4
Sum1
Member
 
Registered: Jul 2007
Distribution: Fedora, CentOS, and would like to get back to Gentoo
Posts: 332

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by smallpond View Post
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.
 
Old 07-01-2015, 01:42 AM   #5
paul2015
Member
 
Registered: Apr 2015
Distribution: CentOS Fedora
Posts: 149

Rep: Reputation: 4
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.

may be this will help you.
 
Old 07-02-2015, 12:01 AM   #6
Sum1
Member
 
Registered: Jul 2007
Distribution: Fedora, CentOS, and would like to get back to Gentoo
Posts: 332

Original Poster
Rep: Reputation: 30
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?

Best regards.
 
Old 07-02-2015, 12:09 AM   #7
paul2015
Member
 
Registered: Apr 2015
Distribution: CentOS Fedora
Posts: 149

Rep: Reputation: 4
I promoted with samba-tool domain provision --use-rfc2307 --interactive you are right may be it was not nesessary.

Yes my friend GPO and everything, database of ad are stored there so i tared everything for good backup.

Last edited by paul2015; 07-02-2015 at 12:11 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell Session Crashing when cat'ing a large file, tar'ing a large file, etc. newmanium2001 Linux - General 3 12-22-2012 10:32 PM
Transferring files from a linux server to a centos machine vineetcornelius Linux - Newbie 8 05-08-2012 07:19 PM
[SOLVED] command for tar'ing multiple sub-directories into a single tar file blainemiller Linux - Server 3 04-21-2011 02:05 PM
[Ruby] Tar'ing or Zip'ing with ruby script lmcilwain Programming 2 01-19-2007 06:56 PM
need help with tar'ing and bz2'ing a file surfbass Linux - General 4 06-01-2005 05:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 04:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration