Mounting a USB device

  1. Attach the USB device to the Dom0 and run ‘dmesg’ to see if the device attached
  2. Run ‘fdisk -l’ to see if the drive is partitioned the way you want it
  3. For instance:
    [root@example ~]# fdisk -l /dev/sdc
    Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
    255 heads, 63 sectors/track, 121601 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Device Boot Start End Blocks Id System
    dev/sdc1 1 121601 976760001 8e Linux LVM
  4. Now find a drive letter that is not being used on the DomU, in this instance we’ll use /dev/sde
  5. To attach the USB device to the DomU run the following command
    • xm block-attach exampledomu phy:/dev/sdc sde w
  6. You should now see the device on the DomU, run either ‘dmesg’ or ‘fdisk -l’ to verify
  7. Mount the device as normal
    • mount /dev/sde1 /mnt/usb

Unmounting the device

  1. You first need to get the device id number from the block list. Do this by running:
    • xm block-list exampledomu
  2. This will return:
    Vdev BE handle state evt-ch ring-ref BE-path
    51712 0 0 4 9 8 /local/domain/0/backend/tap/23/51712
    2176 0 0 4 10 1338 /local/domain/0/backend/vbd/23/2176
  3. The number you need to use to remove the device is 2176
  4. Unmount the USB device from the DomU
    • umount /mnt/usb
  5. Now on the Dom0 run:
  6. xm block-detach exampledomu 2176
  7. You may now remove the USB device

Post to Twitter