System Status
Buy Now
  • Email & Apps
  • Office 365
Login
  • MyRackspace Portal
  • Cloud Control Panel
  • Rackspace Webmail Login
  • Cloud Office Control Panel
  • Support Home
  • How-To
  • Developer Documentation
  •  Blogs 
    • Expert Insights Tech Blog
    • Rackspace Blog
    • Solve: Thought Leadership

Support Network

End-to-End Multicloud Solutions.   Solving Together.™   Learn more at Rackspace.com

How–To Home

Cloud Servers

  • Introduction
  • FAQ
  • All Articles

Mount a partition and chroot into your primary file-system from rescue mode

Last updated on:  2021-05-19

Authored by:  Rackspace Community


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:

  1. Determine your main partition by running the following command:

    fdisk -l
    

    Note: Depending on the version of the base image that you have built from, the partition is either sdb1 (Xen® Classic) or xvdb1 (XenServer®). Choose the largest partition with fdisk -l. This article assumes you use XenServer.

  2. Mount the partition by running the following command, replacing xvdb1 if necessary:

    mount /dev/xvdb1 /mnt
    

    When you navigate to the /mnt directory, you should see your file system.

    In some cases, you might need to install a new kernel, remove a bad package, or use xvdb1 as the root (/) directory.

Use xvdb1 as the root directory

Use the following steps to set xvdb1 as the / directory:

  1. 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
    
  2. 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.

Use the Feedback tab to make any comments or ask questions. You can also click Let’s Talk to start the conversation.

Share this information:

©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

See license specifics and DISCLAIMER

About Rackspace
  • About
  • Customer Stories
  • Events
  • Programs
Blogs
  • The Rackspace Blog
  • Expert Insights Tech Blog
  • Solve: Thought Leadership
  • News
  • Contact Information
  • Legal
  • Careers
Site Information
  • Style Guide for Technical Content
  • Trademarks
  • Privacy Statement
  • Website Terms
Support Network
  • Support Network Home
  • Rackspace How-To
  • API Documentation
  • Developer Center
  • ©2020 Rackspace US, Inc.