Alternative command to > mount | column -t <

The command

mount | column -t

does not seem to be possible under DietPi.
Is there an equivalent?

Whatever is possible on Debian, should be possible on DietPi.

What exactly you are trying to do?

I would like to display where and how the file system is mounted and how it looks in a tree structure.
I am expecting the following display:

mount | column -t
/dev/sda1  on   /      type   ext4          (rw/noatime)
devtmpfs   on   /dev   type   devtmpfs      (rw,relatime,size........mode=755)   
proc       on   /proc  type   proc          (rw,relatime)
.
.
.

And what exactly is your issue?

You can use as well

lsblk -o name,fstype,label,size,ro,type,mountpoint,partuuid,uuid

The background is the connection of an SSD to the USB port of an RPi Zero 2 W.
An adapter board is connected to the Zero 2, which gives the Zero 2 4 USB ports and a network port.
The SSD is connected to one USB port and an ADS-B dongle to another USB port.
I was unable to set up booting from USB and then switched to the method of booting from the SD and the file system on the SSD.
It all works, although admittedly there is no performance gain whatsoever. I still had the part left, hence all the fun.

That’s not quite what I mean, but thank you.

I proceeded according to the following instructions:
https://www.youtube.com/watch?v=5S7VL8tb-fc
From minute 23:13 it gets interesting!

Ok still my question. What is the issue with the command you are trying to run?

1 Like

Oh sorry, here is the issue:

root@adsb-feeder-pi:~# mount | column -t
-bash: column: Command not found.

Works on my RPi 4 with latest DietPi.

root@RPi4:~# mount | column -t
/dev/sda2    on  /                                                    type  ext4         (rw,noatime,lazytime)
devtmpfs     on  /dev                                                 type  devtmpfs     (rw,relatime,size=1704024k,nr_inodes=426006,mode=755)
proc         on  /proc                                                type  proc         (rw,nosuid,nodev,noexec,relatime)
sysfs        on  /sys                                                 type  sysfs        (rw,nosuid,nodev,noexec,relatime)
securityfs   on  /sys/kernel/security                                 type  securityfs   (rw,nosuid,nodev,noexec,relatime)
tmpfs        on  /dev/shm                                             type  tmpfs        (rw,nosuid,nodev)
devpts       on  /dev/pts                                             type  devpts       (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs        on  /run                                                 type  tmpfs        (rw,nosuid,nodev,size=787300k,nr_inodes=819200,mode=755)
tmpfs        on  /run/lock                                            type  tmpfs        (rw,nosuid,nodev,noexec,relatime,size=5120k)
cgroup2      on  /sys/fs/cgroup                                       type  cgroup2      (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot)
pstore       on  /sys/fs/pstore                                       type  pstore       (rw,nosuid,nodev,noexec,relatime)
bpf          on  /sys/fs/bpf                                          type  bpf          (rw,nosuid,nodev,noexec,relatime,mode=700)
systemd-1    on  /proc/sys/fs/binfmt_misc                             type  autofs       (rw,relatime,fd=30,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
mqueue       on  /dev/mqueue                                          type  mqueue       (rw,nosuid,nodev,noexec,relatime)
debugfs      on  /sys/kernel/debug                                    type  debugfs      (rw,nosuid,nodev,noexec,relatime)
tracefs      on  /sys/kernel/tracing                                  type  tracefs      (rw,nosuid,nodev,noexec,relatime)
nfsd         on  /proc/fs/nfsd                                        type  nfsd         (rw,relatime)
fusectl      on  /sys/fs/fuse/connections                             type  fusectl      (rw,nosuid,nodev,noexec,relatime)
configfs     on  /sys/kernel/config                                   type  configfs     (rw,nosuid,nodev,noexec,relatime)
ramfs        on  /run/credentials/systemd-sysctl.service              type  ramfs        (ro,nosuid,nodev,noexec,relatime,mode=700)
ramfs        on  /run/credentials/systemd-sysusers.service            type  ramfs        (ro,nosuid,nodev,noexec,relatime,mode=700)
ramfs        on  /run/credentials/systemd-tmpfiles-setup-dev.service  type  ramfs        (ro,nosuid,nodev,noexec,relatime,mode=700)
tmpfs        on  /tmp                                                 type  tmpfs        (rw,nosuid,nodev,noatime,lazytime,size=3016704k)
/dev/sda1    on  /boot                                                type  vfat         (rw,noatime,lazytime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
ramfs        on  /run/credentials/systemd-tmpfiles-setup.service      type  ramfs        (ro,nosuid,nodev,noexec,relatime,mode=700)
binfmt_misc  on  /proc/sys/fs/binfmt_misc                             type  binfmt_misc  (rw,nosuid,nodev,noexec,relatime)
sunrpc       on  /run/rpc_pipefs                                      type  rpc_pipefs   (rw,relatime)

Do you have util-linux installed?

apt list | grep util-linux

https://packages.debian.org/en/bookworm/util-linux

root@adsb-feeder-pi:~# apt list | grep util-linux

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

util-linux-extra/stable,now 2.38.1-5+b1 arm64  [Installiert,automatisch]
util-linux-locales/stable 2.38.1-5 all
util-linux/stable,now 2.38.1-5+b1 arm64  [installiert]
 DietPi v9.2.1 : 21:13 - Mo 18.03.2024
 ─────────────────────────────────────
 - Device model : RPi Zero 2 W (aarch64)
 - Uptime : up 1 hour, 25 minutes
 - CPU temp : 60 °C / 140 °F : Running hot, not recommended
 - FQDN/hostname : adsb-feeder-pi
 - LAN IP : XX.X.X.XXX (eth0)
 - WAN IP : XX.XXX.XX.XXX 
 - Disk usage (RootFS) : 7,5G of 59G (14%)
 - Disk usage (userdata) : 7,5G of 59G (14%)

Ok I just learned the column command comes with the package bsdmainutils, do you have that?

2 Likes

Until just now the command was not possible, but thanks to your tip and

apt install bsdmainutils

Thanks again to everyone involved for the great support!
I now get the output I was looking for.

:+1:

root@adsb-feeder-pi:~# mount | column -t
/dev/sda1       on  /                                                    type  ext4         (rw,noatime,lazytime)
devtmpfs        on  /dev                                                 type  devtmpfs     (rw,relatime,size=204376k,nr_inodes=51094,mode=755)
proc            on  /proc                                                type  proc         (rw,nosuid,nodev,noexec,relatime)
sysfs           on  /sys                                                 type  sysfs        (rw,nosuid,nodev,noexec,relatime)
securityfs      on  /sys/kernel/security                                 type  securityfs   (rw,nosuid,nodev,noexec,relatime)
tmpfs           on  /dev/shm                                             type  tmpfs        (rw,nosuid,nodev)
devpts          on  /dev/pts                                             type  devpts       (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs           on  /run                                                 type  tmpfs        (rw,nosuid,nodev,size=95692k,nr_inodes=819200,mode=755)
tmpfs           on  /run/lock                                            type  tmpfs        (rw,nosuid,nodev,noexec,relatime,size=5120k)
cgroup2         on  /sys/fs/cgroup                                       type  cgroup2      (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot)
pstore          on  /sys/fs/pstore                                       type  pstore       (rw,nosuid,nodev,noexec,relatime)
bpf             on  /sys/fs/bpf                                          type  bpf          (rw,nosuid,nodev,noexec,relatime,mode=700)
systemd-1       on  /proc/sys/fs/binfmt_misc                             type  autofs       (rw,relatime,fd=30,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
tracefs         on  /sys/kernel/tracing                                  type  tracefs      (rw,nosuid,nodev,noexec,relatime)
mqueue          on  /dev/mqueue                                          type  mqueue       (rw,nosuid,nodev,noexec,relatime)
debugfs         on  /sys/kernel/debug                                    type  debugfs      (rw,nosuid,nodev,noexec,relatime)
fusectl         on  /sys/fs/fuse/connections                             type  fusectl      (rw,nosuid,nodev,noexec,relatime)
configfs        on  /sys/kernel/config                                   type  configfs     (rw,nosuid,nodev,noexec,relatime)
ramfs           on  /run/credentials/systemd-sysctl.service              type  ramfs        (ro,nosuid,nodev,noexec,relatime,mode=700)
ramfs           on  /run/credentials/systemd-sysusers.service            type  ramfs        (ro,nosuid,nodev,noexec,relatime,mode=700)
ramfs           on  /run/credentials/systemd-tmpfiles-setup-dev.service  type  ramfs        (ro,nosuid,nodev,noexec,relatime,mode=700)
tmpfs           on  /tmp                                                 type  tmpfs        (rw,nosuid,nodev,noatime,lazytime,size=1048576k)
tmpfs           on  /var/log                                             type  tmpfs        (rw,nosuid,nodev,noatime,lazytime,size=51200k)
/dev/mmcblk0p1  on  /boot                                                type  vfat         (rw,noatime,lazytime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
ramfs           on  /run/credentials/systemd-tmpfiles-setup.service      type  ramfs        (ro,nosuid,nodev,noexec,relatime,mode=700)
binfmt_misc     on  /proc/sys/fs/binfmt_misc                             type  binfmt_misc  (rw,nosuid,nodev,noexec,relatime)
tmpfs           on  /var/cache/fontconfig                                type  tmpfs        (rw,nosuid,nodev,relatime,size=32000k,mode=755)

btw, RPI USB mass storage boot options are described on RPi docs https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#usb-mass-storage-boot

For some RPi models USB boot can be enabled within dietpi-config. But I’m not 100% sure which one. Best to my knowledge t should work on the 2W as well

Following is applicable for HW id 3

which seems to be a 2W as well

This option is actually also available under dietpi-configure when using the Zero 2. Unfortunately, selecting USB Boot did not help and was not accepted.

An entry program_usb_boot_mode=1 is then set under /boot/config. txt?
This is not written in my case.
However, this may be due to my somewhat unusual setup/hardware, as described above.

This will certainly work if you connect a USB device to the original micro USB port.

You perhaps didn’t modify your alias list with my (before typo’d/boned up) command?

before I had (some of my custom) mine set in .bash_aliases
as

## mount differently
alias mount='mount | column -t'

but I changed it to

## mount differently
alias mounts='mount | column -t'

so to prevent any time the command “mount” was typed it circumvented the scripting entered…changed it to “mounts” because there isn’t a “command” persay to show what is mounted and what isnt

if you didn’t modify, disregard my last entry…but I thought of it due to the errors being shown
With that said…the custom “aliases”
is in a non-standard Dietpi user location as well…
stock location discussion here

Hmm, it should actually work to boot from USB on RPi Zero 2 W, after programming the OTP with the config option added by dietpi-config: https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#raspberry-pi-2b-3a-3b-cm3-cm3-zero-2-w

You see this USB boot support option and selected it, but the config entry was not added?

Yes, I see the USB boot option, but it didn’t change anything, the Zero 2 didn’t boot from the SSD which was connected via USB using the adapter card.
Checking if the OTP bit was set correctly with vcgencmd otp_dump | grep 17:
did not show the desired success.
I also tried a bootcode.bin, unfortunately without success.

The only thing that makes me wonder is described in the link above:
Make sure there is no blank line at the end of config.txt .”

I am not 100% sure whether this was the case in my config.txt.

Based on the statements, I tried again.
I tried to set the USB Boot Support to “ON” under dietpi-config under 4. Advanced Options - it remained “OFF”.
I manually set the entry program_usb_boot_mode=1 as the last entry in /boot/config.txt and made sure that there was no empty line underneath - also no success.

The following output appears unchanged when entering :

root@adsb-feeder-pi:~# vcgencmd otp_dump | grep 17:
17:3020008a

If it had worked, then 17:3020000a should be there.

I can and will have to live with the workaround.
Thanks again for the effort to all involved.

Hmm, then maybe the information on the RPi documentation regarding Raspberry Pi Zero 2 W is wrong.

Generally, when you select the USB boot support option in dietpi-config, you should see a dialog, asking for confirmation, as it is non-reversible. When confirming, once you exit dietpi-config it should ask you for a reboot, and after reboot, the bit should have changed accordingly. Until then, indeed the USB boot sate is still shown as “OFF”, as the bit did not yet change. We should probably replace this with some “pending” state info, to make clear that the program_usb_boot_mode=1 setting has been added to /boot/config.txt and is needing a reboot only. It is removed again automatically on reboot, as it is not required anymore, once the OTP was programmed.

Btw, you did not migrate to the new RPi 5 compatible kernel/firmware package set, did you? This would make /boot/config.txt a symlink to /boot/firmware/config.txt, and in theory, if this symlink is broken or gets replaced with the actual file, e.g. when editing it via set -i without --follow-symlink flag, /boot/config.txt would not be the effective boot configuration.

Regarding section 2, I can say that I have tried it several times exactly as described, but unfortunately without the expected success.

Regarding section 3, would the kernel change have changed anything at all? Also, I can’t find a setting for the RPi Zero 2 like the one for an RPi 5 under DietPi.

It’s probably just a silly gimmick of mine, as it doesn’t really give the Zero 2 any advantage over an SD card apart from perhaps better stability of an SSD. The SSD is only connected via USB 2.0 and, as described above, there is no speed advantage.
I just had the hardware left over from old projects.