Ext4: Difference between revisions
From wikinotes
(→Mount) |
|||
Line 13: | Line 13: | ||
= Creation = | = Creation = | ||
<blockquote> | <blockquote> | ||
== Basics == | |||
<blockquote> | |||
Create Filesystem | |||
<syntaxhighlight lang="bash"> | |||
mkfs -t ext4 /dev/sda1 | |||
</syntaxhighlight> | |||
</blockquote><!-- Basics --> | |||
== Kernel Options == | |||
<blockquote> | |||
=== casefold (case-insensitivity) === | |||
<blockquote> | |||
If a partition was formatted with casefold, you can assign empty directories to be treated case-insensitively. | |||
Create/Verify filesystem | |||
<syntaxhighlight lang="bash"> | |||
# must be 'supported' | |||
cat /sys/fs/ext4/features/casefold | |||
# format partition | |||
mkfs -t ext4 -O casefold /dev/sda1 | |||
# ensure casefold present under 'Filesystem features:' | |||
dumpe2fs -h /dev/sda1 | grep 'casefold' | |||
# mount | |||
sudo mount /dev/sda1 /mnt/foo | |||
</syntaxhighlight> | |||
Create Case-Insensitive Directory | |||
<syntaxhighlight lang="bash"> | |||
mkdir games | |||
chattr +F games # make directory case-insensitive | |||
lsattr games # show extended attributes, including casefold | |||
</syntaxhighlight> | |||
</blockquote><!-- casefold (case-insensitivity) --> | |||
</blockquote><!-- Kernel Options --> | |||
</blockquote><!-- creation --> | </blockquote><!-- creation --> | ||
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
# must be 'supported' cat /sys/fs/ext4/features/casefold # format partition mkfs -t ext4 -O casefold /dev/sda1 # ensure casefold present under 'Filesystem features:' dumpe2fs -h /dev/sda1 | grep 'casefold' # mount sudo mount /dev/sda1 /mnt/fooCreate 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