Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.