mxs kolo
2017-Nov-13 17:33 UTC
[libvirt-users] how to add mount options for root filesystem inside lxc container
Hi all We use libvirt 3.0.0 + lxc, disk for container described with <filesystem/> tag, example: <filesystem type='block' accessmode='passthrough'> <source dev='/dev/data/lvm-part1'/> <target dir='/'/> </filesystem> Now we start use ssd disk and think how to provide additional options for mount root FS in container: "discard" and "nobarrier" options for XFS. All level below XFS configured for support trim command ("options raid0 devices_discard_performance=Y" and "issue_discards = 1") I try set options inside container in /etc/fstab, it's not worked: /dev/root / rootfs discard,nobarrier,defaults 0 0 or /dev/root / rootfs discard,nobarrier 0 0 or /dev/root / rootfs remount,discard,nobarrier,defaults 0 0 or /dev/root / rootfs remount,discard,nobarrier 0 0 I found 2 solutions: 1) use 2 lvm partitions - one for base OS system, and second - for data. Second lvs attach as block device /dev/vdX inside container. Now we can mount /dev/vd? with desirable options inside container 2) more tricky variant - before container start, mount her root filesystem on hardware node with desirable options. Then after container started, her filesystem would be mounted with same options as on hardware node. But probably exists another way ? Has <filesystem/> support for mount options ? b.r. Maxim Kozin
Apparently Analagous Threads
- autpfs + nfs stuck on stat() inside libvirt lxc 1.2.18
- Re: libvirt 5.0.0 - LXC container still in "virsh list" output after shutdown
- How automatically set group.devices.allow for libvirt-lxc container after start ?
- 1.2.7 and 1.2.8 fail to start container: libvirt_lxc[4904]: segfault at 0 ip ...error 4 in libc-2.17.so[
- Re: /proc/meminfo