LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-01-2021, 09:35 AM   #1
mackowiakp
Member
 
Registered: Jun 2014
Location: Poland/Gdynia
Distribution: Mageia 9, SH4, Debian
Posts: 367

Rep: Reputation: 8
Migrate from SSD to M2 - dual boot


I have installed a new motherboard to the PC. It is equipped with a 1TB M2 PCIe NVMe disk.
In the same PC I have a 500 GB SSD SATA disk and a "regular" HDD 2TB.
I have the dual-boot WIN10 and Linux Mageia 8 systems installed on the SSD and the data for both systems on the HDD.
Boot is legacy mode, SSD and HDD partitions are "DOS" type. The M2 disk is not used yet.
I would like to migrate SSD to M2.
Of course I can boot my PC from Knoppix and do "dd" from SSD to M2 for example.
The problem, however, is that the device names are different. SSDs and HDDs are /dev/sda or /dev/sdb and the M2 disk is /dev/nvme0n1.
Of course I can change fstab entries but that is not enough for a correct dual boot.
How can I - and is it even feasible - without reinstalling both systems from scratch?
Another issue is the transition from legacy to UEFI, which is necessary for WIN to WIN11 migration.
Has anyone performed such activities and what is the easiest way to do it?

Last edited by mackowiakp; 12-01-2021 at 09:40 AM.
 
Old 12-01-2021, 09:56 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,945

Rep: Reputation: 7325Reputation: 7325Reputation: 7325Reputation: 7325Reputation: 7325Reputation: 7325Reputation: 7325Reputation: 7325Reputation: 7325Reputation: 7325Reputation: 7325
Some ideas:

1. first use uuids in fstab and grub (reboot)
2. create a GPT partition table on NVMe.
3. you need to move your windows to NVMe and also convert to UEFI mode (I don't know exactly how)
4. add linux boot entries to uefi boot partition (check for example refind for this)
5. copy the required partitions from SSD to the M2 device
6. modify the uuids on the ssd so system will automatically find and use the partitions on the M2.
 
Old 12-01-2021, 10:32 AM   #3
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 4,170

Rep: Reputation: 244Reputation: 244Reputation: 244
The process for the linux should be fairly easy to convert to EFI booting from MBR, I just did it on machine last week. You basically remove the grub-pc program and install the grub-efi this on Debian, since you are not booted in EFI mode the GRUB will not be able to update it files until you have booted a rescue installer in EFI mode and re-installed it after mounting the partition where the /boot/efi will be mounted in the install. When you have done this a reboot after the editing of the fstab to reflect the new mount points will allow an EFI boot. Windows a search did lead to some results but it was mainly going with a GPT disk and not the conversion to EFI at the same time, a re-install of it on the new drive with the EFI only booting set in your firmware/BIOS it most likely in order. Your data is safe on separate drive so it is only the OS and the personal setting in it you would need to recreate. Basically do this:

1. Install Windows in EFI mode on the new drive.
2. Boot the knoppix disk and use something like rsync or even a cp -Rp /* will do as I have used in the past to copy over the files onto the new disk.
3. Boot rescue media for your distro in EFI mode do the mounting of the EFI system partition of the new drive to whatever it is the distro uses for its EFI location on Debian /boot/efi.
4. Once the mount is done either use the re-install GRUB option if it exists or do a chroot install in Terminal.
5. If your distro uses a different version of GRUB for its EFI loader like Debian does this needs to be installed before the copy over or after by using the old install to update-grub and find the new so you can boot into it to do the installing.
6. Once you get the GRUB installed in the EFI booting make certain you have edited the /etc/fstab to reflect the new locations of the / and add the EFI mount point that is used in this type of install.

Probably just easiest to do fresh install of both OSs in EFI mode and copy over all your old settings from the now spare useless disk in your computer. Formatting it and putting it to good use as needed.
 
Old 12-01-2021, 05:50 PM   #4
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
1. Windows must use gpt partition for efi boot.
2. It likely will require a new install of windows since the bootloader will change. I don't recall what partitions windows creates on an MBR booted install, but win 10 with efi install creates 4 different partitions. efi, reserved, OS, and recovery.

I would think that first installing windows on the nvme drive, then relocating linux and converting it to efi boot would be the way to go.
 
Old 12-01-2021, 07:22 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,141

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
^this - but I would take the opportunity to install linux fresh as well. Get rid of the cruft. More so if /home happens to be on a separate partition.
 
Old 12-02-2021, 12:49 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,945

Rep: Reputation: 7325Reputation: 7325Reputation: 7325Reputation: 7325Reputation: 7325Reputation: 7325Reputation: 7325Reputation: 7325Reputation: 7325Reputation: 7325Reputation: 7325
You can safely move linux partitions if uuids are used in fstab and grub. Just you need to avoid duplicated uuids, so need to change the uuid of the original copy (before reboot). For example gparted can move a partition with a few mouse clicks.
You can use refind for uefi boots (on linux). Also you can easily convert MBR to GPT.
So I think windows should be reinstalled on NVMe, using UEFI, and user data from the old windows should be copied to the new disk too (actually I would use another partition for that).
And you can add linux partitions (or grub) one by one to that UEFI boot.

Anyway, these are more or less independent steps, so you don't need to do all of it in one.
 
  


Reply

Tags
dual-boot, migration, nvme, pcie, ssd



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Migrate to other distro - how to migrate existing RAID1 karcio Linux - Software 10 03-10-2021 03:34 PM
How to create a single-boot Win 10 ssd from a dual-boot ssd Robert.Thompson Linux - Newbie 5 03-28-2019 02:29 PM
seeking HOWTO -- migrate MBR dual boot to GPT dual boot SaintDanBert Linux - Hardware 4 03-08-2017 01:50 AM
Install Linux in Toshiba u940 series with 32gb ssd and 750gb hdd I would like to have boot code in ssd only cvkchary Linux - Laptop and Netbook 4 08-31-2016 04:26 PM
migrate from suse, what should i migrate to? any suggestions?:twocents: Siljrath Linux - General 4 12-26-2005 01:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration