Copied system partitions to USB disk, how to proceed to make a clone?

Bo Berglund bo.berglund at gmail.com
Tue Oct 19 13:16:41 UTC 2021


On Tue, 19 Oct 2021 01:21:48 +0200, Liam Proven <lproven at gmail.com> wrote:

>On Tue, 19 Oct 2021 at 01:03, Bo Berglund <bo.berglund at gmail.com> wrote:
>
>> Here I could resize the Windows partition to 98 GB with 56 GB free.
>
>You can probably shrink that further with Gparted.

>You can do
>powercfg /h off

Did this too. Before rebooting...

Then used the trick Shift-Winkey-Power-Reboot to get to a menu where I could
select the Ubuntu USB key to boot from.

>From Linux, delete c:\pagefile.sys and c:\hiberfil.sys and
>c:\swapfile.sys (if the latter 2 are still there). Delete everything
>in c:\windows\temp too.

I did not realize before that one could do this, but once GParted showed the
device names I could start a terminal and mount the Windows partition at
/mnt/windr and then I could navigate into the drive and remove all 3 sys files
(they were all there) and clean out Windows/Temp too. Pretty big the sys files
were too.


>Then use Gparted to shrink the partition until it's 75% used. Sounds
>like it's about 43% used at present to me.

I shrunk it to 60 GB giving me even bigger free space, now at 416 GB

>> Does it matter which flavour of Ubuntu I run in this case? Mint or the stock
>> version?
>
>Actual Ubuntu, not Mint. Which desktop shouldn't matter. If you have
>display problems, maybe a lightweight one like Xubuntu or Lubuntu?

No display problems just that I will at the end have Ubuntu 20.04 *server* and I
am uncomfortable with how Ubuntu has changed the desktop so there is no menu
anymore and one has to search for everything which was at a known position in
the main menu before!
But I have now replaced Mint with stock Ubuntu on the USB key, I will probably
only use GParted and the terminal before it is all gone again anyway.

>
>> If I do the above with a GUI style Ubuntu, then it will get wiped in thís step,
>> right? So I get my server 18.04 instead like I aimed for.
>> Of course then I will also have to run the do-release-upgrade on that to get to
>> 20.04...
>
>Aha! It's not upgraded yet.

Haven't dared yet...

>
>Well, if you have backups, you could upgrade it first.

This involves an unknown amount of down time for the running server. I don't
want that so this is why I wanted to make full partition copies of the active
server (while it was shut down).
I used the GParted live CD then.
The plan is to use GParted Live again after Ubuntu 20.04 is installed to move
the backed up system partition from the backup disk onto the new system.

Can one copy *data* from one partition into another existing partition instead
of into empty disk space?
At that moment I will have the Ubuntu 20.04 system partition with a working
Ubuntu and a backup clone of my 18.04 system partition on the existing server.
Either I will be able to overwrite the system partition on the new server or I
have to first erase it and copy/paste from the backup drive into the empty
leftover space...
I suspect that the dvice name will change if I first erase the partition and
then copy paste and that might screw up the booting?

>
>Or, see if 18.04 will install -- then the EFI boot files will match versions.
>

I will install 20.04 first and see if I can switch the Ubuntu partition from
20.04 to 18.04 after I have verified that it all works so far.

QUESTION:
---------
I have never used dual-boot systems before and now I wonder if there is some
kind of menu popping up on start which needs to be interacted with in order to
boot the correct system?

If so, how can I issue a sudo reboot from an SSH session to Ubuntu so it will
reboot to Ubuntu and not Windows?
I will not be able to see the boot menu if such is popping up since at that time
I have lost connection by SSH.

This is by far the most advanced Linux operations I have done, my only exposure
before has been to install Ubuntu Server 18.04 on two PC:s and then install
openvpn etc on them.
And of course all of the Raspberries I have cluttering my desk...
But these are all one-off installs on SDcard.


-- 
Bo Berglund
Developer in Sweden





More information about the ubuntu-users mailing list