Skip to content

Instantly share code, notes, and snippets.

@r4um
Created August 20, 2013 18:35
Show Gist options
  • Save r4um/6285376 to your computer and use it in GitHub Desktop.
Save r4um/6285376 to your computer and use it in GitHub Desktop.
Mount disk under Xen dom0
  • Get name label and hypervisor of the disk, login to the hypervisor
# xe vdi-list name-label=ROOT-892
uuid ( RO)                : 5948fee1-28a4-4d37-a38d-cda7527b366d
          name-label ( RW): ROOT-892
    name-description ( RW):
             sr-uuid ( RO): d3a28e40-b840-556a-596f-e5e8412edd81
        virtual-size ( RO): 289910292480
            sharable ( RO): false
           read-only ( RO): false
  • Get control domain
# xe vm-list name-label='Control domain on host: foo'
uuid ( RO)           : b6732538-5e9e-4a55-b845-42489fce76c5
     name-label ( RW): Control domain on host: foo
    power-state ( RO): running
  • Create VBD
# xe vbd-create device=0 vm-uuid=b6732538-5e9e-4a55-b845-42489fce76c5 vdi-uuid=5948fee1-28a4-4d37-a38d-cda7527b366d bootable=false mode=RW type=Disk
deabea56-b613-1ccd-2e8d-fa1f31e579e0
  • Plug the VBD
# xe vbd-plug uuid=deabea56-b613-1ccd-2e8d-fa1f31e579e0
  • Now disk will appear (most likely /dev/xvda)
# fdisk -l /dev/xvda
Disk /dev/xvda: 289.9 GB, 289910292480 bytes
255 heads, 63 sectors/track, 35246 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1               1         608     4883728+  82  Linux swap / Solaris
/dev/xvda2   *         609       35246   278229735   83  Linux
  • mount relevant partition
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment