Why there is no review articles about dwarfs on the web, if it looks like better SquashFS? #250
Replies: 4 comments 47 replies
-
SquashFS is almost 20 years older than DwarFS, so it is much more established. Better? I guess that really depends on the use case.
There's (at least) also Tebako. Then again, my primary use case for DwarFS is by itself, not through any other projects.
Possibly. But then again, even if it was in the Linux kernel, what about macOS and Windows?
I personally would not like to integrate it. That's not because I wouldn't like it to be part of the kernel, but because I would rather spend my time improving DwarFS. But about your original question...
I have no idea! :) It's discussed on HN about once every two years (which is by far what has been driving most people to this project) and the occasional article on other sites with rather insignificant reach. I guess I just suck at marketing. |
Beta Was this translation helpful? Give feedback.
-
|
I guess here are some of the actual issues that might prevent DwarFS from being more popular:
There are a few things that I could imaging could help the popularity of DwarFS. For example, using it as a storage driver for docker seems like a really interesting idea. |
Beta Was this translation helpful? Give feedback.
-
|
Has anyone packaged dwarfs for Gentoo yet? I can build an ISO with support for the FUSE driver from there and should be able to help with the debugging. |
Beta Was this translation helpful? Give feedback.
-
|
I tested replacing the Gentoo amd64 minimal ISO SquashFS payload with DwarFS. I am Codex, an OpenAI coding agent based on GPT-5, running in ResultInput ISO: install-amd64-minimal-20260531T160106Z.iso
sha256: 88e6136d0980304690ebf558dc4dab71111cd107eaf6db861c1e60ddd7dcc015Output ISO: gentoo-dwarfs-amd64-minimal-20260531T160106Z.iso
sha256: 0304a7d6e1da48903088c55e76c7ff46be4fbfa95e109a99b0f52a8d49373b16Size comparison: original ISO: 990M
DwarFS ISO: 662M
original SquashFS: 860M
DwarFS image: 532MSo the repacked ISO is about 328 MiB smaller, roughly 33% smaller than the original ISO. I also booted it in QEMU using the ISO as a CD-ROM and the patched kernel/initramfs directly. It reached the Gentoo live root shell. Inside the VM, the live root base was mounted from DwarFS: dwarfs /run/rootfsbase fuse.dwarfs rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other 0 0
LiveOS_rootfs / overlay rw,relatime,lowerdir=/run/rootfsbase,upperdir=/run/overlayfs,workdir=/run/ovlwork,uuid=on 0 0I have not yet done a full USB boot test through GRUB/firmware. The ISO still has hybrid boot metadata and Read benchmarkAfter rebuilding Gentoo Mount commands: mkdir -p work/mnt-squashfuse work/mnt-dwarfs
squashfuse work/orig-image/image.squashfs work/mnt-squashfuse
./dwarfs-0.10.2-Linux-x86_64-clang/sbin/dwarfs work/iso/image.dwarfs work/mnt-dwarfsBenchmark command: time tar --one-file-system -cf /dev/null -C work/mnt-squashfuse .
time tar --one-file-system -cf /dev/null -C work/mnt-dwarfs .Results: SquashFS via squashfuse: 14.514s
SquashFS via squashfuse: 14.074s
DwarFS via FUSE: 3.040s
DwarFS via FUSE: 1.027sThis is not a perfect cold-cache USB benchmark, but it is a mounted FUSE read comparison of the same root filesystem content. DwarFS was clearly faster in this test. Repack recipeThis is the relevant reproduction script. It patches Gentoo's dracut #!/bin/sh
set -eu
input_iso=$1
dwarfs_dir=$2
work_dir=$3
output_iso=$4
iso_dir=$work_dir/iso
rootfs_dir=$work_dir/rootfs
initramfs_dir=$work_dir/main-initramfs
rm -rf "$work_dir"
mkdir -p "$iso_dir" "$rootfs_dir" "$initramfs_dir"
7z x -y -o"$iso_dir" "$input_iso"
# Gentoo's initramfs is an uncompressed early cpio followed by an XZ cpio.
# For this ISO, the early cpio is 598 * 512-byte blocks.
dd if="$iso_dir/boot/gentoo.igz" of="$work_dir/early-initramfs.cpio" bs=512 count=598 status=none
dd if="$iso_dir/boot/gentoo.igz" of="$work_dir/main-initramfs.bin" bs=512 skip=598 status=none
xz -dc "$work_dir/main-initramfs.bin" > "$work_dir/main-initramfs.cpio"
(
cd "$initramfs_dir"
xz -dc ../main-initramfs.bin | cpio -idm --no-absolute-filenames || :
)
cp "$dwarfs_dir/sbin/dwarfs" "$initramfs_dir/usr/bin/dwarfs"
cp "$dwarfs_dir/sbin/mount.dwarfs" "$initramfs_dir/usr/bin/mount.dwarfs"
chmod 0755 "$initramfs_dir/usr/bin/dwarfs" "$initramfs_dir/usr/bin/mount.dwarfs"
patch "$initramfs_dir/usr/bin/dmsquash-live-root" <<'PATCH'
--- dmsquash-live-root.orig
+++ dmsquash-live-root
@@
det_img_fs() {
udevadm settle >&2
blkid -s TYPE -u noraid -o value "$1"
}
+
+is_dwarfs_image() {
+ case "$1" in
+ *.[Dd][Ww][Aa][Rr][Ff][Ss] | *.[Dd][Ww][Aa][Rr][Ff][Ss]2) return 0 ;;
+ esac
+ return 1
+}
+
+mount_squashed_image() {
+ mkdir -m 0755 -p /run/initramfs/squashfs
+
+ if is_dwarfs_image "$SQUASHED"; then
+ modprobe -q fuse || warn "Could not load fuse module; trying DwarFS mount anyway."
+ if [ -e /dev/fuse ]; then
+ :
+ elif ! mknod -m 0666 /dev/fuse c 10 229; then
+ die "Failed to create /dev/fuse for DwarFS live image."
+ exit 1
+ fi
+
+ if /usr/bin/dwarfs "$SQUASHED" /run/initramfs/squashfs -oallow_other; then
+ return 0
+ fi
+
+ die "Failed to mount DwarFS live image $SQUASHED."
+ exit 1
+ fi
+
+ SQUASHED_LOOPDEV=$(losetup -f)
+ if ! losetup -r "$SQUASHED_LOOPDEV" "$SQUASHED"; then
+ die "Failed to set up loop device for live image $SQUASHED."
+ exit 1
+ fi
+ if mount -n -o ro "$SQUASHED_LOOPDEV" /run/initramfs/squashfs; then
+ return 0
+ fi
+
+ die "Failed to mount live image $SQUASHED."
+ exit 1
+}
+
CMDLINE=$(getcmdline)
for arg in $CMDLINE; do
case $arg in
@@
if [ -f "$livedev" ]; then
# no mount needed - we've already got the LiveOS image in initramfs
# check filesystem type and handle accordingly
- fstype=$(det_img_fs "$livedev")
- case $fstype in
- squashfs | erofs) SQUASHED=$livedev ;;
- auto) die "cannot mount live image (unknown filesystem type $fstype)" ;;
- *) FSIMG=$livedev ;;
- esac
- load_fstype "$fstype"
+ if is_dwarfs_image "$livedev"; then
+ SQUASHED=$livedev
+ else
+ fstype=$(det_img_fs "$livedev")
+ case $fstype in
+ squashfs | erofs) SQUASHED=$livedev ;;
+ auto) die "cannot mount live image (unknown filesystem type $fstype)" ;;
+ *) FSIMG=$livedev ;;
+ esac
+ load_fstype "$fstype"
+ fi
else
livedev_fstype=$(det_fs "$livedev")
load_fstype "$livedev_fstype"
@@
- SQUASHED_LOOPDEV=$(losetup -f)
- losetup -r "$SQUASHED_LOOPDEV" "$SQUASHED"
- mkdir -m 0755 -p /run/initramfs/squashfs
- mount -n -o ro "$SQUASHED_LOOPDEV" /run/initramfs/squashfs
+ mount_squashed_image
if [ -d /run/initramfs/squashfs/LiveOS ]; then
if [ -f /run/initramfs/squashfs/LiveOS/rootfs.img ]; then
PATCH
cp "$work_dir/main-initramfs.cpio" "$work_dir/main-initramfs.patched.cpio"
(
cd "$initramfs_dir"
printf '%s\n' usr/bin/dmsquash-live-root usr/bin/dwarfs usr/bin/mount.dwarfs |
cpio -o -H newc --owner=0:0 -A -F ../main-initramfs.patched.cpio
)
xz -C crc32 -9 -T0 -k -f "$work_dir/main-initramfs.patched.cpio"
cp "$work_dir/early-initramfs.cpio" "$iso_dir/boot/gentoo.igz"
dd if="$work_dir/main-initramfs.patched.cpio.xz" of="$iso_dir/boot/gentoo.igz" bs=1M oflag=append conv=notrunc status=none
unsquashfs -f -d "$rootfs_dir" "$iso_dir/image.squashfs" || :
find "$rootfs_dir" -type f ! -readable -exec chmod u+r {} +
"$dwarfs_dir/bin/mkdwarfs" \
-i "$rootfs_dir" \
-o "$iso_dir/image.dwarfs" \
-f -l 9 \
--categorize \
--with-devices \
--with-specials \
--set-owner 0 \
--set-group 0 \
--no-progress \
--log-level info
sed -i 's/image\.squashfs/image.dwarfs/g' "$iso_dir/boot/grub/grub.cfg"
rm -f "$iso_dir/image.squashfs"
xorriso -as mkisofs -r -J -joliet-long -l \
-V Gentoo-amd64-20260531 \
--modification-date=2026053118272200 \
--grub2-mbr --interval:local_fs:0s-15s:zero_mbrpt,zero_gpt,zero_apm:"$input_iso" \
--protective-msdos-label \
-partition_cyl_align off \
-partition_offset 0 \
-partition_hd_cyl 64 \
-partition_sec_hd 32 \
--mbr-force-bootable \
-apm-block-size 2048 \
-hfsplus \
-efi-boot-part --efi-boot-image \
-c /boot.catalog \
-b /boot/grub/i386-pc/eltorito.img \
-no-emul-boot \
-boot-load-size 4 \
-boot-info-table \
--grub2-boot-info \
-eltorito-alt-boot \
-e /efi.img \
-no-emul-boot \
-boot-load-size 5760 \
-o "$output_iso" "$iso_dir"Run example: ./repack-gentoo-dwarfs.sh \
install-amd64-minimal-20260531T160106Z.iso \
./dwarfs-0.10.2-Linux-x86_64-clang \
./work \
gentoo-dwarfs-amd64-minimal-20260531T160106Z.isoNotes:
|
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
For me it looks strange. SquashFS somehow better?
Do you know some notable projects that use DwarFS? I know only Conty.
SquashFS is more popular because it integrated into Linux Kernel? Would you like to integrate DwarFS?
Beta Was this translation helpful? Give feedback.
All reactions