LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-14-2018, 07:46 AM   #1
geelsu
LQ Newbie
 
Registered: Apr 2004
Location: Maryland, USA
Distribution: RHEL 5,6
Posts: 21

Rep: Reputation: 0
Clone and boot from clone


Hey. I've done this in the past, the very far past, and now I find myself back in the Linux world after many years. I need help with remember all the steps for cloning and then booting from a clone.

I have:

/dev/sda1 boot
/dev/sda2 / (root)
/dev/sda3 /home

I want to clone and boot from and have other data on:
/dev/sdc1 boot
/dev/sdc2 / (root)
/dev/sdc3 /home

I know I will need to point grub to /dev/sdc and probably fix fstab. If have completed the fdisk setup of /dev/sdc. Seems I remember sfdisk being used, as well as dd. Any input would be greatly appreciated.

This is a CentOS 5.8 installation.
 
Old 12-14-2018, 08:52 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626
There may be a Centos way to clone so you should read their (RH/IBM) documentation.

I guess one could use any number of file based copy means. Each one tends to need a live boot usually. There is at least one live state linux backup but I've never used it.
Things like rsync, tar, cpio partimage and gparted as well as others could copy usually.

dd is a tool that can be used to clone off a number of parts of a drive or entire drive. It's not an elegant way and has some issues.


As in most cases you have to fix all naming from grub to disk mounting to network naming either before clone or after.
 
Old 12-15-2018, 01:11 AM   #3
dc.901
Senior Member
 
Registered: Aug 2018
Location: Atlanta, GA - USA
Distribution: CentOS/RHEL, openSuSE/SLES, Ubuntu
Posts: 1,005

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Also look at dump/restore (or xfsdump/xfsrestore depending on filesystem type).
I have used this and it works! Yes, you will have to update fstab.

If you are going to keep sda installed in the server then update menu.lst otherwise you will have to install GRUB bootloader to the MBR (on sdc disk).
 
Old 12-15-2018, 02:22 AM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by geelsu View Post
I know I will need to point grub to /dev/sdc and probably fix fstab.
sounds about right; you need to point it to the correct partitions. i recommend using UUIDs.
any plain text editor will do for that.

why such an old, outdated version of centos?
 
Old 12-17-2018, 06:07 AM   #5
geelsu
LQ Newbie
 
Registered: Apr 2004
Location: Maryland, USA
Distribution: RHEL 5,6
Posts: 21

Original Poster
Rep: Reputation: 0
Thanks all for you responses. I appreciate it. The purpose of the clone was to do an update on the clone and preserve the original boot disk. I was told that by a vendor that he had used yum update to take an older version of Linux, like 5, straight to 7. I have serious doubts that this kind of update would actually work ... but I wanted to try it. There are a lot of warnings online about doing such and it is not supported anywhere that I can find. The goal though is to update the older version of CentOS either by updating the clone or a new/clean install.
 
Old 12-17-2018, 12:03 PM   #6
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Quote:
Originally Posted by geelsu View Post
Thanks all for you responses. I appreciate it. The purpose of the clone was to do an update on the clone and preserve the original boot disk. I was told that by a vendor that he had used yum update to take an older version of Linux, like 5, straight to 7. I have serious doubts that this kind of update would actually work ... but I wanted to try it. There are a lot of warnings online about doing such and it is not supported anywhere that I can find. The goal though is to update the older version of CentOS either by updating the clone or a new/clean install.
Gotta wonder which vendor told you that...

Having just done it, I can verify the only way to get from 5.8 to 7.x is with a clean install. Afterwards, you can copy the data (/home) over and use your backup of the various config files to update the new config files...NOT recommending you copy them over, however. There are some significant changes in the apache configuration, for example.

Also, 5.x is SystemV init; 7.x is SystemD -- major change!
 
  


Reply

Tags
boot grub efi, clone



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Open-spec SBC is a clone of a clone of a clone of a Raspberry Pi 3 LXer Syndicated Linux News 0 04-25-2018 04:56 PM
Linux 64 bit fresh install, created clone on cd, want to use clone on another laptop... apollo1980 Linux - Software 12 10-12-2017 02:59 PM
I need to Clone a Red Hat drive and install clone in HP server drummer54 Linux - Newbie 14 03-07-2009 04:15 PM
bugzilla: to clone, or not to clone? The00Dustin Linux - Newbie 1 05-24-2008 05:19 AM
/boot/boot/boot/boot/boot/ muddywaters SUSE / openSUSE 1 09-10-2005 06:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12: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