Ext4: Difference between revisions
From wikinotes
Line 29: | Line 29: | ||
Create/Verify filesystem | Create/Verify filesystem | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
cat /sys/fs/ext4/features/casefold # must be 'supported' | |||
cat /sys/fs/ext4/features/casefold | mkfs -t ext4 -O casefold /dev/sda1 # format partition | ||
dumpe2fs -h /dev/sda1 | grep 'casefold' # ensure casefold under 'Filesystem features:' | |||
# | sudo mount /dev/sda1 /mnt/foo # mount | ||
mkfs -t ext4 -O casefold /dev/sda1 | |||
# | |||
dumpe2fs -h /dev/sda1 | grep 'casefold' | |||
# | |||
sudo mount /dev/sda1 /mnt/foo | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Latest revision as of 22:19, 18 September 2022
Ext4 is a journaled filesystem, used by default by most linux distros.
Documentation
man ext4 https://www.man7.org/linux/man-pages/man5/ext4.5.html#MOUNT_OPTIONS
Creation
Basics
Create Filesystem
mkfs -t ext4 /dev/sda1Kernel Options
casefold (case-insensitivity)
If a partition was formatted with casefold, you can assign empty directories to be treated case-insensitively.
Create/Verify filesystem
cat /sys/fs/ext4/features/casefold # must be 'supported' mkfs -t ext4 -O casefold /dev/sda1 # format partition dumpe2fs -h /dev/sda1 | grep 'casefold' # ensure casefold under 'Filesystem features:' sudo mount /dev/sda1 /mnt/foo # mountCreate Case-Insensitive Directory
mkdir games chattr +F games # make directory case-insensitive lsattr games # show extended attributes, including casefold
Mount
FreeBSD
See http://blog.ataboydesign.com/2014/04/23/freebsd-10-mounting-usb-drive-with-ext4-filesystem
# requires package: fusefs-ext2 # NOTE: there is a port sysutils/fusefs-ext4fs but it is deprecated # in favour of fusefs-ext2 mount -t ext2fs /dev/ad1s1 /mnt
Linux
You cannot set the uid/gid for ext4 mounts.
Instead, set the permissions of the files on the mounted-mount itself, and they will be preserved.sudo mount /dev/sdb1 /mnt/usb