Monday, July 1, 2024

Note to self, cloning a Linux boot drive (to a larger one)

I was thinking about writing this down on a piece of paper and placing it in a biscuit tin somewhere for the future me, then I remembered that this particular strategy never works, so I shall use the old tech geezer blog approach.

In the streaming box I had a solid state 60GB boot drive (SATA) running Linux Mint Cinnamon and a 120GB data drive with my music files (mSATA) and the music player called Clementine only liked the boot drive (they call that sort of behaviour a feature) so I would use the larger drive as temporary storage and move files about within the small limitations of the boot drive. That all became very annoying, so I wanted to increase the boot drive, but of course I did not want to burn the house down.

An ancient, yet free, OCZ solid state drive was obtained, erased, and after some research, and a lot of internet bullcrap as is the way, the solution was at hand. I navigated a process after connecting "all the drives" and discovered that the 60GB boot (SATA) was /dev/sda the 120GB data drive (mSATA) was /dev/sdb and the 120GB OCZ drive (SATA) was /dev/sdc

That information was discovered using terminal and the command : sudo fdisk -l

The following command was then executed : sudo dd if=/dev/sda of=/dev/sdc conv=noerror, sync

The terminal then sort of goes off and does it's thing of copying everything from sda to sdc and I wandered off and kept myself busy for a while, probably thirty minutes or so, and when I came back the copy had been made and I could swap the boot drive for the bigger unit. There is a method for monitoring the progress of the write for larger drives, but I just left it alone and went off fiddling somewhere else.

That command would be something like : sudo pkill -USR1 -n -x dd and I assume it would be in a second terminal window. I giggle when I read "something like" when it comes to linux commands because users of command line, linux, unix or bash will know that if the syntax is wrong, things just don't work in a very stubborn way, which I completely respect.

The last step after making the bigger drive the boot drive was to expand the partition, as I cloned a 60GB drive onto a 120GB one, it made sense that there was about 60GB of unused space on the target drive. This final step is not that tricky when you know how, I had to boot from a Linux Mint installation USB drive (so that the new boot drive was not mounted) and execute a program called gparted, then simply expand the partition so that all the space could be used.

There you have it future old tech geezer, I hope that helps!

No comments:

Post a Comment