Mount a partition and chroot into your primary file-system from rescue mode
This article shows you how to mount a partition and use chroot to access your primary file system from rescue mode.
Begin an investigation of a server in rescue mode
Use the following steps to begin an investigation of a server in rescue mode:
Determine what your main partition is by running the following command:
Note: Depending on the version of the base image that you have built from, the partition is either
sdb1(Xen® Classic) or
fdisk -l, choose the largest partition. This article assumes that you are using XenServer.
Mount the partition by running the following command, replacing
mount /dev/xvdb1 /mnt
When you navigate to the
/mntdirectory, you should see your file system.
In some cases you might need to install a new kernel, remove a bad package, or use
xvdb1as the root (
Use xvdb1 as the root directory
Use the following steps to set
xvdb1 as the
Mount the necessary file system directories by running the following commands:
mount -t proc none /mnt/proc mount --rbind /sys /mnt/sys mount --rbind /dev /mnt/dev
Set up networking for your session on which you used the chroot operation by running the following commands:
ln -s /etc/resolv.conf /mnt/etc/resolv.conf chroot /mnt /bin/bash
The file system is now mounted as the root directory.
©2020 Rackspace US, Inc.
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License