Linux Lite Forums

Hardware - Support => Hard Drives and SSD's => Topic started by: waynebob on December 02, 2019, 07:36:30 PM

Title: Good idea to clone HDD to ssd?
Post by: waynebob on December 02, 2019, 07:36:30 PM
Ordered 2 Samsung ssd's, one M.2 and one sata expecting to use Samsung Magician Software. Upon reading about it before they arrive I find the software will not work in Linux.
Is it a good idea to clone ( LL 4.6 & LL 3.8 ) using d.d. or Clonezilla or do a reinstall?
Found this tutorial :
https://www.linuxliteos.com/forums/tutorials/cloning-your-linux-lite-drive-using-the-'dd'-command/msg39977/#msg39977 (https://www.linuxliteos.com/forums/tutorials/cloning-your-linux-lite-drive-using-the-'dd'-command/msg39977/#msg39977)
Not sure if this is a solution and if d.d. runs from the live system or from a bootable cd?
Thanks Wayne.
I understand LL 4.6 will do trim and 3.8 I will have to set it up.
Title: Re: Good idea to clone HDD to ssd?
Post by: JanetBiggar on December 02, 2019, 11:50:53 PM
Hi Waynebob,
Might this post provide you with a solution for the LL 3.8 install?:

https://www.linuxliteos.com/forums/installing-linux-lite/installing-linux-lite-via-a-systemback-iso-to-a-different-laptop/

Oobuntus provided the detailed steps towards the end of the thread.
Title: Re: Good idea to clone HDD to ssd?
Post by: robinc on December 03, 2019, 01:40:52 AM
1. Use timeshift to create a backup of your current system - make sure you include your hidden files.
2. Do an install on your new drive - just the minimum
3. Start up the new system and use timeshift to restore the timeshift backup to the new drive - it will overwrite as required and restore your local configs.

You now have you old system on the new drive with all the installed software and matching configs

Copy data from old drive or backups as required.
Title: Re: Good idea to clone HDD to ssd?
Post by: waynebob on December 03, 2019, 10:46:08 PM
Thanks for the ideas, I received the ssd's today but am still experimenting on my spare machine. Will post the outcome. :-)
Title: Re: Good idea to clone HDD to ssd?
Post by: waynebob on December 17, 2019, 01:39:38 PM
Well I tried cloning on my spare machine.
     -used gparted to shrink 500 gb hdd to 136 gb           succesful ?
     -used clonezilla to clone from 136gb partition to 160 gb hdd     succesful ?
Now the target 160gb hdd will boot (to a grub menu though?)
The source 136gb partition (on 500gb hdd) will not boot even though configured in bios and identified as bootable.
When I unplug the 160gb hdd the 136gb partition will boot (to a grub menu though)
Tried a boot repair disk, both ways still boot to a grub menu first and the source drive (136gb) still will not boot if the 160gb is plugged in.

On my main machine I did a clean install to the M.2 500gb drive. Used Timeshift to restore my backup from 1TB HDD. Worked like a charm or so I thought. After a couple of restarts all the browser logins were not there anymore?
Starting to think Joe Collinís thoughts about just doing a fresh install, especially to a new SSD would be easier and probably better in the long run.
Reading up on grub and grub2 repair stuff and lose interest pretty quick. Getting old (70)
Not really sure if the gparted or the clonezilla broke the boot.

Thanks for the help, I shall keep farting around but a fresh install looks good.

Wayne.
Title: Re: Good idea to clone HDD to ssd?
Post by: firenice03 on December 17, 2019, 02:48:44 PM
Just a thought -- something you might want to think about...
Is as you're plugging/unplugging disks --- If both were plugged in together.. The /dev/sdX may be different.

i.e.
if the 500/136 was sda and the 160 is sdb its not necessarily going to boot... Or vice versa
Grub doesn't know where the bootloader resides...

You may wanna try, connecting the disk boot to a LiveUSB, once at the desktop launch terminal and run
Code: [Select]
sudo update-grub
it should scan and repopulate the OS's..
Not sure what was done with "boot repair disk" .... but maybe the above will help resolve....


I haven't tried with a clone.. but you "could" connect both disks and update grub - it should see both LL's
Title: Re: Good idea to clone HDD to ssd?
Post by: DeepThought on December 17, 2019, 03:38:04 PM
@firenice03
Quote
You may wanna try, connecting the disk boot to a LiveUSB, once at the desktop launch terminal and run
Code: [Select]
sudo update-grub

Won't that try to update-grub on the liveusb ? I think you will need to create a chroot environment on sda and then update grub there :)
Title: Re: Good idea to clone HDD to ssd?
Post by: waynebob on December 17, 2019, 06:40:06 PM
Booted a LL 4.6 dvd with both HDD's plugged in (machine will not boot from usb). Did sudo update-grub.
Got /usr/sbin/grub-probe: error: failed to get canonical path of '/cow'.   ??
Question : I kind of thought if you had 2 HDD's each with an OS that the bios would determine which would boot, just like when you have to put the DVD drive first in line for it to boot.
Apparently I was wrong?
Title: Re: Good idea to clone HDD to ssd?
Post by: firenice03 on December 17, 2019, 07:16:34 PM
@firenice03
Quote
You may wanna try, connecting the disk boot to a LiveUSB, once at the desktop launch terminal and run
Code: [Select]
sudo update-grub

Won't that try to update-grub on the liveusb ? I think you will need to create a chroot environment on sda and then update grub there :)

Eh you maybe right on that... @DeepThought Thanks!!   
and each/either will need to be mounted .. i.e. /dev/sdxY will need to mounted then chroot  then grub could be updated....


The following should do this... although I'm not at my system else I would test the commands... @DeepThought this more on par? missing anything


For x the corresponding letter (sda or sdb ... ) Y the number (sda2 or sdc1) - You'll need to know these.. *It maybe sda but confirm and I would start with 1 drive not both..


From the LiveUSB...
Code: [Select]
sudo mount /dev/sdxY /mnt
Code: [Select]
sudo chroot /mnt
Code: [Select]
sudo update-grub

If grub needs re-installed
Code: [Select]
sudo grub-install /dev/sdxY

Reboot
Title: Re: Good idea to clone HDD to ssd?
Post by: firenice03 on December 17, 2019, 07:25:12 PM
Question : I kind of thought if you had 2 HDD's each with an OS that the bios would determine which would boot, just like when you have to put the DVD drive first in line for it to boot.
Apparently I was wrong?
@waynebob
Kind of..  BIOS says skip all else and go look for something I can use.. Or go find something usable in this order..
Whether Windows or Linux there is a boot manager/boot loader. Grub is this boot manager of sorts. Depending on how many OS's or disks it will list all available OS's.
- You could have 4 OS's on 1 disk, BIOS doesn't care just wants to know where/which disk....
Grub says where on the disk to go find it - Win?? Linux Lite 1,  LL 2, or LL3   :)
Updating grub tell grub to scan the disks for an OS.. Then it will display them. -- Yes you could have multiple LL's running.
Title: Re: Good idea to clone HDD to ssd?
Post by: DeepThought on December 17, 2019, 07:59:59 PM
from :
Quote
https://howtoubuntu.org/how-to-repair-restore-reinstall-grub-2-with-a-ubuntu-live-cd

Code: [Select]
sudo mount /dev/sdXY /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /dev/pts /mnt/dev/pts
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo chroot /mnt
grub-install /dev/sdX
grub-install --recheck /dev/sdX
update-grub

Replace X and Y with disk and partition number e.g. sda1

Code: [Select]
exit
sudo umount /mnt/sys
sudo umount /mnt/proc
sudo umount /mnt/dev/pts
sudo umount /mnt/dev
sudo umount /mnt

Then reboot
Title: Re: Good idea to clone HDD to ssd?
Post by: waynebob on December 18, 2019, 09:32:39 AM
Ran a live cd and the /dev/sda1 is not seen, it is mounted at /mnt and won't let me unmount it because it is busy. lol. I have attached screenshots (hopefully).
Thanks, Wayne.   https://drive.google.com/drive/folders/1HxS78Uj3rH8QguJ7sUeN4ouBI5Ir5uVw?usp=sharing