Replacing system disk SSD with identical clone

Issues related to applications and software problems and general support
Post Reply
Eyecon
Posts: 8
Joined: 2020/02/01 23:54:46

Replacing system disk SSD with identical clone

Post by Eyecon » 2021/02/11 17:05:58

Hello,
I'm trying to replace my failing system disk with an identical one without having to reinstall. I cloned the system disk to the new SSD using dd but when I swap the disks, I'm getting a "failed to start udev kernel device manager" and many errors related to "flush journal to persistent storage". I guess I missed a step during the cloning process?

I appreciate any advice on how to properly clone the system disk so I don't have to reinstall my system.


Thanks!

tunk
Posts: 899
Joined: 2017/02/22 15:08:17

Re: Replacing system disk SSD with identical clone

Post by tunk » 2021/02/11 17:25:20

What do you mean by "failing"?
dd may not have been able to correctly copy all parts of your disk.
You could look at ddrescue and see if that works better.

BShT
Posts: 391
Joined: 2019/10/09 12:31:40

Re: Replacing system disk SSD with identical clone

Post by BShT » 2021/02/11 20:12:49

and copy sdX to sdY not sdX1 to sdY1 or... sdYn

Eyecon
Posts: 8
Joined: 2020/02/01 23:54:46

Re: Replacing system disk SSD with identical clone

Post by Eyecon » 2021/02/11 20:59:53

Failing as in the boot fails giving the udev errors I reported earlier. The failing disk has 3 bad sectors(according to the smartctl tools and disk manager) so I did a dd with conv=sync,noerror. I figured the damaged sectors are not being read anyway so cloning the sector for sector should make it possible to swap out disks with no impact.

Eyecon
Posts: 8
Joined: 2020/02/01 23:54:46

Re: Replacing system disk SSD with identical clone

Post by Eyecon » 2021/02/11 21:01:30

BShT wrote:
2021/02/11 20:12:49
and copy sdX to sdY not sdX1 to sdY1 or... sdYn
yes I did dd if=/dev/sdb of=/dev/sde ...so raw copy of everything. I can see that the partition table got copied and obviously the boot sectors since grub loaded the OS. I just can't figure out why I'm getting these udev loading errors.

Eyecon
Posts: 8
Joined: 2020/02/01 23:54:46

Re: Replacing system disk SSD with identical clone

Post by Eyecon » 2021/02/11 21:03:19

Do I need to change anything is /etc/fstab? I assumed the drive installed on the same SATA port will have the same UID so again not sure what's going on other than dd corrupting the data maybe?

User avatar
TrevorH
Forum Moderator
Posts: 30344
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Replacing system disk SSD with identical clone

Post by TrevorH » 2021/02/11 23:34:19

Were you booted from the failing disk at the time you copied it? If so the copy will be corrupt and will require fsck to be run to fix it.
CentOS 6 died in November 2020 - migrate to a new version!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

Eyecon
Posts: 8
Joined: 2020/02/01 23:54:46

Re: Replacing system disk SSD with identical clone

Post by Eyecon » 2021/02/12 00:57:38

Yes I was and that makes sense. Do I run it on each partition or is there a particular way I need to run fsck?

User avatar
TrevorH
Forum Moderator
Posts: 30344
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Replacing system disk SSD with identical clone

Post by TrevorH » 2021/02/12 01:34:39

You'll need to itemise each filesystem and run fsck (for ext3/4) or xfs_repair against the device that contains it. That could be devices or logical volumes or even lujs devices.
CentOS 6 died in November 2020 - migrate to a new version!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

tunk
Posts: 899
Joined: 2017/02/22 15:08:17

Re: Replacing system disk SSD with identical clone

Post by tunk » 2021/02/12 10:53:38

Or you could try to do it again, booting from a live CD/DVD and run dd from there
(doublecheck that you're selecting the correct input and output disks).

Post Reply

Return to “CentOS 8 - General Support”