3

I am using a Nebula server from where it is only possible to install Ubuntu 16.04 with the kernel 4.4.0-210-generic.

I wish to install a newer version of linux on my instance.

Virtualization

I have tried making a virtual machine from within Ubuntu, (with libvirt) but I get the message:

ERROR Host does not support any virtualization options

However, when I check lscpu I get:

Virtualisation:        VT-x

Using grub and another disk with installable ISO

So then I was thinking that I could try to replace the whole operating system manually from within itself.

I have the power to create new drives for the instance.

So I added a 16GB drive

$ lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0   16G  0 disk 
├─sda1   8:1    0  2,9G  0 part 
└─sda2   8:2    0  3,9M  0 part 
sr0     11:0    1  364K  0 rom  
vda    253:0    0  500G  0 disk 
└─vda1 253:1    0  500G  0 part /

and made it an Ubuntu disk with

dd if=ubuntu20.04.iso of=/dev/sda

However, I don't have the power to change the drive to boot from.

  • My "old" os drive has the id 0
  • my new Ubuntu ISO drive has the id 2

the Nebula configuration is hard-coded to boot from id 0 and I cannot change it.

I checked my system on the /boot directory and I found that the boot system is GRUB.

So I checked the version

grub-install --version

And it seems to be Grub2

grub-install (GRUB) 2.02~beta2-36ubuntu3.32

I was wondering if it is possible to tell grub to boot into my ubuntu20.04 disk and then install over the disk with id0 called vda?

Replacing the OS by simply replacing files in the system.

If it is not possible to run an installer, then I was thinking about just replacing the kernel and all the operating system files manually. However, I am pretty sure the system will crash if I replace files that the system I currently using -- but maybe there is a way to do it in a correct order.

3
  • Can't you just upgrade the Ubuntu 16.04 to a newer version? Commented Dec 31, 2021 at 12:31
  • Linux OS ? What do you mean ? The Linux kernel + minimal set of basic procs to build from sources or whatever bloated binary distro based on the Linux kernel ? First option is just easy, second ? I cannot tell, I never tried.
    – MC68020
    Commented Dec 31, 2021 at 15:15
  • Replacing a file that is in use is fine. When you remove a file, it is not deleted, until in is no longer in a directory and no longer in use. Commented Jan 8, 2022 at 15:55

2 Answers 2

3
+50

Upgrading Ubuntu from a version to a newer is possible at the command line

The main tasks are sudo apt install update-manager-core this install the updater. Then sudo do-release-upgrade.

See https://www.cyberciti.biz/faq/upgrade-ubuntu-18-04-to-20-04-lts-using-command-line/

0

In case you can't update your Ubuntu install as another answer suggests, you can point GRUB at your install disk by grabbing its disk identifier (in the form of (hdX, msdosY) or (hdX,gptY) and manually creating a menuentry in /boot/grub/grub-cfg [1]

menuentry "New Ubuntu Install Disk" {
          search --set=root --label GRUB --hint hdX,msdosY
          linux /path/to/vmlinuz #likely in /boot/
          initrd /path/to/initrd #also likely in /boot/
}

Also maybe you have more control over boot order than you realise: efibootmgr (docs) can be used to alter boot devices manually.

Alternatively, you can reboot and enter the GRUB command line manually (with c), and boot into your installer from there (this is a one-time endeavor though). Instructions on how to do that here

[1] https://www.gnu.org/software/grub/manual/grub/grub.html#Multi_002dboot-manual-config

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .