VM recovery via cloud console: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 8: Line 8:


<!--T:5-->
<!--T:5-->
The recovery procedure is not that easy and convenient, as you would expect from CentOS; the functionality is the same or at least similar. Most cloud images have the root account locked, so just booting single user won't help us. However, when a Linux-based system boots, regardless what flavor it is, the kernel gives up the control into userspace for all things related to userspace, like running daemons, etc. That is done as soon as all the hardware is initialized, then the kernel runs a single userspace binary, called the <code>init</code> process which always has PID1; in most recent distributions it is either <code>systemd</code>, <code>systemV</code> or <code>upstart</code>. Via the bootmanager we are able to modify that and tell the kernel to execute a shell instead and manually mount the image filesystem and do our recovery operations. The debian10 image comes with grub2 as well, but the menu looks a little different; however, the keys and key combinations we need to use are all the same. Reboot or boot the system until you see the grub menu then hit <code>e</code> for edit and remove the serial consoles and add <code>init=/bin/bash</code> to let the kernel know the new <code>initprocess.
The recovery procedure is not that easy and convenient, as you would expect from CentOS; the functionality is the same or at least similar. Most cloud images have the root account locked, so just booting single user won't help us. However, when a Linux-based system boots, regardless what flavor it is, the kernel gives up the control into userspace for all things related to userspace, like running daemons, etc. That is done as soon as all the hardware is initialized, then the kernel runs a single userspace binary, called the <code>init</code> process which always has PID1; in most recent distributions it is either <code>systemd</code>, <code>systemV</code> or <code>upstart</code>. Via the boot manager, we are able to modify that and tell the kernel to execute a shell instead and manually mount the image filesystem and do our recovery operations. The debian10 image comes with GRUB2 as well, but the menu looks a little different; however, the keys and key combinations we need to use are all the same. Boot or reboot the system until you see the GRUB menu, then hit <code>e</code> for <i>edit</i>. Remove the serial consoles and add <code>init=/bin/bash</code> to let the kernel know the new <code>init</code> process.


<!--T:6-->
<!--T:6-->
Modify the line after <code>linux</code> like the below example:
Modify the line after <code>linux</code> like below:


<!--T:7-->
<!--T:7-->
rsnt_translations
56,420

edits

Navigation menu