How to mount SolusIO VPS image files at CR filesystem?

Have more questions? Submit a request

Applicable to:

  • SolusIO

Question

How to mount SolusIO VPS image at CR filesystem?

Answer

Let's assume there is a VPS with UUID 11034e9b-2d3c-4692-8c5a-b08adc84f791

LVM-based or file-based raw image
  1. Connect to CR via SSH
  2. Find out the path to image file:

    # virsh domblklist 11034e9b-2d3c-4692-8c5a-b08adc84f791 | grep vda | awk {'print $2'}
    /var/lib/libvirt/images/295/aad5e792c6b484891b7bf140210028bc

  3. Map the image partitions:

    # kpartx -a -v /var/lib/libvirt/images/295/aad5e792c6b484891b7bf140210028bc
    add map loop1p1 (253:0): 0 716800 linear 7:1 2048
    add map loop1p2 (253:1): 0 83165184 linear 7:1 718848

  4. Create a directory and mount the corresponding partition:

    # mkdir /mnt/storage
    # mount /dev/mapper/loop1p2 /mnt/storage

    Note: For mounting partitions with ntfs(Windows VPS images) it is necessary to install ntfs-3g package.
  5. When the work with partition is finished unmount partition and unmap the image:

    # umount /mnt/sysimage
    # kpartx -d /var/lib/libvirt/images/295/aad5e792c6b484891b7bf140210028bc

file-based qcow2 image
  1. Connect to CR via SSH
  2. Find out the path to image file:

    # virsh domblklist 11034e9b-2d3c-4692-8c5a-b08adc84f791 | grep vda | awk {'print $2'}
    /var/lib/libvirt/images/295/aad5e792c6b484891b7bf140210028bc

  3. Install libguestfs-tools-c package:

    # yum install libguestfs-tools-c

  4. Create a directory and mount the image using the image path from step 2:

    # mkdir /mnt/storage
    # guestmount -a /var/lib/libvirt/images/295/aad5e792c6b484891b7bf140210028bc -i --rw /mnt/storage

  5. When the work with partition is finished unmount partition and unmap the image:

    # fusermount -u /mnt/sysimage

Articles in this section

Was this article helpful?
0 out of 0 found this helpful
Share

Comments

0 comments

Please sign in to leave a comment.