Mounting Xen DomU disk images in Dom0 using lomount

This document (3756370) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Server 10 SP1
openSUSE 10.3

Situation

Access to a Xen DomU disk image is needed for file system level management, troubleshooting and boot issues.

Resolution

In some rescue scenarios it may be desirable to open a disk image and manipulate the files directly, as opposed to booting a rescue system. This scenario is particularly useful when:
  • You do not need network access
  • You do not need to access particular devices, rather you need to access the file system
  • You are trying to fix boot problems
  • A chrooted environment is sufficient
  • The disk or file system to be manipulated does NOT use LVM
  • You are not trying to repair an underlying filesystem

setup: discovering partitions, mounting and chrooting
  1. Navigate to the directory where the disk image can be found.
  2. Determine what loopbacks are currently being used
    • To determine all the loops type
      ls /dev/loop*
    • Determine which loops have been assigned
      losetup -a
    • Pick a loop device which has not been assigned
    • Open the disk image using loopback devices; replace values as appropriate
      losetup /dev/loop5 disk0
    • Determine what the partitions are
      fdisk -l /dev/loop5
  3. Mount partitions that are NOT type 82 (swap) or type 8e (Linux LVM).
    • The syntax is: lomount [-verbose] [OPTIONS] -diskimage FILE -partition NUM [OPTIONS]
      lomount -t reiserfs -diskimage disk0 -partition 3 /mnt
    • Check /mnt or the mount point. If it does not look like the root file system, unmount the file system and try again until you find the root file system.
  4. Repeat step 5 for each files system. Mount the file systems under their normal mount point, but under /mnt. For example, /var for the DomU should be mount to /mnt/var.
  5. If the system that you are accessing is the same architecture, you may chroot to the system.
    chroot /mnt

cleanup: umounting and removing the loopback device
  1. Unmount the mounted partitions
    umount
  2. Remove the loop device setup
    losetup -d /dev/loopX

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:3756370
  • Creation Date: 14-Feb-2008
  • Modified Date:14-Dec-2021
    • SUSE Linux Enterprise Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

Join Our Community

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.


SUSE Customer Support Quick Reference Guide SUSE Technical Support Handbook Update Advisories
Support FAQ

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.

Go to Customer Center