Posts

Showing posts with the label linux grub grub2 iso netboot mini.iso reinstall ubuntu vps replaceos

Reinstalling Ubuntu 16 Xenial from within Linux

I have rented a KVM-based VPS from a provider and wanted to reinstall the templated Ubuntu 14.04 install that can with it. This is how I did it. I basically remove the 4GB swap drive (/dev/vda2) and write the mini.iso on top of it. Then I tell the grub2 bootloader to boot using the partition, and then I reboot the machine. Enjoy! # swapoff /dev/vda2 # sudo sed -i '/ swap / s/^/#/' /etc/fstab # fdisk /dev/vda ( alternatively use the easier 'cfdisk /dev/vda') press ‘d’ for delete press ‘2’ for partition 2 press n for new partition press p for primary press 2 just fill in the defaults press ‘w’ to write This may display: WARNING: Re-reading the partition table failed with error 16: Device or resource busy. The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8) Syncing disks. $ wget -O ubuntu.iso http://archive.ubuntu.com/ubuntu/dists/xenial-updates/...