Wednesday, March 17, 2021

Try A Clone Of Your Disk When Moving To A New Computer With Linux

Forward:  Here I am two weeks later.  The original upgrade worked like a champ.  I'm on it right now and it is happy.

Then I tried again with a very different pair of machines.  There were some pretty big problems with the upgrade.  The problem boiled down to the internal assignment of the hardware to Debian.  You can check this with a live CD.

Where the old System V Unix hardware assignments of /dev/sda for your first drive have been used since the 1980s under Linux, the new machine, a Thinkpad Carbon with a m.2 hard drive came up as /dev/nvme0p1 which broke Apt. 

I'm currently reevaluating.   If the new machine starts with the disc drive being assigned to /dev/sda then the following write-up should work.  I have been advised to use a permanent symbolic link to restore fidelity but I am unsure whether I will proceed or just throw up my hands and install Debian from scratch, then import the software manifest from Synaptic and upgrade.

Stay tuned.


With Linux, there are a couple things that people in a home situation are told frequently.

Try it out and enjoy the journey is one of the first things I keep saying.  After all you grew up with people around you using Windows or Mac.  The Linux software is new, it does things differently, the rules have changed.  Don't forget it is completely customizable and can be changed easily.

The next one is if you are going to do it, do it right and get a used Thinkpad.  The hardware is usually repairable and pretty much bulletproof.  I have done an install on some rather crusty old Thinkpads and they just seem to work.  The documents on how to repair these machines are available on PDF and the detail is down to which screws to remove first.

Debian with the "Non-Free" .ISO files copied onto a USB stick.  Boot and install.

Debian Swirl Logo

However, what do you do if you have a new-to-you computer?   It is much easier than on Windows. 

The scenerio was I was given a newer Thinkpad T550.  I have my mature, four year old Debian install on the older Thinkpad Yoga. The hardware is similar but not exactly identical.

Old was an 8GB i7 Yoga with an SSD and Touchscreen.

New was a 16GB i7 Thinkpad T550 with an SSD and no Touchscreen.

Typical Debian with XFCE4 Desktop

So I had four years of experience on the old machine.  Four years of installing software, tweaking the machine for "silky smooth" running, and a software library that suits my needs.  I did not want to go through the whole creation routine, although the information is available on this blog on how to do it.

I was not going to encrypt the new machine, although that will be done in the future.  

It was fairly simple.  

I have an external drive case for the SSD in the Yoga.  I merely put the Yoga's drive in the case and booted the T550 from the external drive.  

Step 2 was once I knew I was running on the Yoga's drive, dd the drive across to the T550's internal drive.

To determine what was going on, I verified what I was doing via running gparted and looking at where I was booted from.

sudo dd if=/dev/sda of=/dev/sdb conv=noerror,sync status=progress

Wait four or five hours for it all to finish.

Shut down the T550 and unplug the external drive caddy.

On boot, it put me in single user mode where I had to "fsck /dev/sda1" as well as sda2 and sda5.

Power off and boot again.

I was staring at my normal log in screen on the new machine.  No weird special software, it's all a part of the operating system.  All my tweaks, shares, installed software was in place.  I could take time to move in but really there was no need to worry.

That's it.  All done.

The reason why it works is because the hardware basis was similar.  I was going to hardware that was supported by Linux's kernel, and drivers were already there for the more basic hardware.  I was also lucky, nothing was missing.  It would be enumerated with the boot and missing drivers could be found by looking through "sudo dmesg".

I have also done this trick with a Dell Precision and a Thinkpad.  And back.  Linux is more forgiving than its reputation gives it.  Again the hardware between the two computers was not that different and I did have to make sure that drivers were not missing on boot.

 You can't do that in Windows so easily because over the years they purposely took the ability to do this away.  It was able to be done back as far as the early XP days, but I would not even attempt that now.  Plus I left the Windows world when they started turning a rather popular operating system into a steaming pile of spyware with a god awful user interface.

The problem with this process is that you wind up with your machine exactly the way it was before on the old hardware.   If there were problems in the software before it won't fix it, and being on old drivers will result in a possibly less efficient machine.

But here I am a month down the road and my T550 is running great.

No comments:

Post a Comment