T
T
Talyan2019-12-26 22:25:02
linux
Talyan, 2019-12-26 22:25:02

How to painlessly clone a Linux SSD to another SSD?

Good evening, forum users.
A problem has arisen - I can not clone my home SSD (WD 120Gib) to another SSD (Intel 12 8 Gib) for work.
Note - on the second disk, where the cloning takes place, there is even more space.
The donor has 118 gigs of /dev/sda1 and 2 gigs of swap.
On the recipient - stupidly empty unallocated space 128 gigs.
I clone like nothing ever happened:

sudo fdisk /dev/sdb
>d (удаляю раздел)
>w (пишу)
sudo ddrescue -f /dev/sda /dev/sdb

Everything is copied quickly in 10 minutes.
And ..
Nothing is loaded, climbs out (initramfs).
5e050ae12806f365301139.jpeg
I execute fsck /dev/sda1 in it on his own advice and everything is OK:
5e050af54e035362790490.jpeg
And the system boots perfectly from the second disk, like the first one, only faster.
The problem fell out here:
I’m booting from the first home SSD to run GParted, and delete the swap on the second, larger working disk, which I didn’t give up at work, because the RAM at the workplace is dozupy, and the swap is useless.
Great - I delete the swap, I resize the /dev/sdb1 partition all the way. I press "apply".
Job done, no errors in general.
Now I’m booting from a brand new working Intela - and then this pops up:
5e050809592ce386838973.jpeg
Then Raise network interfaces is hammered for a minute and a half, then again 25:
5e05084423fa8322202348.jpeg
But in the end the system boots normally. But after the reboot, this war begins again.
I loaded from a home SSD, and did
sudo fsck /dev/sdb1
. To which fsck answered me that everything was OK. Fine.
Faced such a problem for the first time. Google - they write that fsck will help, but how will it help if he does not see an error - everything is OK for him.
Help!

Answer the question

In order to leave comments, you need to log in

4 answer(s)
W
Wexter, 2019-12-26
@flapflapjack

Now I'm booting from a brand new working Intela - and then this comes out:
"This" has come out before, it's just less noticeable, it has nothing to do with disks.
You most likely have a swap left in /etc/fstab and it is trying to connect it, remove the swap in fstab and rejoice. And Raise network interfaces - some network interface is trying to rise but cannot, here telepaths are on vacation, look for yourself who is trying to climb where

D
Drno, 2019-12-26
@Drno

Alternatively, use clonezilla

Z
Zzzz9, 2019-12-26
@Zzzz9

As I understand it, the uuid of the old disk is copied to fstab, it would be necessary to correct it for the uuid of the new disk. Well, swap in the system should be disabled before deleting.

A
Alexey Kharchenko, 2019-12-26
@AVX

Done wrong. It was necessary to delete the swap under the system with which you booted, and then delete the swap partition in it. Otherwise, this section will remain written somewhere in /etc/fstab or somewhere else in cron jobs or in systemd (yes, there is such a thing somewhere, I myself came across such a problem).
I think the details and solutions here will be prompted by more experienced ones. And now - I would clone again to get a working system again, and score on these 2 gigs - the system will not use them anyway if the memory is normal.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question