Skip to content
This repository was archived by the owner on Mar 30, 2023. It is now read-only.

Commit 7fcce79

Browse files
committed
Ideas for mount and mkfs options
This: * ensures no lazy creation post mkfs * removes the journal, apparently this speeds up writes a little * set FS block size to 4k, to match NVMe block size, should stop some fragmentation that could happen a lead to slow down that is fixed by trim * explicit discard during fs creation (apparently its the default) * explicit discard on mount, keep freeing blocks as we delete things so we don't need to re-create the FS so often to get performance back
1 parent b3068c1 commit 7fcce79

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

fs-ansible/roles/beegfs/tasks/format-mount.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
tags: ['never', 'format', 'mount', 'unmount', 'stop_all']
1717

1818
- name: Format disks
19-
command: "mkfs.ext4 -i 8192 -I 512 -J size=400 -Odir_index,filetype /dev/{{ item }}"
19+
command: "mkfs.ext4 -E lazy_itable_init=0,lazy_journal_init=0,discard -b 4096 -i 8192 -I 512 -Odir_index,filetype,^has_journal /dev/{{ item }}"
2020
loop: "{{ all_disks }}"
2121
tags: ['never', 'format']
2222

@@ -31,7 +31,7 @@
3131
loop: "{{ all_disks }}"
3232

3333
- name: Mount EXT4 OSTs
34-
command: mount -onoatime,nodiratime,nobarrier,user_xattr /dev/{{ item }} /data/{{ fs_name }}/{{ item }}
34+
command: mount -onoatime,nodiratime,nobarrier,user_xattr,discard /dev/{{ item }} /data/{{ fs_name }}/{{ item }}
3535
register: command_result
3636
failed_when: "command_result.rc != 0 and ('is already mounted' not in command_result.stderr)"
3737
changed_when: "command_result.rc == 0"

0 commit comments

Comments
 (0)