[sf-lug] Chromebooks' partitioning optimizing
aaronco36 at sdf.org
aaronco36 at sdf.org
Sun Feb 1 17:54:15 PST 2026
Well 2.0, there's also the KISS Principle
https://www.geeksforgeeks.org/software-engineering/kiss-principle-in-software-development/
Most notably, 140 lines of perhaps less-clear explanation below vs a
quarter as many lines of symbolic-link steps for the desired aim(s) ;->
While it's certainly dated, the Linux Partitioning mini-FAQ by
Karsten M. Self ( http://linuxmafia.com/~karsten/Linux/FAQs/partition.html
) ended up as surprisingly useful for the [re-]partitioning suggestions
using 32.0 GB SD cards in the Chromebooks :-)
-A
> Well, there are additional means besides symbolic link(s).
>
> Most notably:
> With Linux, one can not only mount a filesystem atop a
> directory (the mount point), and whether or not it's empty
> (nominally it would be, if it's not, that's commonly referred to as
> an overmount), but Linux also allows the same filesystem to be
> mounted multiple places at the same time!
> I'll give brief example that happens to cover both:
> # mount | grep -F -e ' /var ' -e ' /mnt '
> /dev/mapper/tigger-var on /var type ext3 (rw,nosuid,nodev,relatime)
> # mount -t ext3 -o rw,nosuid,nodev,relatime /dev/mapper/tigger-var /mnt
> # mount | grep -F -e ' /var ' -e ' /mnt '
> /dev/mapper/tigger-var on /var type ext3 (rw,nosuid,nodev,relatime)
> /dev/mapper/tigger-var on /mnt type ext3 (rw,nosuid,nodev,relatime)
> # ls -1d /{var,mnt}/cache/apt/archives/.fi*
> ls: cannot access '/var/cache/apt/archives/.fi*': No such file or
> directory
> /mnt/cache/apt/archives/.find_deb_in_snapshot.debian.org.out
> # mount | grep -F -e ' /var/cache/apt/archives ' | sort -u
> /dev/mapper/tigger-apt.archives on /var/cache/apt/archives type ext3
> (rw,nosuid,nodev,relatime)
> #
> So, with that additional mount command, I then also mounted that
> /var filesystem also on /mnt directory (mountpoint).
> Also under that filesystem, relative to its root (as seen under its
> mount point when mounted), there is file:
> cache/apt/archives/.find_deb_in_snapshot.debian.org.out
> however, can't access that at present under the mount of that
> filesystem on /var, because overmount - another filesystem is
> mounted atop
> (/var/)cache/apt/archives
> One typically wouldn't mount atop a non-empty directory
> but in this particular case I'm doing it quite intentionally
> (I want to reduce the probability of the
> .find_deb_in_snapshot.debian.org.out
> file getting accidentally deleted), and with that overmount,
> can't access that file without either unmounting the overmount,
> or mounting that filesystem elsewhere (including the possibility of
> concurrently).
> Note mounting same filesystem elsewhere at same time,
> one may be restricted to using same mount options for each such
> additional mount.
>
> Another means is bind mount (other *nix flavors may have same or highly
> similar, but may use other terminology and syntax, e.g. Solaris calls it
> loopback mount, but that's not to be confused with Linux's loopback
> devices, which are another thing entirely).
> Bind mount allows one to mount a directory atop another directory.
> Continuing from our example above:
> # cd "$(mktemp -d)"
> # mkdir mnt var
> # (for n in mnt var; do mount -o bind /"$n" "$n"; done)
> # ls -1d {var,mnt}/cache/apt/archives{,/.fi*}; pwd -P
> mnt/cache/apt/archives
> mnt/cache/apt/archives/.find_deb_in_snapshot.debian.org.out
> var/cache/apt/archives
> var/cache/apt/archives/.find_deb_in_snapshot.debian.org.out
> /tmp/tmp.XuNMlkIZ5v
> #
> Note that the bind mount doesn't carry along the overmounts - or
> any other mounts from the source directory to under the target.
> E.g.:
> # (for p in {,/}var/local{,/pub}; do echo "$(df -h "$p" | awk
> '{if(NR==2) print $1,$6;}') #$p"; done)
> /dev/mapper/tigger-var /tmp/tmp.XuNMlkIZ5v/var #var/local
> /dev/mapper/tigger-var /tmp/tmp.XuNMlkIZ5v/var #var/local/pub
> /dev/mapper/tigger-var /var #/var/local
> /dev/mapper/tigger-pub /var/local/pub #/var/local/pub
> # umount var && umount mnt && rmdir * && (d="$(pwd -P)" && cd / &&
> rmdir "$d") && cd && umount /mnt
> #
> Linux also allows bind mounting a non-directory atop a non-directory,
> e.g.:
> # (t="$(mktemp)" && mount -o bind /etc/motd "$t" && { echo cmp
> /etc/motd "$t" && ls -ldi /etc/motd "$t" && cmp /etc/motd "$t" && echo
> IDENTICAL; umount "$t" && rm "$t"; })
> cmp /etc/motd /tmp/tmp.1cyXUErh2m
> 88332 -rw-r--r-- 1 root root 286 Aug 25 17:48 /etc/motd
> 88332 -rw-r--r-- 1 root root 286 Aug 25 17:48 /tmp/tmp.1cyXUErh2m
> IDENTICAL
> #
> And one can specify bind mounts in /etc/fstab, e.g. (here Ss just shrinks
> the whitespace):
> $ grep -F -e bind /etc/fstab | Ss
> /var/cache/apt/archives/archives /var/cache/apt/archives none bind 0 0
> /dev/null /var/lib/named/dev/null none bind 0 0
> /dev/random /var/lib/named/dev/random none bind 0 0
> /run/named /var/lib/named/run/named none bind 0 0
> /usr/share/dns /var/lib/named/usr/share/dns none bind 0 0
> /var/cache/bind /var/lib/named/var/cache/bind none bind 0 0
> /var/lib/bind /var/lib/named/var/lib/bind none bind 0 0
> /run/systemd/notify /var/lib/named/run/systemd/notify none bind,nofail 0 0
> /home/r/root/log/log /var/local/log/log none bind 0 0
> /var/local/boinc/boinc/boinc-client /var/lib/boinc-client none bind 0 0
> $
> https://www.mpaoli.net/~michael/bin/Ss
>
> And ln(1) syntax is similar-ish to cp(1).
> Notably the last non-option argument is what's created
> or possibly replaced, but that if that last non-option argument is
> a directory, then link(s) are generally created within that directory.
> ln [OPTION]... [-T] TARGET LINK_NAME
> ln [OPTION]... TARGET... DIRECTORY
> E.g.:
> $ cd "$(mktemp -d)"
> $ (for f in f0 f1; do echo "$f" > "$f"; done); grep . f?
> f0:f0
> f1:f1
> $ mkdir d
> $ ln -s f0 L0; ln -s f1 L1; ln -s f? d
> $ (for l in $(find * -type l -print); do echo -n "$l -> "; readlink "$l";
> done)
> L0 -> f0
> L1 -> f1
> d/f1 -> f1
> d/f0 -> f0
> $ mkdir D && ln -s D d && { echo -n 'd/D -> ' && readlink d/D; }
> d/D -> D
> $
> But note many of those links aren't very useful, as they loop:
> $ cat d/*
> cat: d/D: Too many levels of symbolic links
> cat: d/f0: Too many levels of symbolic links
> cat: d/f1: Too many levels of symbolic links
> $
> More (potentially) useful, e.g.:
> $ ln -s /tmp . && ln -s /nope . && ln -s /tmp d && (for l in tmp nope
> d/tmp; do echo -n "$l -> $(readlink "$l") " && (cd "$l" && { echo "$l:
> "$(pwd; pwd -P); }); done)
> tmp -> /tmp tmp: /tmp/tmp.9c0Du9Upqx/tmp /tmp
> nope -> /nope -bash: cd: nope: No such file or directory
> d/tmp -> /tmp d/tmp: /tmp/tmp.9c0Du9Upqx/d/tmp /tmp
> $ rm -rf * && mkdir -p d/d/d/d/d/d/d/d/d && ln -s "$(pwd
> -P)"/d/d/d/d/d/d/d/d/d D
> $ (cd D && { pwd; pwd -P; })
> /tmp/tmp.9c0Du9Upqx/D
> /tmp/tmp.9c0Du9Upqx/d/d/d/d/d/d/d/d/d
> $ (cd "$(pwd -P)"/D && { pwd; pwd -P; })
> /tmp/tmp.9c0Du9Upqx/D
> /tmp/tmp.9c0Du9Upqx/d/d/d/d/d/d/d/d/d
> $ readlink D
> /tmp/tmp.9c0Du9Upqx/d/d/d/d/d/d/d/d/d
> $
>
> On Sun, Feb 1, 2026 at 1:01â¯PM <aaronco36 at sdf.org> wrote:
>> > --> After creating and partitioning /dev/mmcblk1p3 as /usr/local ....
>> > then create /usr/local/opt and symlink /opt to /usr/local/opt
>> > ( 'sudo cp -v /opt /usr/local/opt ; sudo ln -sf /opt /usr/local/opt' )
>> The symlink 'ln' syntax from its man page (e.g.,
>> https://www.man7.org/linux/man-pages/man1/ln.1.html ) is "ln [OPTION]...
>> TARGET... DIRECTORY"
>> Therefore, as /usr/local/opt is the [new but actual!] TARGET, 2nd half
>> of
>> above should be corrected to ...
>> 'sudo ln -sf /usr/local/opt /opt'
>> The directionality of the 'ln' command is different from the 'cp'
>> command,
>> and that very fact sometimes messes me up... am sorry! :-(
>
> On Sun, Feb 1, 2026 at 11:46â¯AM <aaronco36 at sdf.org> wrote:
>>
>> A good way to deal w/ the Chromebooks' low HW specs is to use SD cards
>> in their SD slots to increase their available internal diskspace.
>> Already wrote to Bobbie abt this the last time.
>> E.g. w/ 32 GB microSD card /dev/mmcblk1p
>> 1) 4 GB swap-part
>> 2) 4 GB /var
>> 3) 4 GB /usr/local
>> 4) Remaining space as Ext'd for MBR BIOS
>> 5) 1 GB /tmp
>> 6) 16 GB+ /home
>>
>> --> After creating and partitioning /dev/mmcblk1p3 as /usr/local ....
>> then create /usr/local/opt and symlink /opt to /usr/local/opt
>> ( 'sudo cp -v /opt /usr/local/opt ; sudo ln -sf /opt /usr/local/opt' )
>>
>> The Chromebooks' default internal 16.0 GB /dev/mmcblk0p as
>> 1) ~300 MB EFI boot (efs)
>> 2) 14 GB+ /<root>
>> ( swap on (2) as 2 GB swap _file_ )
More information about the sf-lug
mailing list