Can I move LinuxMint 18.3 from one disk to other and save dualboot?

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
User avatar
Artur005
Level 2
Level 2
Posts: 58
Joined: Tue Jun 10, 2014 6:29 am

Can I move LinuxMint 18.3 from one disk to other and save dualboot?

Post by Artur005 » Fri Feb 09, 2018 10:04 am

Hello!

I have Laptop with 2 disks (SSD and HDD). Now I have dual boot with Windows on SSD and Linux on HDD.
I want move Linux on SSD, keep dualboot and leave HDD only as storage disk.

1) Is it good idea? Or better reinstall both OS?
2) How hard is it? And what kind of problems could it cause?

THX in advance!

User avatar
prestonR
Level 5
Level 5
Posts: 844
Joined: Wed Jan 07, 2015 12:24 pm
Location: Harare

Re: Can I move LinuxMint 18.3 from one disk to other and save dualboot?

Post by prestonR » Fri Feb 09, 2018 1:27 pm

Make sure you have everything backed up. You'll have to restore or reinstall your grub, make sure you know how. The easiest by far is Supergrub2disk ( https://www.supergrubdisk.org/super-grub2-disk/ ), a small 20MB iso file that you burn on a USB. It sniffs out all bootable OS and lists them in a (Super) grub menu. Before starting out, boot from the Supergrub2disk USB and check if you can boot both OS, if it works you're good to go.

Create free space on the SSD
Unless your Windows does not occupy the whole SSD you'll need to shrink its main partition to free some space. This has to be done from Windows itself, using Disk Management ( http://dailylinuxuser.com/2015/11/how-t ... space.html ). Since you have plenty of space for data on your hdd, I'd consider about 40-50GB sufficient for the 2 new partitions, a root for Mint and a swap slightly larger than your installed ram, but it will of course also depend on the size of your existing Mint partition on the hdd. Done?

Create root and swap partitions in the freed space
As a general precaution it's always preferable to do sensitive operations from a system that is not running on either of the drives that are involved, e.g a Mint LiveUSB. Since this will take a while and the process should not be interrupted, turn off screensaver/lock or power save options after booting the LiveUSB and keep your eyes on the screen.

Start by using the Mint LiveUSB to create a suitably sized root partition on your SSD, formatted the same way the Mint partition on your hdd is (ext4?). Then create a swap partition formatted 'swap-use'. The actual moving of the Mint can be done in many ways, best read up on pros/cons:
- from the command line using dd
- with a simple copy and paste using 'Disks'
- with a dedicated tool like clonezilla

Fixing fstab and grub

After this is done you'll likely encounter 2 problems:
1. Any Mint writes the 'number plate' of the partitions it's been installed on to the text file /etc/fstab but the UUID number of the new partitions on the SSD will be different then the ones currently registered there. Use your LiveUSB to acquire the new numbers of root and swap. Open a terminal and run:

Code: Select all

lsblk -o NAME,SIZE,MOUNTPOINT,FSTYPE,UUID /dev/sda
where 'sda' is your SSD
then edit your /etc/fstab with your favourite text editor, I'm using xed in this example

Code: Select all

sudo xed /etc/fstab
and add the correct UUIDs. If you add a '#' at the beginning of the UUID line of the old ones it will switch them off and you don't have to remove them.

2. I suppose your machine is booted in Uefi mode and the SSD has an existing 'efi' boot partition. Since any existing grub entries will point at the hdd, booting Mint now will just boot the original on the hdd. If you want to keep this as a bootable backup, basically a triple boot, leave the hdd connected, if not, disconnect the hdd to avoid getting dead entries in your new grub menu. To reinstall grub:
- boot Supergrubdisk and pick your new Mint on the SSD. If you're at the desktop remove Supergrubdisk/LiveUSB (again to avoid dead entries in your new grub menu) and run:

Code: Select all

sudo grub-install /dev/sda
if your 'efi' boot partition is on the SSD and the drive is indeed 'sda'.

Reboot and you're done.
Last edited by prestonR on Fri Feb 09, 2018 1:58 pm, edited 4 times in total.

User avatar
austin.texas
Level 20
Level 20
Posts: 12054
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: Can I move LinuxMint 18.3 from one disk to other and save dualboot?

Post by austin.texas » Fri Feb 09, 2018 1:38 pm

To give the correct procedure, you have to know if your Windows is installed in UEFI mode or Legacy/CSM.
What is the result of

Code: Select all

sudo parted --list
prestonR wrote:
Fri Feb 09, 2018 1:27 pm
Start by using the Mint LiveUSB to create a suitably sized root partition on your SSD, formatted the same way the Mint partition on your hdd is (ext4?). Then create a swap partition formatted 'swap-use'.
There is no problem with leaving the existing swap partition on the big hdd. There is no real point in moving that to the SSD.
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018

User avatar
prestonR
Level 5
Level 5
Posts: 844
Joined: Wed Jan 07, 2015 12:24 pm
Location: Harare

Re: Can I move LinuxMint 18.3 from one disk to other and save dualboot?

Post by prestonR » Fri Feb 09, 2018 2:12 pm

There is no problem with leaving the existing swap partition on the big hdd. There is no real point in moving that to the SSD.
That crossed my mind but if the OP ever removes the hdd it will cause an error that may cause confusion, especially if that happens after a long time of untroubled use. I agree, though, it saves one step but it's also a bit messy. If, however, the OP is encountering problems freeing enough space due to issues with unmovable files then yes, this is a good way to save some GBs.

To be honest; if it was me I'd always reinstall from scratch ...

Post Reply

Return to “Newbie Questions”