2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

libvirt の image 保存ディレクトリの変更

Posted at

Fedora29 を使っていますが、デフォルトのマウント方法なので、/dev/mapper/fedora-root は / に、/dev/mapper/fedora-home が /home マウントされていて、それぞれ 49G と 1.1T の容量となっています。/var/lib/libvirt は、/ に入っているので、/var/lib/libvirt/images にイメージが増えていくと、あっという間に / の容量が一杯になってしまいます。

特に、preallocation=full などとすると、sparse 化できないため、これはいけません。

そこで、images ディレクトリだけ、/home に作成することにしました。

# mkdir /home/<user>/libvirt/images
# ln -sf /home/<user>/libvirt/images /var/lib/libvirt/images
# semanage fcontext -t virt_image_t -a "/home/<user>/libvirt/images"
# restorecon /home/<user>/libvirt/images

qemu ユーザーを、 グループに追加することも必要だったかな。

# usermod -aG <user> qemu
# chmod 770 /home/<user>
2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?