/srv/irclogs.ubuntu.com/2023/01/11/#ubuntu-server.txt

lunatiqis there anyway to limit a folder size?03:15
lunatiqI'm sorry03:15
lunatiqDirectory03:15
lunatiqLike if I want to limit a site added in apache203:16
arrayboltXElunatiq: This is somewhat of a hack, but you might be able to make an image file, format it with a filesystem, make a loop device with it, and then mount that device into the desired directory.03:16
arrayboltXEThat would effictively limit the size of the directory's contents to the size of the image file.03:16
lunatiqThat doesn't sound easy03:17
arrayboltXESomething like "dd if=/dev/zero of=./mysite.img bs=1G count=4 && mkfs.ext4 ./mysite.img" to make the image.03:17
arrayboltXEThen I *think* "sudo mount ./mysite.img /path/to/size_limited_directory" will mount it.03:18
arrayboltXEYou might need to use some losetup command first though.03:18
arrayboltXELemme test it real quick (it sounds complicated but this should be easy enough)03:19
sdeziellunatiq: I /think/ you can achieve that with ext4 quotas, see https://wiki.archlinux.org/title/Disk_quota03:19
arrayboltXEOn Ubuntu 22.10, just making the file, formatting it, and then mounting it directly works for me.03:20
arrayboltXEMight impact performance though. sdeziel's disk quota stuff might be better.03:20
sdeziellunatiq: if the directory in question is on btrfs or zfs, there are better ways to restrict space usage03:21
sdezielarrayboltXE: I don't know, I quite like your loop dev idea to be honest :)03:21
arrayboltXElol that was just the first thing that came to mind :P It *will* have some overhead, since it will make an ext4 filesystem on top of whatever other FS is already in use, which comes with a (hopefully slight) storage cost and likely a (hopefully slight) performance hit. I would imagine disk quotas would be faster since they only have to deal with one filesystem.03:22
lunatiqI'm trying to take note from what I learned yesterday about netplan and adding additional IP. I had to add the IP to the YAML and then a label. I made my nic:0 so could I essentially go from nic:0-999 ?03:46
lunatiqsuch as 03:46
lunatiq- 123.1.1.1/3203:46
lunatiqlabel: nic:003:47
lunatiq- 123.1.1.2/3203:47
lunatiqlabel: nic:103:47
lunatiqetc03:47
lunatiqto03:47
lunatiqlabel: nic:99903:47
lunatiqor 256 I mean03:48
lunatiq1-25603:48
sdeziellunatiq: what do you use the label for?03:53
lunatiqvirtual nic03:53
lunatiqvirtualization03:53
lunatiqIt's what I was told had to bbe done annd it worked03:54
sdezielOK, I thought it was just a label tied to an IP address03:54
sdeziellunatiq: the man page says you can go up to 15 chars long for the label so that should be enough for your numbering scheme03:55
=== chris15 is now known as chris14
=== arrayboltXE_ is now known as arrayboltXE

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!