What's the easiest way to change the disk drive in a laptop?
I want to change the drive in a Thinkpad from a 240Gb spinning disk to a 480Gb SSD, both are SATA drives. The laptop has only one SATA socket.
Can I simply connect both drives to SATA interfaces on another system and (very carefully!) us dd to copy from the old disk to the new one? Will this copy the boot sectors, the windows partitions and everything correctly?
I know I'll need to resize the partitions after doing this but the alternative of recreating all the partitions from scratch and then copying the contents of each (there are four partitions I think) seems rather messy.
Sorry for the delayed response - I've been away with only phone access and that sends HTML emails that the list won't accept.
On Sat, 24 Oct 2020 at 16:22, Chris Green cl@isbd.net wrote:
Can I simply connect both drives to SATA interfaces on another system and (very carefully!) us dd to copy from the old disk to the new one? Will this copy the boot sectors, the windows partitions and everything correctly?
Yes, this should work.
It'll be slow, though and if you want to resize anything other than the last partition you're going to struggle to do it later.
There are several tools that should be able to do this faster and handle the resize at the same time. In terms of FOSS options, a live CD that contains CloneZilla or GParted is probably your best option, eg GParted Live or one of many multi-tool CDs that include them - there's a list on the GParted Live download page:
http://clonezilla.sourceforge.net/clonezilla-live.php https://gparted.org/livecd.php
There are also various commercial tools, some of them free as in beer; I don't have a lot of recent experience of any of them but past experience is that they tended to be easier to use and faster. But things move on and you'll probably waste more time finding the right tool than using it anyway!
I know I'll need to resize the partitions after doing this but the alternative of recreating all the partitions from scratch and then copying the contents of each (there are four partitions I think) seems rather messy.
It's not hard to export the partition table and apply it to the new disk (even editing it for size as you go) but the biggest downside of that is that the finished copy probably won't work, at least not the boot or Windows partitions. (Linux is far more forgiving.)
The advantage of just copying the contents is speed - no time wasted copying unused sectors of the old disk. Not much of a gain if the finished result doesn't work, but commercial disk imagers, and tools like CloneZilla, "understand" common filesystems and don't copy unused areas of them, getting you that same benefit without leaving you with an unbootable disk.
On Mon, Oct 26, 2020 at 03:56:57PM +0000, Mark Rogers wrote:
Sorry for the delayed response - I've been away with only phone access and that sends HTML emails that the list won't accept.
On Sat, 24 Oct 2020 at 16:22, Chris Green cl@isbd.net wrote:
Can I simply connect both drives to SATA interfaces on another system and (very carefully!) us dd to copy from the old disk to the new one? Will this copy the boot sectors, the windows partitions and everything correctly?
Yes, this should work.
It'll be slow, though and if you want to resize anything other than the last partition you're going to struggle to do it later.
In the end this is what I have done and it worked fine. I actually copied the original drive out to a USB drive and then copied from that back to the new SSD. .... and wow! is it a whole lot faster, Maxine is really pleased with it.
There are several tools that should be able to do this faster and handle the resize at the same time. In terms of FOSS options, a live CD that contains CloneZilla or GParted is probably your best option, eg GParted Live or one of many multi-tool CDs that include them - there's a list on the GParted Live download page:
http://clonezilla.sourceforge.net/clonezilla-live.php https://gparted.org/livecd.php
I tried both GParted and Clonezilla, neither was really satisfactory.
GParted was easy to create the USB stick to boot from but it was far from obvious, once I had done that, how I would copy the old drive's partitions out to 'somewhere' and then back. More to the point it was also far from obvious how one would put MBR/EFI or whatever onto the new disk.
I did use the GParted USB stick though because it has dd on it. :-)
Clonezilla was a whole, very bad, can of worms. It took me ages even to create a bootable USB stick with it on, unlike GParted (and others) if you copy the .iso direct to a USB stick it isn't bootable. You have to jump through all sorts of hoops, install mtools and, eventually, you get a bootable USB with Clonezilla on. I then couldn't really understand how it helped me much.
I think a lot of the problem is that much of the GParted and Clonezilla sort of infrastructure is rather old. For example I did try to use Tuxboot, the recommended way to create bootable sticks for both Clonezilla and GParted but that (like much else of this process) just led me down lots of software dead ends. E.g. the Tuxboot PPA doesn't have the required security keys so it gets disabled by default when you try and install it.
Whatever, I think from now on I will either use dd (as I said, very carefully!) or do a new installation and copy across /home and such. I nearly did the latter anyway, the only issue was that I'm not very sure what extras are installed on Maxine's system and I wanted to give her back a "system like it was before" only faster.
The extra (presently unused) space on the new drive means that, in the future, I can possibly install a new, clean, Linux leaving the old one in place for a while to make the changeover less difficult.
Thanks Mark. :-)
On Mon, 26 Oct 2020 18:28:06 +0000 Chris Green cl@isbd.net allegedly wrote:
Whatever, I think from now on I will either use dd (as I said, very carefully!) or do a new installation and copy across /home and such. I nearly did the latter anyway, the only issue was that I'm not very sure what extras are installed on Maxine's system and I wanted to give her back a "system like it was before" only faster.
If you are unsure what is installed on a debian based system you can list the packages for later re-installation thusly:
On the source system:
dpkg --get-selections | grep -v deinstall > packages.txt
This lists all active packages, except those deinstalled, and sticks the list in a text file.
Now copy that file to the target system, ensure that the target system’s “sources.list” file matches that on the source, and then run:
dpkg –clear-selections (that is minus minus clear-selections) dpkg –set-selections < packages.txt apt-get dselect-upgrade
This will download and install all the packages necessary to get the target system matching the original source.
Mick
--------------------------------------------------------------------- Mick Morgan gpg fingerprint: FC23 3338 F664 5E66 876B 72C0 0A1F E60B 5BAD D312 https://baldric.net/about-trivia ---------------------------------------------------------------------