Skip to content

Commit

Permalink
vm-build: ext3 & ext4: fix disk space allocation
Browse files Browse the repository at this point in the history
We did fallocate the root device explicit to ensure available disk space
according to the config. However, the mkfs is operation with discard and
frees the disk space again.

This leads to over-commited when having multiple worker instances.

So we explicit disable the punch hole/fallocate call inside of mkfs.ext3
and mkfs.ext4 by setting nodiscard.

An obs worker instance will disable itself when running into this situation.
  • Loading branch information
adrianschroeter committed May 2, 2024
1 parent fd43dde commit 347cf34
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions build-vm
Original file line number Diff line number Diff line change
Expand Up @@ -433,10 +433,10 @@ vm_img_mkfs() {
esac

# defaults for creating the filesystem
vm_img_mkfs_ext4_options='-O ^has_journal,^huge_file,^resize_inode,sparse_super,^metadata_csum'
vm_img_mkfs_ext4_extra='-E lazy_itable_init,discard'
vm_img_mkfs_ext4_options='-O ^has_journal,^huge_file,^resize_inode,sparse_super,^metadata_csum -E nodiscard'
vm_img_mkfs_ext4_extra='-E lazy_itable_init,nodiscard' # overwrites -E from _options by default
vm_img_mkfs_ext4="mkfs.ext4 -m 0 -q -F $vm_img_mkfs_ext4_options"
vm_img_mkfs_ext3='mkfs.ext3 -m 0 -q -F'
vm_img_mkfs_ext3='mkfs.ext3 -m 0 -q -F -E nodiscard'
vm_img_mkfs_ext2='mkfs.ext2 -m 0 -q -F'
vm_img_mkfs_reiserfs='mkreiserfs -q -f'
vm_img_mkfs_btrfs='mkfs.btrfs'
Expand Down

0 comments on commit 347cf34

Please sign in to comment.