Hey Samuel, this is another modification of a previous commit.
Hopefully this addresses your critiques.  I also added in
"-E root_owner=$UID:0" to some other files, where I thought it
was appropirate.  Hopefully I didn't make any mistakes.  I did test
this by the way.  I was able to get ~/silly/silly1 to be two
nested ext2fs translators.  All without having to execute "sudo"!

* hurd/translator/ext2fs.mdwn: explain how to create a custom
filesystem, and mentioned that the current limit for how many
nested ext2fs filesystems there could be...is 32.

* faq/still_useful: sbin/mk2fs dummy.fs -> sbin/mk2fs -E root_owner=$UID:0 
dummy.fs

* hurd/documentation/translators.html: as above.

* open_issues_/64-bit_port.mdwn: as above
---
 faq/still_useful.mdwn               |  2 +-
 hurd/documentation/translators.html |  2 +-
 hurd/translator/ext2fs.mdwn         | 51 +++++++++++++++++++++++++++++
 open_issues/64-bit_port.mdwn        |  2 +-
 4 files changed, 54 insertions(+), 3 deletions(-)

diff --git a/faq/still_useful.mdwn b/faq/still_useful.mdwn
index 82e03078..575781a1 100644
--- a/faq/still_useful.mdwn
+++ b/faq/still_useful.mdwn
@@ -39,7 +39,7 @@ various servers are designed for this sort of modification.
 > personal filesystem
 > 
 >     $ dd < /dev/zero > myspace.img bs=1M count=1024
->     $ /sbin/mke2fs myspace.img
+>     $ /sbin/mke2fs -E root_owner=$UID:0 myspace.img
 >     $ settrans myspace /hurd/ext2fs myspace.img
 >     $ cd myspace
 
diff --git a/hurd/documentation/translators.html 
b/hurd/documentation/translators.html
index e455f730..348774d1 100644
--- a/hurd/documentation/translators.html
+++ b/hurd/documentation/translators.html
@@ -212,7 +212,7 @@ I recommend that you start by reading the 
<code>/bin/mount</code> command,
 it is only a small script. Because setting filesystem translators is
 similar to mounting partitions, you can easily grasp the concept this way.
 Make a file system image with <code>dd if=/dev/zero of=dummy.fs bs=1024k
-count=8; /sbin/mke2fs dummy.fs</code> and "mount" it with <code>settrans -c 
dummy
+count=8; /sbin/mke2fs -E root_owner=$UID:0 dummy.fs</code> and "mount" it with 
<code>settrans -c dummy
 /hurd/ext2fs `pwd`/dummy.fs</code>. Note that the translator is not started
 yet, no new <code>ext2fs</code> process is running (verify with <code>ps
 Aux</code>). Check that everything is correct using <code>showtrans</code></p>
diff --git a/hurd/translator/ext2fs.mdwn b/hurd/translator/ext2fs.mdwn
index 957b9c13..9be6c885 100644
--- a/hurd/translator/ext2fs.mdwn
+++ b/hurd/translator/ext2fs.mdwn
@@ -32,6 +32,57 @@ Extend ext2fs to support 64bit time.
 
 [[!inline pagenames=faq/2_gib_partition_limit raw=yes feeds=no]]
 
+## Create your own custom ext2fs
+
+       $ dd if=/dev/zero of=silly.fs bs=1024k count=8
+       $ /sbin/mkfs.ext2 -E root_owner=$UID:0 silly.fs
+       $ settrans -c silly /hurd/ext2fs `pwd`/silly.fs
+       $ ps -e | grep silly  # ext2fs has not started
+       $ ls silly
+       $ ps -e | grep silly | awk '{ print $6 " " $7 }'
+       /hurd/ext2fs /home/joshua/silly.fs
+       $ cd silly
+       $ echo 'hello' > hello.txt
+       $ mkdir silly-dir
+       $ cd ..
+       $ fsysopts silly
+       /hurd/ext2fs --writable --relatime --no-inherit-dir-group 
/home/joshua/silly.fs
+       $ fsysopts silly --readonly  # stop writes to the filesystem
+       $ fsysopts silly --writable  # let writes again
+
+Try to make the filesystem read-only with fsysopts. Note how further
+write attempts fail now. Try to kill the active translator with
+settrans -g.
+
+You could go crazy even!  Why not make something like this:
+
+       ~/silly <--> silly.fs
+          |   \
+          |    \
+          |     \
+          |      \
+          |       \
+         \|/       \/
+        silly1 <-> silly1.fs
+              ...
+
+       /hurd/joshua/silly/silly1/silly2/silly3/silly4
+
+Each sillyN is another ext2fs filesystem!  Make sure that as N gets
+bigger sillyN.fs gets smaller.  Let us know in the `#hurd` [irc
+channel](https://web.libera.chat/) how "silly" you are.  :)
+
+The current record is 2!
+
+       $ ps -e | grep silly | awk '{print $6 " " $7}'
+       /hurd/ext2fs /home/joshua/silly.fs
+       /hurd/ext2fs /home/joshua/silly/silly1.fs
+
+What is the limit?  How many nested ext2fs translators can you have?
+You could have 32 ["silly"
+directories](https://logs.guix.gnu.org/hurd/2024-05-31.log#005021).
+That's very silly!
+
 ### Ognyan's Work to allow ext2 to surpass the 2 GiB limit
 
   * Ognyan Kulev, [[*Supporting Large ext2 File Systems in the
diff --git a/open_issues/64-bit_port.mdwn b/open_issues/64-bit_port.mdwn
index 77b0632e..75756199 100644
--- a/open_issues/64-bit_port.mdwn
+++ b/open_issues/64-bit_port.mdwn
@@ -86,7 +86,7 @@ To make a bootable system we really better make the disk 
image partitioned, and
     # create a new primary partition spanning the whole disk: n p and just 
accept the defaults, and finish with w
     settrans -ca disk /hurd/storeio -T typed file:disk.img
     settrans -ca disk1 /hurd/storeio -T typed part:1:file:disk.img
-    /sbin/mke2fs disk1
+    /sbin/mke2fs -E root_owner=$UID:0 disk1
     settrans -ca chroot-hurd-amd64 /hurd/ext2fs disk1
 
 (here we assume that fdisk puts the partition at sector 2048, that's indeed the
-- 
2.45.1


Reply via email to