SUSE 리눅스에서 ext4 파일시스템 생성시 주의사항
SUSE 리눅스는 기본적으로 /(root) 파일시스템은 BtrFS를 사용하고 일반 데이터 파일시스템은 xfs를 권장한다.
그러나 만약 필요에 의해서 ext4 파일시스템 생성 시 주의해야할 사항이 있다.
mke2fs 1.43.8 (1-Jan-2018) Discarding device blocks: done Creating filesystem with 102400 1k blocks and 25688 inodes Filesystem UUID: 6fb8a1b0-c2ba-48aa-ba64-e4ffdd072533 Superblock backups stored on blocks: 8193, 24577, 40961, 57345, 73729 Allocating group tables: done Writing inode tables: done Creating journal (4096 blocks): done Writing superblocks and filesystem accounting information: done suse:~ # tune2fs -l /dev/sdb1 tune2fs 1.43.8 (1-Jan-2018) Filesystem volume name: <none> Last mounted on: <not available> Filesystem UUID: 6fb8a1b0-c2ba-48aa-ba64-e4ffdd072533 Filesystem magic number: 0xEF53 Filesystem revision #: 1 (dynamic) Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent 64bit flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize Filesystem flags: signed_directory_hash Default mount options: user_xattr acl Filesystem state: clean Errors behavior: Continue Filesystem OS type: Linux Inode count: 25688 Block count: 102400 Reserved block count: 5120 Free blocks: 93504 Free inodes: 25677 First block: 1 Block size: 1024 # <----- 주의!! Fragment size: 1024 Group descriptor size: 64 Reserved GDT blocks: 256 Blocks per group: 8192 Fragments per group: 8192 Inodes per group: 1976 Inode blocks per group: 247 Flex block group size: 16 Filesystem created: Tue Apr 6 13:00:49 2021 Last mount time: n/a Last write time: Tue Apr 6 13:00:49 2021 Mount count: 0 Maximum mount count: -1 Last checked: Tue Apr 6 13:00:49 2021 Check interval: 0 (<none>) Lifetime writes: 4441 kB Reserved blocks uid: 0 (user root) Reserved blocks gid: 0 (group root) First inode: 11 Inode size: 128 Journal inode: 8 Default directory hash: half_md4 Directory Hash Seed: 61e420cd-95f9-4146-b57a-007cd48d6a2c Journal backup: inode blocks
위와같이 기본 옵션으로 생성된 ext4 파일시스템의 경우 block size가 1024 인것을 확인할 수 있다.
일반적으로 대다수 리눅스 배포본의 ext4 파일시스템의 기본 block size는 4096인데 반해 SUSE는 1024로 생성된다.
block size가 4096보다 작게 만들어지는 경우 해당 파일시스템을 BtrFS로 변환하는것도 불가능해진다.
따라서 ext4파일시스템을 생성할 경우 반드시 아래와 같이 -b 옵션을 명시적으로 사용해야 한다.
suse:~ # mkfs.ext4 -b 4096 /dev/sdb1 mke2fs 1.43.8 (1-Jan-2018) /dev/sdb1 contains a ext4 file system created on Tue Apr 6 13:00:49 2021 Proceed anyway? (y,N) y Discarding device blocks: done Creating filesystem with 25600 4k blocks and 25600 inodes Allocating group tables: done Writing inode tables: done Creating journal (1024 blocks): done Writing superblocks and filesystem accounting information: done