Skip to content

Commit

Permalink
make-extdrive: No ext4 tuning
Browse files Browse the repository at this point in the history
We use SSD now, no need to do weird stuff.
  • Loading branch information
cdown committed Dec 18, 2023
1 parent 7903f49 commit 49b7961
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions bin/make-extdrive
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,4 @@ unset device # safety measure to make sure we don't introduce some bug that
cryptsetup -y -v --pbkdf-memory "$pbkdf_kb" luksFormat "$part"
cryptsetup luksOpen --allow-discards "$part" "$cryptdev"

# This drive mostly stores photos. Most of these are about 12 megabytes or so.
# As such the cluster size should be big (probably 64k with -O bigalloc -C
# 65536). However, bigalloc is still unstable, so don't use it.
#
# % find ./ -ls | awk 'BEGIN{OFMT="%f"} {sum += $7; n++;} END {print sum/n;}'
# 12965453.184444
#
# On the other hand there's no way we will use one inode per 16kb, so we can
# bump that up to 1MB per inode.
mkfs.ext4 -L "$label" -i 1048576 "$cryptdev_path"

# We can tolerate data/metadata misordering.
tune2fs -o journal_data_writeback "$cryptdev_path"

printf '%s\n' \
'NOTE: You may want to make sure that the users map properly, and do the following:' \
'sudo setfacl -b -R /srv/samba && sudo setfacl -Rdm g:docker:rx /srv/samba && sudo setfacl -Rm g:docker:rx /srv/samba'
mkfs.ext4 -L "$label" "$cryptdev_path"

0 comments on commit 49b7961

Please sign in to comment.