How to use "ext3/4fs"
| Newsgroups | gmane.os.hurd.bugs,gmane.comp.gnu.guix.devel |
|---|---|
| Message-ID | <[email protected]> |
Hey cool Hurd people! For those of you who do not know, Milos has coded a JBD2 binary compliant journal for the Hurd's ext2fs. I have personally been refeering to his unmerged patches as "ext3/4fs". This feature essentially adds journaling to ext2fs and Linux reports the partition as "ext3 or ext4". Here's some instructions for how you can try out ext3/4fs. Please do feel free to review the patches too! https://lists.gnu.org/archive/html/bug-hurd/2026-04/msg00006.html At the moment, there are 5 or 7 users running "ext3/4fs" in a vm and two users running it on real hardware! P.S. If there are any filesystem developers reading this, it should be possible to use a filesystem from rump as well. Also Samuel seems open to the idea of adding some rust code to the Hurd, if that is your jam. -------- Forwarded message ------- From: "Milos Nikic" <[email protected] mailto:[email protected]?to=%22Milos%20Nikic%22%20%3Cnikic.milos%40gmail.com%3E > To: [email protected] mailto:[email protected] Sent: April 27, 2026 at 6:15 PM Subject: Re: [PATCH 1/3] ext2fs: Add JBD2 on-disk layout headers Hey Joshua, Thanks for trying this out, i really appreciate it. In order to really test the journal, we need fresh Hurd and also fresh MACH (there is some flushing there that is only present in the recent versions) This is how i start my own new fresh debian hurd image when i mess up the one i had before. This script creates a directory structure (you can change it if you don't like the one that is in the script) /dev/hurd/upstream/ and inside there will be $ ls dev/hurd/upstream/ gnumach hurd mig You need all three to be complete, but script does all of that for you. it will: 1) download (everything you need to build, all the dependencies (its a lot, Im sorry i think you should already have a few things already) 2) create directory structure 3) git clone mig (its needed for both Hurd and Gnumach) 4) configure and build mig, install mig 5) git clone latest gnumach (the microkernel that is running it all) 6) cd into gnumach create directory "build" and configure and build the micro kernel gnumach.gz there 7) then cd out and git clone HURD (the latest master) 8) create "build" directory inside Hurd and configure and build hurd it will tell you to source ~/.bash_profile at the end. If that works you are golden, you have a development environment of Gnu HUrd inside Hurd. To achieve all this just run: $ bash dev_setup.sh Wait for a while while its doing all that its doing and you will have built the latest mig, gnumach and hurd. Now if you want to incorporate the journaling patch, it should be easy. just Just cd into the "hurd" directory again, apply the patch, like so: git apply v6-0001-ext2fs-Add-JBD2-journaling-to-ext2-libdiskfs.patch This will add the journaling patch to your code (but it will not commit it!!) Now: When that is done cd into "build" run make ext2fs once that is done you will have ext2fs/ext2fs.static If you want to test it out. copy that ext2fs.static into /hurd I'd first copy the original one just in case: $ sudo cp /hurd/ext2fs.static /hurd/ext2fs.static-bck Now copy your newly compiled ext2fs file system into hurd directory via: (inside the build folder) $ sudo cp ext2fs/ext2fs.static /hurd/ext2fs.static Next time you reboot you will have booted in the new and fresh ext2fs with all the new things. Journaling is disabled by default even if you apply the patch. Its easy on the qemu because then i just run: sudo tune2fs -j <partition> and it is enabled... If you are running the Hurd on real hardware, then use GNU/Linux to run that command straight to the disk via a SATA to usb connector. You may optionally compile and use a newer GNU Mach from master, otherwise you will see warnings like: ext2fs: part:5:device:wd0: warning: [JOURNAL] Device flush failed: (os/device) invalid operation That warning message is nothing to be concerned about, it just tells us that the "flush" is not quite a "flush" as it should be, but things are mostly fine. Its because the mach kernel is older. before adding journaling logic i added a write barrier into both Hurd and Mach, so that flush to disk really means "flush" and not just "i hope i flushed". The problem is in order for that warning to go away you need a build of Mach that contains commit f0925235a94768a75b939001e6b16bf7e45b48df That commit was merged in on the 23rd of January 2026. Any Mach that was built before that date won't have that commit, so you will see that warning. (Hurd calls an RPC to "flush" into the Mach, but older Mach doesn't know anything about it) Thanks again, MIlos
dev_setup.sh
(application/x-shellscript, 1.4 KB)
#!/bin/bash
set -e
# Set up directory structure
WORKDIR="$HOME/dev/hurd/upstream"
GNU_PREFIX="$HOME/gnu"
MIG_REPO="https://git.savannah.gnu.org/git/hurd/mig.git"
MACH_REPO="https://git.savannah.gnu.org/git/hurd/gnumach.git"
HURD_REPO="git://git.savannah.gnu.org/hurd/hurd.git"
echo "==> Updating APT and installing base development tools..."
sudo apt update
sudo apt install -y git build-essential autoconf automake m4 bison flex texinfo xorriso libparted-dev pkg-config ncurses-term
mkdir -p "$WORKDIR"
cd "$WORKDIR"
echo "==> Cloning MiG, GNU Mach, and Hurd..."
[ ! -d "mig" ] && git clone "$MIG_REPO"
[ ! -d "gnumach" ] && git clone "$MACH_REPO"
[ ! -d "hurd" ] && git clone "$HURD_REPO"
echo "==> Building and installing MiG..."
cd "$WORKDIR/mig"
autoreconf --install
rm -rf build && mkdir build && cd build
mkdir -p "$GNU_PREFIX"
TARGET_CPPFLAGS="-I$GNU_PREFIX/include" ../configure --prefix="$GNU_PREFIX"
make -j$(nproc)
make install
# Persist PATH update
if ! grep -q "$GNU_PREFIX/bin" ~/.bashrc; then
echo "export PATH=\"$GNU_PREFIX/bin:\$PATH\"" >> ~/.bashrc
fi
export PATH="$GNU_PREFIX/bin:$PATH"
echo "==> Building GNU Mach..."
cd "$WORKDIR/gnumach"
autoreconf --install
rm -rf build && mkdir build && cd build
../configure --prefix=
make gnumach.gz
echo "==> Building Hurd..."
cd "$WORKDIR/hurd"
autoreconf -fi
rm -rf build && mkdir build && cd build
../configure
make -j$(nproc)
echo -e "\n All done. If this is your first run, do:"
echo "source ~/.bashrc"
v6-0001-ext2fs-Add-JBD2-journaling-to-ext2-libdiskfs.patch
(text/x-patch, 151.9 KB) - not displayed