[SOLVED] Move boot from one drive to another
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
[SOLVED] Move boot from one drive to another
I am currently using a 512GB drive with dual boot LM/Win10 capabilities
I just received a 1TB SSD that I wish to use as my LM drive. I want to keep the 512GB as my Win10 drive. I still wish to have the dual-boot capability.
What is the best way to move my LM file structure (and all files) to my 1TB SSD, and then use the 512GB drive as my Win10?
I just received a 1TB SSD that I wish to use as my LM drive. I want to keep the 512GB as my Win10 drive. I still wish to have the dual-boot capability.
What is the best way to move my LM file structure (and all files) to my 1TB SSD, and then use the 512GB drive as my Win10?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
-
- Level 16
- Posts: 6054
- Joined: Mon Aug 27, 2012 10:17 pm
Re: Move boot from one drive to another
I genuinely doubt that you'll be prepared for the answer, so prepare yourself now, and for the worst.
What you want to do is possible, but possible is not the same as feasible. It is a highly complex procedure and there are no step-by-step instructions for it because of the enormous amount of variability, and the huge risk involved. If you make one solitary mistake, your data could be toast. Given that last point, only the foolhardy and the ignorant would advise you to proceed with such an idea. As a consequence, the only safe advice is to a) backup your important data, b) verify the backup, c) backup again, not just make a copy of the backup, d) clean install both operating systems.
Step d) requires you to make some decisions. Those decisions are:
A) Do you want the Linux grub bootloader to control booting, or
B) Do you want to manually control booting by pressing the machine's boot key and selecting the boot drive.
In the case of A), you must reinstall Windows first, then reinstall Linux however there is still a risk that option C) (below) will be required.
In the case of B), you can install either Linux or Windows first, but when you are ready to install the second OS, you must remove the drive that contains the first OS. Once the second OS has been successfully installed, you can put the other drive back, then you can boot from one drive or the other.
There is no option C) unless you're prepared to reinstall Linux's bootloader every month when Windows does its update dance, and you are also prepared for Windows to modify your boot sequence all of its little ownsome and without either your permission or your knowledge.
Option B) is the safest, and you should be able to boot into Windows from the Linux boot menu as it should detect Windows and add an entry for it. If this works for you then you can set the Linux drive as the boot drive. f Linux doesn't detect Windows, it's a very simple copy/paste of two short instructions to get it going for you, and we can provide that information if and when it's needed.
There is though an option D), which entails installing Linux with the current disk removed, then using some commandline commands to sync your current Linux installation to the new installation after the the other drive has been put back, but this too is complex and not for the faint-hearted. If you want to go this route, I will have to develop a tutorial for it, which I don't mind doing but it won't be done today.
Re: Move boot from one drive to another
Ok. I am preparing to learn.
Since you offered, I would appreciate the tutorial step-by step to do the following (possibly not in the order presented):
1) Create a dual boot (LM and Win10) scenario that boots from my new 1TB. I do not want to manually select the boot drive when BIOS loads. I want the system to boot into LM after it waits the requisite 10 or 15 seconds, or it allows me to boot into Win10 by selecting it from the grub bootloader.
2) Migrate my programs and data from LM to the LM portion of the new 1TB.
3) Leave Win10, its data and programs on the existing 512GB drive, and expand Win10 to the remaining space on the 512GB.
In summary, I want my system to provide dual boot opportunity where my LM programs and data reside on the 1TB drive, and the Win10 programs and data reside on the 512GB.
I await your tutorial if you are still willing to provide.
Since you offered, I would appreciate the tutorial step-by step to do the following (possibly not in the order presented):
1) Create a dual boot (LM and Win10) scenario that boots from my new 1TB. I do not want to manually select the boot drive when BIOS loads. I want the system to boot into LM after it waits the requisite 10 or 15 seconds, or it allows me to boot into Win10 by selecting it from the grub bootloader.
2) Migrate my programs and data from LM to the LM portion of the new 1TB.
3) Leave Win10, its data and programs on the existing 512GB drive, and expand Win10 to the remaining space on the 512GB.
In summary, I want my system to provide dual boot opportunity where my LM programs and data reside on the 1TB drive, and the Win10 programs and data reside on the 512GB.
I await your tutorial if you are still willing to provide.
Re: Move boot from one drive to another
BTW, is there a way I can use my restore my TimeShift backups of my 512GB items to the new 1TB drive so that system boots from the 1TB?
-
- Level 16
- Posts: 6054
- Joined: Mon Aug 27, 2012 10:17 pm
Re: Move boot from one drive to another
Again, it all depends. Generally, yes you can, but there's no point because it will be quicker and easier to clean install then apply all waiting updates, and your system is almost ready, save for the tutorial I'll now write.
In the meantime, I will need you to post the output of these terminal commands before I can start:
inxi -Fxxxz
and lsblk -if
Post the output back here using copy/paste. Before you paste the output, click the
</>
icon, which only appears when you reply. Paste your output between the [code]
and [/code]
tags to make it readable.[code]It should look like this[/code]
.As I said, it won't be today, and looking at my workload, it might not be tomorrow. I'll post into this thread with a link for you when it's done.
Re: Move boot from one drive to another
Sorry for the delay Kadaitcha Man. It's been a couple of "those" days.
As you requested. Output from is as follows:
And output from is as follows
All I have done at the moment is simply installed the 1TB in an M.2 slot. I have not partitioned or formatted the drive
As a reminder, I would like to move my file structure from the T-FORCE 512GB drive to the TM8FP6001T size: 953.87 GiB drive. I want to still have the dual boot option, e.g. LM first, and automatic if I do not choose anything, but also still be able to select Win10 for "Windows" stuff. I want my LM files to run on the 1TB drive, and my Windows OS to run on the 512GB drive, but I defer to your expertise if that is advisable.
I wish there was a way I could use LVM or something like that to have access to the full 1.4TB, but I am not sure if that is better than having dual boot capability, with LM on the 1TB nvme drive, and Win10 on the 512GB.
Again, I defer to your expertise for optimal operational suggestions and of course, the tutorial. Please advise on the steps I can take at your convenience.
Thanks again!
As you requested. Output from
Code: Select all
inxi -Fxxxz
Code: Select all
System:
Kernel: 5.8.0-44-generic x86_64 bits: 64 compiler: N/A
Desktop: Cinnamon 4.8.6 wm: muffin 4.8.1 dm: LightDM 1.30.0
Distro: Linux Mint 20.1 Ulyssa base: Ubuntu 20.04 focal
Machine:
Type: Desktop System: ASUS product: N/A v: N/A serial: <filter>
Mobo: ASUSTeK model: TUF GAMING B460M-PLUS (WI-FI) v: Rev 1.xx
serial: <filter> UEFI: American Megatrends v: 0708 date: 07/23/2020
CPU:
Topology: 8-Core model: Intel Core i7-10700F bits: 64 type: MT MCP
arch: N/A L2 cache: 16.0 MiB
flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3
bogomips: 92796
Speed: 4600 MHz min/max: 800/4800 MHz Core speeds (MHz): 1: 4602 2: 4600
3: 4600 4: 4600 5: 4600 6: 4600 7: 4600 8: 4600 9: 4600 10: 4604 11: 4600
12: 4600 13: 4600 14: 4600 15: 4600 16: 4600
Graphics:
Device-1: NVIDIA vendor: ASUSTeK driver: nvidia v: 460.56 bus ID: 01:00.0
chip ID: 10de:2503
Display: x11 server: X.Org 1.20.9 driver: nvidia
unloaded: fbdev,modesetting,nouveau,vesa resolution: 1920x1080~60Hz
OpenGL: renderer: GeForce RTX 3060/PCIe/SSE2 v: 4.6.0 NVIDIA 460.56
direct render: Yes
Audio:
Device-1: Intel vendor: ASUSTeK driver: snd_hda_intel v: kernel
bus ID: 00:1f.3 chip ID: 8086:a3f0
Device-2: NVIDIA vendor: ASUSTeK driver: snd_hda_intel v: kernel
bus ID: 01:00.1 chip ID: 10de:228e
Device-3: Logitech HD Pro Webcam C920 type: USB
driver: snd-usb-audio,uvcvideo bus ID: 1-2:2 chip ID: 046d:082d
serial: <filter>
Device-4: JMTek LLC. type: USB driver: hid-generic,snd-usb-audio,usbhid
bus ID: 1-4.3:5 chip ID: 0c76:160a
Sound Server: ALSA v: k5.8.0-44-generic
Network:
Device-1: Intel Ethernet I219-V vendor: ASUSTeK driver: e1000e v: 3.2.6-k
port: efa0 bus ID: 00:1f.6 chip ID: 8086:0d55
IF: eno1 state: up speed: 1000 Mbps duplex: full mac: <filter>
Device-2: Intel Wi-Fi 6 AX200 driver: iwlwifi v: kernel port: 3000
bus ID: 04:00.0 chip ID: 8086:2723
IF: wlp4s0 state: down mac: <filter>
IF-ID-1: cscotun0 state: unknown speed: 10 Mbps duplex: full mac: N/A
Drives:
Local Storage: total: 1.40 TiB used: 302.66 GiB (21.2%)
ID-1: /dev/nvme0n1 vendor: Team model: TM8FP6001T size: 953.87 GiB
speed: 31.6 Gb/s lanes: 4 serial: <filter> rev: S1218A3
ID-2: /dev/sda model: T-FORCE 512GB size: 476.94 GiB speed: 6.0 Gb/s
serial: <filter> rev: 2A0 scheme: GPT
Partition:
ID-1: / size: 350.07 GiB used: 302.63 GiB (86.4%) fs: ext4 dev: /dev/sda5
Sensors:
System Temperatures: cpu: 28.0 C mobo: N/A gpu: nvidia temp: 29 C
Fan Speeds (RPM): N/A gpu: nvidia fan: 0%
Info:
Processes: 450 Uptime: 1m Memory: 15.55 GiB used: 6.19 GiB (39.8%)
Init: systemd v: 245 runlevel: 5 Compilers: gcc: 9.3.0 alt: 9 Shell: bash
v: 5.0.17 running in: gnome-terminal inxi: 3.0.38
Code: Select all
lsblk -if
Code: Select all
NAME FSTYPE LABEL UUID FSAVAIL FSUSE% MOUNTPOINT
sda
|-sda1 vfat 148F-CD5E 63.3M 34% /boot/efi
|-sda2
|-sda3 ntfs 88F69E25F69E1392
|-sda4 ntfs 6ACAFA33CAF9FB61
`-sda5 ext4 5eb722a3-da68-4690-9a55-02c42d026f99 29.6G 86% /run/timeshift/backup
nvme0n1
As a reminder, I would like to move my file structure from the T-FORCE 512GB drive to the TM8FP6001T size: 953.87 GiB drive. I want to still have the dual boot option, e.g. LM first, and automatic if I do not choose anything, but also still be able to select Win10 for "Windows" stuff. I want my LM files to run on the 1TB drive, and my Windows OS to run on the 512GB drive, but I defer to your expertise if that is advisable.
I wish there was a way I could use LVM or something like that to have access to the full 1.4TB, but I am not sure if that is better than having dual boot capability, with LM on the 1TB nvme drive, and Win10 on the 512GB.
Again, I defer to your expertise for optimal operational suggestions and of course, the tutorial. Please advise on the steps I can take at your convenience.
Thanks again!
-
- Level 16
- Posts: 6054
- Joined: Mon Aug 27, 2012 10:17 pm
Re: Move boot from one drive to another
All good. Get well soon.
I look forward to whatever you are able to send when you are able to send it.
I look forward to whatever you are able to send when you are able to send it.
-
- Level 16
- Posts: 6054
- Joined: Mon Aug 27, 2012 10:17 pm
Re: Move boot from one drive to another
I've decided there are far too many variables so I'll post what I've got and will add some notes just below, above the text of what was to be the tutorial, which I haven't reviewed or tested at all. You're going to have to figure it out from notes below and the untested, unchecked body of the unfinished tutorial.
Once you have installed the new Linux and both drives are back in the machine, you need to boot into the old Linux and mount the new Linux root to
/mnt
, probably with something like:sudo mount /dev/sda4 /mnt
Use
lsblk -if
to find the replacement for /dev/sda4
in the example above.Now, assuming you have a single root and home partition for Linux on the old drive and on the new drive, you
rsync
the old Linux to the new one. Do this only from within the old Linux:Code: Select all
sudo rsync -ahPHAXx --delete --force --exclude={/.dbus,/.Trash,.Trash-1*,.local/share/Trash,/Trash,/swapfile,/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found,/etc/fstab,.cache,/var/log/*,/var/tmp/*} / /mnt
[rsync output... displayed here]
for i in /dev /dev/pts /proc /sys; do sudo mount -B $i /mnt$i; done
sudo chroot /mnt
update-initramfs -u -k all
update-grub
exit
for i in /dev/pts /dev /proc /sys; do sudo umount /mnt$i; done
sudo umount /mnt
/home
partition on both Linux installations, you must do the above, and after unmounting /mnt
, mount the new /home
(mount /home, not /home/your.username) to /mnt
and:sudo rsync -ahPHAXx --delete --force /home/ /mnt
Next, unmount
/mnt
and run lsblk -if
and identify the UUID of your new /home partition, then remount the new Linux root to /mnt
once more, and edit its fstab
.xed admin:///mnt/etc/fstab
Add a line to mount the new home partition by UUID. If you have some other configuration then you'll have to work it out yourself, however your best approach is to mirror the partition scheme for the new Linux from the information you have about your old Linux partitions, except that on the new drive, you can create larger partitions or add extra ones. This way, you keep things fairly well under control.
Also, if you do have a separate home partition and you're not sure how to write the mount instructions in
/etc/fstab
on the new Linux, the contents of the old Linux fstab
will assist you. Once you are ready to delete the old Linux, go ahead and delete the Linux partitions and reinstall Windows from scratch on the old drive. When you are all done and ready to use the new Linux, which should now be a fully synchronised copy of your old Linux, run
sudo os-prober
, followed by sudo update-grub
, this should pick up the new Windows installation and remove any reference to the old, now deleted Linux.Now, all of the foregoing and all of the following has not been reviewed. It may contain errors. I haven't checked it, nor have I tested what has been written so far.
===================================================
TL;DR Overview
It is possible to move a Linux installation off a shared disk dual boot and over to another drive, but possible is not the same as feasible, and feasible does not necessarily imply either easy or foolproof. Moving one operating system off a dual boot drive is a highly complex procedure and there are no step-by-step instructions for it because of the enormous amount of variability and the risk involved. If you make one solitary mistake, your data could be toast. Given that last point, only the foolhardy and the ignorant would advise someone else to proceed with such an idea, especially to advise someone who is even a little unsure. As a consequence, the only safe advice is to a) backup your important data, b) verify the backup, c) backup again, not just make a copy of the backup, d) clean install both Linux and Windows operating systems, and e) copy the missing files from the old Linux to the new one.
You will install Linux to the new drive with the dual boot disk removed from your machine, or at least disconnected. Next, you will put the dual boot drive back in to your machine or reconnect it, and then you will boot into the old Linux and synchronise it with your new Linux. When that is done and testing has been performed to your satisfaction, you can then delete the Linux partitions from the original dual boot disk and either a) reinstall Windows or b) use disk utilities to expand the main Windows 10 partition to take up the space vacated by the old Linux.
The option described here is the safest because it keeps Windows away from Linux, and you should be able to boot into Windows from the Linux boot menu since Linux normally detects Windows and adds a boot menu entry for it, except in cases where you have a mixed UEFI Windows and a BIOS/CSM Linux because a Linux running in CSM mode usually does not detect Windows installed in UEFI mode.
Objective
The objective is to move a Linux installation to another drive so that a) Windows 10 can make use of the space vacated by the moved Linux, and b) to avoid the need to reinstall all your Linux software and redo the user interface to your liking.
Prerequisites
You will need know how to use your machine's BIOS boot key to select a drive to boot from. The key varies from manufacturer to manufacturer. Sometimes it is
F11
, sometimes F12
, F2
or something else entirely. If you don't know what the boot key is for your machine, consult its user manual before proceeding.Your existing Linux Mint must be fully updated before you start this procedure.
Do not use this procedure to migrate from one version of Linux Mint to another. It will not work, you'll end up with a copy of your older version.
These instructions rely on your ability to read and understand information like this:
Code: Select all
NAME FSTYPE LABEL UUID FSAVAIL FSUSE% MOUNTPOINT
sda
|-sda1 ntfs System Reserved 407A8ACD7A8ABEE2
|-sda2 ntfs WIN10-Z390 123092F13092DB55
|-sda3 ntfs AAC0FE15C0FDE809 200G 60% /
`-sda4 ext4 4ec6b2cd-55db-f1e9-ec34-e049124c2ac4
sdb
`-sdb1 ext4 BACKUP-SSD 2a77fb71-fdd1-4112-81a4-3808e0cec909
What is the risk?
Risk 1: Data loss
I have performed this procedure many times and while I'm confident that it works, I can't allow for every eventuality in a short tutorial, so if your skills and knowledge are low, and there's no shame in not knowing Linux magik, then your risk is higher. You must be able to adjust these instructions to your own situation. In general, as long as the instructions are followed and you think through the consequences of the decisions you make, and confirm those decisions before you proceed to execute them, it should all go swimmingly pain-free. Backups are absolutely essential. Only you can decide the level of risk involving your Linux skills and knowledge, all I can do is bring it to your attention.
Risk 2: Installing in the wrong mode
You must install Linux in the same mode as it is currently installed on the drive it is being moved from, either UEFI or BIOS/CSM (Compatibility Support Module). If you fail to check for this and install in the wrong mode, you will have to start all over again.
The risk is low because the impact is only needing to clean install Linux again after removing it by deleting all the partitions on the target disk.
You can check the boot mode using this command:
inxi --machine
Notice UEFI at the start of the last line:
Code: Select all
Machine: Type: Laptop System: ASUSTeK product: Zephyrus S GX531GWR_GX531GWR v: 1.0
serial: <superuser/root required>
Mobo: ASUSTeK model: GX531GWR v: 1.0 serial: <superuser/root required>
UEFI: American Megatrends v: GX531GWR.305 date: 04/21/2020
Code: Select all
Machine: Type: Desktop System: Gigabyte product: X570 AORUS ULTRA v: -CF
serial: <superuser/root required>
Mobo: Gigabyte model: X570 AORUS ULTRA v: x.x serial: <superuser/root required>
BIOS: American Megatrends v: F31q date: 12/18/2020
These instructions have been tested over time but I cannot be held accountable or responsible if you misinterpret them. This tutorial is in a forum so if you don't understand something, ask. Again, only you can assess the magnitude of this risk.
Step 1: Backup, verify and backup again
Backup all of your important files from both Windows and Linux. If you have a shared partition for data used by both OS', back that up too. Verify that the backup is readable and can can be restored from, then back up again.
Step 2: Get your disks ready
Shut down your machine and remove or disconnect the drive that the two dual boot OS' reside on. Remove all other drives except the drive that you want to migrate your Linux to.
Step 3: Clean install Linux
Install Linux Mint in the usual fashion, of course you are installing to the only drive in the system. When the installation is complete, reboot and check the new installation. When you are satisfied, shut the machine down and go to the next step.
Step 4: Put the dual boot disk back
Plug your original disk back in and start your machine. You will need to use your machine's BIOS boot key to select the drive that the new installation resides on. The expectation here is that both your original OS drive and the drive with a newly installed Linux Mint are in the machine.
Step 5: The hard part
Code: Select all
NAME FSTYPE LABEL UUID FSAVAIL FSUSE% MOUNTPOINT
sda
|-sda1 ntfs System Reserved 407A8ACD7A8ABEE2
|-sda2 ntfs WIN10-Z390 123092F13092DB55
|-sda3 ntfs AAC0FE15C0FDE809 200G 60% /
`-sda4 ext4 4ec6b2cd-55db-f1e9-ec34-e049124c2ac4
Re: Move boot from one drive to another
Thanks so much for all the direction Kadaitcha Man. After I did the clean install on the new 1TB, I got scared, so I decided to take the chicken-way out... I simply restored my TimeShift from the 512GB drive tot he 1TB nvme. All is working as I wanted. I am getting my Grub option to: 1) boot automatically into the new LM install, 2) boot into Windows, and 3) boot into the previous LM install. So all I need to do now is remove the "old" LM install on the 512GB drive, update Grub, and I should be good to go. That is a task for another day - unless you have an easy way to do that. I will be making another Forum entry for assistance on that task, though, since I now believe "move boot from one drive to another" is now resolved.
Thanks again for everything! I hope you are feeling better.
Thanks again for everything! I hope you are feeling better.