Difference between revisions of "Accessing your guest from the rescue image"

From PrgmrWiki
 
Line 4: Line 4:
 
Shut down your machine if it is running. Then select  
 
Shut down your machine if it is running. Then select  
 
<pre>
 
<pre>
     2. create/start, opens OOB console (try this if the machine is not running)
+
     6. set bootloader or rescue mode
 
</pre>
 
</pre>
This will bring up a menu resembling:
+
This will bring up a menu:
 
<pre>
 
<pre>
    GNU GRUB  version 0.97  (131072K lower / 0K upper memory)
+
Set Boot Options - nite
  
+-------------------------------------------------------------------------+
+
Configured to boot from disk.
| user bootloader configuration                                          | 
+
 
| Debian GNU/Linux, kernel 3.2.0-4-amd64 Live Rescue                     |
+
Options:
| Debian GNU/Linux, kernel 3.2.0-4-amd64 (single-user mode) Live Rescue  |
+
1. Boot from disk
| ubuntu-trusty-14.04-64 rescue                                           |
+
2. Linux-based Live Rescue
| ubuntu-trusty-14.04-64 install                                          |
+
3. Linux netboot installers - install mode
| centos5-64 rescue                                                      |
+
4. Linux netboot installers - rescue mode
| centos5-64 install                                                      |
+
5. BSD installers
| debian-wheezy-7.0-64 rescue                                            |
+
 
| debian-wheezy-7.0-64 install                                            |
+
0. Return to main menu
| fedora20-64 rescue                                                      |
+
R. refresh
| fedora20-64 install                                                    |
+
 
| centos6-64 rescue                                                      | v
+
enter selection>
+-------------------------------------------------------------------------+
 
    Use the ^ and v keys to select which entry is highlighted.
 
    Press enter to boot the selected OS, 'e' to edit the
 
    commands before booting, or 'c' for a command-line.
 
 
</pre>
 
</pre>
  
Boot <code>Debian GNU/Linux Live Rescue</code> from GRUB.
+
Select
 
+
<pre>
 +
    2. Linux-based Live Rescue
 +
</pre>
  
 
(note, any of the other "rescue" images should also work.  many userlands (well, libC)  require kernels that are within a certain range, so pick the one that looks right for you, and try others if it doesn't work)
 
(note, any of the other "rescue" images should also work.  many userlands (well, libC)  require kernels that are within a certain range, so pick the one that looks right for you, and try others if it doesn't work)

Latest revision as of 11:49, 26 December 2016

So, your guest doesn't boot. Perhaps the new xen upgrades broke things, and you need to upgrade your guest kernel to something more modern?


Shut down your machine if it is running. Then select

    6. set bootloader or rescue mode

This will bring up a menu:

Set Boot Options - nite

Configured to boot from disk.

Options:
1. Boot from disk
2. Linux-based Live Rescue
3. Linux netboot installers - install mode
4. Linux netboot installers - rescue mode
5. BSD installers

0. Return to main menu
R. refresh

enter selection>

Select

    2. Linux-based Live Rescue

(note, any of the other "rescue" images should also work. many userlands (well, libC) require kernels that are within a certain range, so pick the one that looks right for you, and try others if it doesn't work)

Log in as root.


Now, mount your writable partition

mount /dev/xvda1 /mnt

If you have multiple partitions, you may need to try mounting each one and running 'ls /mnt' to find the root partition. Remember to run 'umount /mnt' before looking at the next one.

Once the main root partition has been mounted on /mnt, bind mount /proc /dev/ and /sys so they will be available in the chroot

for i in /proc /sys /dev /dev/pts /dev/shm ; do
    mount -o bind $i /mnt/$i
done

If you need to resolve DNS entries and you are using dhcp with your writeable image, check the output of

cat /mnt/etc/resolv.conf

and if it doesn't contain any nameserver entries, also do

cp /etc/resolv.conf /mnt/etc/resolv.conf 

From here, you can "change root" (chroot) to /mnt/ so you are now running with your main file system using the prgmr.com rescue kernel.

chroot /mnt/

apt-get, yum, or whatever you use to upgrade your kernel should work from here. You may get a problem if the rescue kernel is way too different from your userland kernel, in which case you should go back to step 1 and use a different rescue type.

To clean up, use

exit #if still in chroot
for i in /dev/pts /dev/shm /proc /sys /dev  ; do
    umount /mnt/$i
done
umount /mnt