Novell Home

My Favorites

Close

Please to see your favorites.

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

Novell Open Enterprise Server 2 (Linux based)
Novell openSUSE 10.3
Novell SUSE Linux Enterprise Server 10 Service Pack 1

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 NetIQ/Novell/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-08
  • Modified Date:27-APR-12
    • SUSESUSE Linux Enterprise Server

Did this document solve your problem? Provide Feedback