Mount a partition and chroot into your primary file-system from rescue mode
This article shows how to mount a partition and use the chroot command 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 your main partition by running the following command:
fdisk -lNote: Depending on the version of the base image that you have built from, the
partition is eithersdb1(Xen® Classic) orxvdb1(XenServer®).
Choose the largest partition withfdisk -l. This article assumes you use XenServer. -
Mount the partition by running the following command, replacing
xvdb1if necessary:mount /dev/xvdb1 /mntWhen 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 (/) directory.
Use xvdb1 as the root directory
Use the following steps to set xvdb1 as the / directory:
-
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
chrootoperation by running
the following commands:ln -s /etc/resolv.conf /mnt/etc/resolv.conf chroot /mnt /bin/bashThe file system is now mounted as the root directory.
Use the Feedback tab to make any comments or ask questions. You can also click Let's Talk
to start the conversation.
Updated 8 months ago
