LXC runs out of inodes. Ways to avoid this without ZFS

Aug 5, 2020
7
0
21
Hi together,

I have an LXC container (EXT4). I am currently testing NixOS. The container is working fine, no problems. But by design it deals with a lot of small files.
As a consequence I ran out of inodes. Sure I can add more space to the container and solve it this way, but this seems not ideal for me.

I tried to setup the same container with BTRFS. This works nice and my inode problem is solved. But actually Proxmox doesn't support quotas for BTRFS, so each container can use the full data volume. This is something that I don't want.

Now is my question: How can I avoid the inode problem? Is there any solution?
I don't plan to use ZFS since I don't have (and plan) a second SSD and it looks to some overkill for me.
 
How could each lxc use the full btrfs data volume as you give the lxc a disk with size ? And why you want inside this disk quotas ?
Anyway xfs has dynamically inode generation and even quotas which are done by kernel so any application even pve has to live with and cannot ignore by not support as at reaching limit there's stop :)
 
"here" is empty but anyway ... Yes, you can do a lxc with xfs:
First dnf install xfsprogs or apt install xfsprogs inside the lxc
stop lxc
cd .../images/<machine-id>
mkdir e x
cp –a <vmid>.raw <vmid>.raw.xfs
mkfs.xfs -f <vmid>.raw.xfs
mount –o loop <vmid>.raw e
mount –o loop <vmid>.raw.xfs x
cd e
cp –a * .??* ../x/.
cd ..
sync
umount e
umount x
rmdir e x
rm –f <vmid>.raw
mv <vmid>.raw.xfs <vmid>.raw
start lxc
 
Thanks waltar, this looks promising but also a bit hacky.
I red that xfs needs a priviledged container? Do you use xfs in an container and can say how stable it is?
Yeah I messed up with the link. I corrected it now.

Okay I tried it. My problem is that I can't find the dir where the .raw files exists. I found only /dev/pve but this aren't the .raw files.
 
Last edited: