Skip to content

Commit 347cf34

Browse files
vm-build: ext3 & ext4: fix disk space allocation
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.
1 parent fd43dde commit 347cf34

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

build-vm

+3-3
Original file line numberDiff line numberDiff line change
@@ -433,10 +433,10 @@ vm_img_mkfs() {
433433
esac
434434

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

0 commit comments

Comments
 (0)