Moving current LM installation to new SSD, or starting fresh?

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
mintybarrels
Level 3
Level 3
Posts: 170
Joined: Fri Mar 26, 2021 2:57 pm

Moving current LM installation to new SSD, or starting fresh?

Post by mintybarrels »

Hello,

Thanks for taking the time to help.


***EDITOR'S NOTE - skip to the last entry of this ticket for step by step guide to moving your existing install to a new drive/device, EXACTLY as it is!***


I recently installed a new SSD in my laptop - upgraded capacity to 4TB.

Currently, I have my LM20.3 install on the factory SSD which is 2TB.

Now, I've received a few suggestions about cloning from one drive to the next, using foxclone (shout out to Andy) , but I hit a snag when it said I need to disconnect the older drive to test, as I don't feel I have the expertise to take my laptop apart and physically disconnect it.

As such it was suggested that I could do a fresh install on the new 4TB SSD, but I want to make sure I'm not screwing anything up with the old installation in case I need it. I've backed up data/media/etc. I made a timeshift for settings,etc., which I hope to use to restore once the new install is running on the new 4TB SSD.

I almost pulled the trigger, but I noticed that with the 'something else' install that it looked like it was going to turn the old 2TB SSD into free space, and I'd like to keep that install going (dual boot?), until I can be certain that the new one is working properly on the new SSD.

After that I plan to format the old SSD and try some different distros on it.

So, I'm wondering...

#1. If I put a big /home with all the data/media/etc/ on the new 4TB SSD, will I still be able to access that data/music from the old 2TB SSD if I put a different O/S on there for a dual boot?

#2. With the UEFI - does that mess with anything and does it smoothly transfer over to live on the new 4TB SSD? Such that, once it's running smoothly - I could just format the old 2TB SSD? Do dual boot systems have 2 separate UEFI/BIOS menus? As it looks like the UEFI - self healing BIOS is machine/company specific - where does it ultimately live?

#3. Has anyone done this before and are there any walk-through guides around on the forum/internet?


TREMENDOUS Thank-yous to everyone for providing expertise!!

MB
Last edited by LockBot on Tue Sep 19, 2023 10:00 pm, edited 4 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
AndyMH
Level 21
Level 21
Posts: 13748
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Moving current LM instal to new SSD or starting fresh?

Post by AndyMH »

What laptop? If lenovo they produce excellent hardware reference manuals that tell you step-by-step how to replace everything?

In principle you can do a fresh install to the new drive and then copy all the files over using rsync, but there are a few wrinkles:
  • Are you booting UEFI or legacy, the output of efibootmgr will tell you, if it says EFI variables are not supported, then it is legacy, anything else is UEFI.
  • Legacy or GPT partition table? For the 4TB drive you must use a gpt partition table, a legacy/msdos/mbr partition table has a max drive size of 2TB. The output of sudo parted --list for your current system drive would help. You can boot legacy off a GPT drive, just slightly more fiddly.
  • When you do a file copy of old drive to new, there are some folders you do not copy, e.g. /dev or /sys (populated every time you boot), and there are some files like fstab you do not want to overwrite.
I did have a script to do this, some time back Kadaitcha Man PM'ed me it, unfortunately gone, didn't realise there is a limit of 100 PMs and older ones get deleted automatically.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
mikeflan
Level 17
Level 17
Posts: 7150
Joined: Sun Apr 26, 2020 9:28 am
Location: Houston, TX

Re: Moving current LM instal to new SSD or starting fresh?

Post by mikeflan »

but I want to make sure I'm not screwing anything up with the old installation in case I need it.
Then I suggest you create a whole disk image of the old 2 TB SSD.

Lets see. You had a 2 TB SSD. You left that in the laptop and added a 4 TB SSD. So now you have 6 TB total installed.
rickNS
Level 9
Level 9
Posts: 2975
Joined: Tue Jan 25, 2011 11:59 pm

Re: Moving current LM instal to new SSD or starting fresh?

Post by rickNS »

Do note, because of a bug in the installer, that puts the boot loader into the first /boot/efi partition it finds, most likely your old, smaller drive. So later if you remove it, or over write it, it "could" leave your new larger drive unbootable (no boot loader).

If you can't physically disconnect it during install you can use the @pbear method of un-flag/re-flag method,
viewtopic.php?p=1590475#p1590475

Questions;
#1, yes
#2, don't quite know what exactly you mean, but see above.
Last edited by rickNS on Sun Mar 19, 2023 8:59 am, edited 2 times in total.
Mint 20.0, and 21.0 MATE on Thinkpads, 3 X T420, T450, T470, and X200
User avatar
AndyMH
Level 21
Level 21
Posts: 13748
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Moving current LM instal to new SSD or starting fresh?

Post by AndyMH »

rickNS wrote: Sun Mar 19, 2023 8:50 am Do note, because of a bug in the installer, that puts the boot loader into the first /boot/efi partition it finds
I was waiting for answers before dealing with that :D
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
mintybarrels
Level 3
Level 3
Posts: 170
Joined: Fri Mar 26, 2021 2:57 pm

Re: Moving current LM instal to new SSD or starting fresh?

Post by mintybarrels »

Code: Select all

:~$ efibootmgr
BootCurrent: 0002
Timeout: 0 seconds
BootOrder: 0002,2001,2002,2003
Boot0002* ubuntu
Boot2001* EFI USB Device
Boot2002* EFI DVD/CDROM
Boot2003* EFI Network
*****************************************************************************

Code: Select all

:~$ sudo parted --list
[sudo] password:  
Model: KINGSTON SNVS2000G (nvme)
Disk /dev/nvme0n1: 2000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system     Name  Flags
 1      1049kB  512MB   511MB   fat32                 boot, esp
 2      512MB   201GB   200GB   ext4
 3      201GB   1990GB  1790GB  ext4
 4      1990GB  2000GB  10.0GB  linux-swap(v1)        swap


Model: ADATA SX8100NP (nvme)
Disk /dev/nvme1n1: 4001GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  4001GB  4001GB  ext4
***********************************

Looks like EFI is supported and partition tables are gpt.


Yes... question #2 was referring to the fiddley-ness of where the EFI/bootloader will install.

It looks like EFI are manufacturer specific... and, so I wanted to make sure the EFI made it to the 4TB drive, such that I can completely format the 2TB drive.

Thank you for your help!!

MB
mintybarrels
Level 3
Level 3
Posts: 170
Joined: Fri Mar 26, 2021 2:57 pm

Re: Moving current LM instal to new SSD or starting fresh?

Post by mintybarrels »

Regarding disk images...

What program do you recommend?

How large do you think that 2TB disk image would be? would be? I have 2TB of media on the 2TB Kingston... and the same media backed up on a 2TB external HD.
User avatar
AndyMH
Level 21
Level 21
Posts: 13748
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Moving current LM instal to new SSD or starting fresh?

Post by AndyMH »

Obviously foxclone :D but rescuezilla would work as well.

Disk images - foxclone uses compression by default and it only backs up the used blocks in a partition. The resultant image files will typically be 60-70% of the used space. Quickest way of finding out used blocks is run gparted, it tells you used space. When you do an image backup in foxclone it checks for free space on the destination, if there is not enough space it checks to see if there might be enough space with compression and gives you the option of proceeding. If there is not enough space using compression it won't do the backup.

Read the user guide for foxclone, tells you all you need to know about backup and clone. The download site is https://foxclone.org/.
Image backup = saving image files on another drive for disaster recovery, e.g. your system drive fails. Clone = transferring your system to another drive, subject to the caveat that you cannot have two identical drives in the system at the same time when booting, you will have two / partitions with identical UUIDs, which one does the system boot?
Yes... question #2 was referring to the fiddley-ness of where the EFI/bootloader will install.
If, say, you do an "erase and install" of mint to your new 4TB drive with your existing 2TB drive present, the installer will put the boot files in the EFI partition on your existing 2TB drive, not what you tell it. This is a bug. You want grub in its own EFI partition on the 4TB drive. Two fixes:
  • the easiest, disconnect the 2TB drive before installing mint to the 4TB drive, but if that is physically difficult
  • using gparted (booting from your mint install stick), disable the esp & boot flags on the EFI partition on your 2TB drive. All you do is right click on the partition and "manage flags" and uncheck them. These flags are what tell the system it is an EFI partition, so the installer won't find it and will create a new EFI partition on the 4TB drive. When you have installed mint to the 4TB drive you re-enable those flags on the EFI partition on the 2TB drive.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
User avatar
freshminted
Level 4
Level 4
Posts: 274
Joined: Fri May 01, 2020 12:26 am

Re: Moving current LM instal to new SSD or starting fresh?

Post by freshminted »

Just went through the joy of replacing the HDD with an SSD in my old Macbook. I've used clonezilla twice recently to upgrade the HDD's to SSD's in desktops with absolutely no problems; boot up with clonezilla usb stick, select drives, copy drives, shut down, swap HDD for SSD and reboot the machine. Worked perfectly both times.

Well not with the mac. First, I couldn't boot clonezilla with the usb stick. Never appeared in the list while holding down the option key during boot. So I write the clonezilla iso to a cdrom and boot from that. Get the copy done and then find another problem: the cdrom drive hasn't been used for so long that it won't eject the disk! Eventually after several eject button cycles I catch the 1mm of disk that briefly appears with tweezer pliers and pull it out. Swap the HDD with the SDD and prepare to sit back and enjoy my faster mac. It won't boot. Get the dreaded flashing folder with question mark, a very mac thing, ie can't find a boot drive. Try a few things, get nowhere and decide to stop wasting more time and re-install Linux Mint from scratch. Eventually get it all working, but what a day.
Complete World Domination within five years.
mintybarrels
Level 3
Level 3
Posts: 170
Joined: Fri Mar 26, 2021 2:57 pm

Re: Moving current LM instal to new SSD or starting fresh?

Post by mintybarrels »

Ok... word up, Andy!

So, regarding,
using gparted (booting from your mint install stick), disable the esp & boot flags on the EFI partition on your 2TB drive. All you do is right click on the partition and "manage flags" and uncheck them. These flags are what tell the system it is an EFI partition, so the installer won't find it and will create a new EFI partition on the 4TB drive. When you have installed mint to the 4TB drive you re-enable those flags on the EFI partition on the 2TB drive.
When I reactivate the flags.. will my laptop get confused as to which EFI to boot from? Or, does it now recognize it as a dual boot?

Also, will there be any issues with using a timeshift backup from a 2TB SSD, on a 4TB SSD?

Also... if there's a problem of some kind and the computer freezes, meaning I have to turn it off, and the EFI flags aren't activated, does this mean that now there's no bootloader, and I wouldn't be able to boot from the 2TB SSD anymore? Or, is there a way to turn them back on somehow, so it will boot? IE. from the terminal?

Tx again,

MB
mintybarrels
Level 3
Level 3
Posts: 170
Joined: Fri Mar 26, 2021 2:57 pm

Re: Moving current LM instal to new SSD or starting fresh?

Post by mintybarrels »

I guess also, it's worth asking if/how re-partitioning works with the extra 2TB of space? Using Gparted?

MB
mintybarrels
Level 3
Level 3
Posts: 170
Joined: Fri Mar 26, 2021 2:57 pm

Re: Moving current LM instal to new SSD or starting fresh?

Post by mintybarrels »

Ok, well...

Here's the update.

Everything seems to have worked, although there are some peculiarities.. but it could just be because there's 2 home partitions? I'm just moving the data/media over from one home to the other.

And, wow.. it's a lot faster than from my ancient external HDD. 2 hours worth of transferring in like 15 minutes! Go PCIe/NvME!!!

Thank you Andy for the manage flags suggestion... that seems to have been the trick I needed.

MB
mintybarrels
Level 3
Level 3
Posts: 170
Joined: Fri Mar 26, 2021 2:57 pm

Re: Moving current LM instal to new SSD or starting fresh?

Post by mintybarrels »

Ok.. so here's what's funny....

In Gparted, when looking at the various devices...

The new 4TB SSD under mount point doesn't have the usual /root, or /home monikers with the partitions... Instead it says /media/oldusername/'a bunch of random numbers'/newusername.

Is that because I'm logged in on the old 2TB SSD currently for data transfer purposes?

MB
mintybarrels
Level 3
Level 3
Posts: 170
Joined: Fri Mar 26, 2021 2:57 pm

Re: Moving current LM instal to new SSD or starting fresh?

Post by mintybarrels »

Could I just use Gparted to move all the partitions from the 2TB drive to the 4TB drive?

Something funny happened with the secondary install on the 4TB SSD.... The home folders all seem to still be on the 2TB drive.
mintybarrels
Level 3
Level 3
Posts: 170
Joined: Fri Mar 26, 2021 2:57 pm

Re: Moving current LM instal to new SSD or starting fresh?

Post by mintybarrels »

Ok....

Crickets.

Back to square1.

Formatted the 4TB SSD.

Used FOXCLONE to clone 2TB to 4TB drive - directly. Very easy to use, very straightforward.

So... Now, I'm not sure which SSD I've booted off of? Also, I'm not able to resize the /home drive on the 4TB SSD, it's locked and won't allow me to unmount because the volume is in use.'o

How can I add the extra space on the 4TB SSD to the /home partition?

MB
mintybarrels
Level 3
Level 3
Posts: 170
Joined: Fri Mar 26, 2021 2:57 pm

Re: Moving current LM instal to new SSD or starting fresh?

Post by mintybarrels »

FINAL ANSWER

Ok, so, everything seems to have worked. It seems like this was actually a fairly easy task that I was making more difficult in my brain.

Fresh install on the new device and Timeshift restore with settings from old device was a huge pain - don't waste your time.

FOXCLONE is the WAY 2 GO!

*************************************8

Here is what I did:

!!!BACK UP ALL IMPORTANT DATA!!! *although the process was so simple, I didn't need to use any backups to restore any data/media.

1. Make a foxclone bootable.

2. Use foxclone to do a DIRECT drive to drive clone, ie. old drive to new drive (see page 24, step 58 of Foxclone .pdf manual). *easiest step, but takes some time.

3. Use Gparted to resize partiions (see page 48 of Foxclone .pdf manual, step 115) *tricky part - moving your swap partition to the end of the unallocated space, before trying to resize /home partition to make use of the expanded space.

4. Use a USB bootable O/S like LM20, which allows your computer to boot on neutral territory (as booting regularly may use a weird combination of both old and new drives, ie. could boot off of old drive, use root off of old drive, but /home off of new drive causing mounting/unmounting issues) ....

AND,

***from the neutral territory USB bootable, use Gparted to delete your old drive, once your sure the new install has taken place***

5. Boot up on your new drive with your old system exactly as it was, but on the new device...

6 (optional). Use Gparted to format old drive for new desired use purpose.


HUGE SHOUT OUT TO ANDY for making foxclone just so damn easy to use. That's right, I said 'DAMN EASY' to use.


The user guide/manual .pdf contains all the information you need - I highlighted the pertinent sections above.


Indeed, I wish I had just listened to Andy in the first place.

Foxclone is very straightfoward and easy to use.

THANK YOU ANDY! YOU ARE A LEGEND!

MB
User avatar
AndyMH
Level 21
Level 21
Posts: 13748
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: [SOLVED] Moving current LM instal to new SSD, or starting fresh?

Post by AndyMH »

Glad you liked it :D

I have tried to make it as easy to use as possible with lots of checks to stop the user doing stupid things. If you want more whizz-bangs then rescuezilla and clonezilla have more functionality, but I think I have the best user interface.

Your penultimate step of re-purposing the old drive - you could have used foxclone - there is a copy of gparted in the iso.

What I suggest you do now is use foxclone to take an image backup of your new drive, save the backup on a different drive. Put it somewhere safe. That means should your system drive fail (or you really screw things up badly), you can restore the backup. Note - restore will only restore to the drive the backup came from, if your drive has failed and you need to restore to a new drive then it is on the clone tab - clone from file. Also note, the new drive has to be the same size or larger than the original.

What I do:

All my PCs have an internal drive used only for backup. In my laptops it sits in a caddy where the DVD drive used to live. Main desktop has a removable caddy, mini-desktop* it is internal (so not so good), but only one screw to get at it.

The backup drive is the destination for my timeshift and backintime snapshots. These are file level backup tools. Because the drive is permanently connected I have timeshift/backintime running automatically daily. With the advent of excellent tools like timeshift & backintime, image level backup is less important and now really for disaster recovery. I take an foxclone image backup once every few months. It is a lot less hassle to use timeshift/backintime as you can run them from your normal system. Huge plus for backintime - very easy to restore individual files or folders.

I have another copy of LM installed to the backup drive in a small partition (the rest of the drive is one big ext4 partition for the backups). I have installed all the disaster recovery tools I can think of in this copy of mint. This includes foxclone (installed from the deb file).

If my main system drive fails or I have a problem, I can boot from the backup drive and fix it. Saves me having to mess around with usb sticks. A foxclone restore will get me back a working system (current at the date of the backup). Timeshift/backintime will then get me back to yesterday.

For really important stuff - I have another copy on my NAS.



* thinkcentre M720Q, recent acquisition, love it. About the size of a large paperback book.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
mintybarrels
Level 3
Level 3
Posts: 170
Joined: Fri Mar 26, 2021 2:57 pm

Re: [SOLVED] Moving current LM instal to new SSD, or starting fresh?

Post by mintybarrels »

Actually...

It seems like something is not working with everything ported over onto the new drive. I'm having issues with freezing.

What a pain. I guess I'm going to have to completely start from scratch.. AGAIN.

Also, after formatting the old drive to ext4 - it's telling me that I don't have access to write data to it? Is there some way to change that?

Tx MB.
RIH
Level 9
Level 9
Posts: 2894
Joined: Sat Aug 22, 2015 3:47 am

Re: Moving current LM instal to new SSD, or starting fresh?

Post by RIH »

If you formatted using GParted then it formats as root.

Code: Select all

sudo chown -Rc YOURUSERNAME:YOURUSERNAME /LOCATIONOFDRIVE
will change it to you, where anything in Capitals has to be entered as your data.

I have just updated my system to a new drive while moving from Mint 20.3 to Mint 21.1.
I installed a new version of 21.1 & then used the Backup Tool to add my Applications & copy across my /Home directory (including hidden files).
It is still necessary to manually change Themes, Desktop Settings, Panels as well...
Image
mintybarrels
Level 3
Level 3
Posts: 170
Joined: Fri Mar 26, 2021 2:57 pm

Re: Moving current LM instal to new SSD, or starting fresh?

Post by mintybarrels »

Maybe this is a stupid question, but what would the LOCATION OF DRIVE look like?

MB
Locked

Return to “Installation & Boot”