Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a SATA hot-swap cage in my Linux box. Is it possible to pass-through the SATA disk which is injected in that cage to a KVM guest? I have multiple disks however the SATA port will be always the same.

Ideally it should work just as without virtualization which means I can start the VM if no drive is present, can add it later without any manual intervention and remove it at any time (provided of course that OS does not access the drive anymore).

share|improve this question

You cannot pass-through inexistent device. But you can dynamically attach and detach it when you plug it in and out. You can use libvirt's virsh attach-disk/detach disk to simplify this.

I don't think there is a ready script doing that on VM start/stop, but it's not that hard to write one.

share|improve this answer
It is also possible to write custom udev rules to automate attaching/detaching disk to VM – DukeLion May 29 '12 at 10:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.