LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 03-10-2022, 10:47 AM   #1
anthonym01
LQ Newbie
 
Registered: Mar 2022
Posts: 2

Rep: Reputation: 0
Using dd to clone a CentOS 5 disk (best options)


Hi,

I am using dd to clone a CentOS 5 physical server with the command:
dd if=/dev/hda of=/dev/sdb

When booting the cloned drive, I am getting the error:
mount: could not find filesystem /dev/root

Anything special I should be using with the dd command, or should I be using a different method to clone the disk?
The server is from 10 years ago and the disk I am trying to clone it to a disk that is a lot newer (if that makes a difference).

Thanks in advance
 
Old 03-10-2022, 07:28 PM   #2
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,718

Rep: Reputation: 2734Reputation: 2734Reputation: 2734Reputation: 2734Reputation: 2734Reputation: 2734Reputation: 2734Reputation: 2734Reputation: 2734Reputation: 2734Reputation: 2734
Once you have cloned the drive, you might need to adjust the grub configuration on that new drive so that it is not looking for the original drive.

More detail about what you are trying to accomplish may be critical.

Are you moving it to a new hardware platform?
Do you have a rescue CentOS-5 media on USB or CD? If so, that might be used to correct that drive.
 
Old 03-10-2022, 07:36 PM   #3
suramya
Member
 
Registered: Jan 2022
Location: Earth
Distribution: Debian
Posts: 249

Rep: Reputation: 102Reputation: 102
Also, you should boot from a Live disk before cloning a disk that has a bootable OS on it. Else you would get errors when booting from the copy as some of the files could have changed during the copy. If the copy is connected to the same computer as the original disk, then you might have a conflict as the UUID of the partitions on both drives will be the same. You can try changing it: https://www.tecmint.com/change-uuid-...tion-in-linux/
 
Old 03-10-2022, 08:31 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,009

Rep: Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629
dd is useful for exact to exact. It is not really good for other uses.

I might be tempted to use clonezilla or other cloning tool that can check for data.

Be sure you don't mess up which is which on this.

Once cloned you may have to fix sizes like partition sizes. Remember that some older stuff can't use some CHS numbers and drive sizes.

Be sure to boot the cloned in same situation as original as in remove original and swap this clone.
 
Old 03-11-2022, 09:22 AM   #5
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,718

Rep: Reputation: 2734Reputation: 2734Reputation: 2734Reputation: 2734Reputation: 2734Reputation: 2734Reputation: 2734Reputation: 2734Reputation: 2734Reputation: 2734Reputation: 2734
I would use CLONEZILLA (the tool MADE for this purpose) to image the drive to remote storage. Boot a USB device or CD with a CLONEZILLA distro image on it so your source drive is totally idle and unmounted.

Once this is done, you can use the same CD/USB to restore that remote image to one or more different devices or drives.

I have used this concept to clone a prime server to create an entire server farm (although for that use it was less than simple). Beware of changing/duplicating UUID or labels, and you may have to do a GRUB recovery on the resulting drives.
 
Old 03-17-2022, 06:54 PM   #6
anthonym01
LQ Newbie
 
Registered: Mar 2022
Posts: 2

Original Poster
Rep: Reputation: 0
Hi All,

Thanks for the input.
The disks are lvm, so /etc/fstab does not identify them with uids.
Would I still need to update the uids elsewhere?
I am not moving the disks to new hardware.

Thanks
 
Old 03-18-2022, 03:46 AM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,989

Rep: Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337
did you try to dd (copy) your living system?
how did you try to boot the second drive?
 
Old 03-21-2022, 09:05 PM   #8
Linux_Kidd
Member
 
Registered: Jan 2006
Location: USA
Posts: 737

Rep: Reputation: 78
One disk, or an array?
Are the new disks same type (sata, other, etc)?
Are the new disks in same metal hardware?

Last edited by Linux_Kidd; 03-21-2022 at 09:06 PM.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Clone and boot from clone geelsu Linux - Server 5 12-17-2018 12:03 PM
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

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

All times are GMT -5. The time now is 12:16 AM.

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