habe ich jetzt mal in die usbmount Config geschrieben. Danach den o.g. Trick angewandt um /dev/sda2 zu mounten und dann ist /dev/sda2 explizit gemounted. Dann umounten und mkfs funktioniert
Code
root@raspberrypi-bullseye-desktop:~# mount | grep sda
/dev/sda2 on /media/usb0 type ext4 (rw,nodev,noexec,noatime,nodiratime,sync,nobarrier,stripe=8191)
root@raspberrypi-bullseye-desktop:~# umount /dev/sda2
root@raspberrypi-bullseye-desktop:~# yes | mkfs.ext4 /dev/sda2; echo $?
mke2fs 1.46.2 (28-Feb-2021)
Creating filesystem with 60982062 4k blocks and 15253504 inodes
Filesystem UUID: c77382ba-e22b-4f58-acce-90abd55cd0e8
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872
Allocating group tables: done
Writing inode tables: done
Creating journal (262144 blocks): done
Writing superblocks and filesystem accounting information: done
0
Alles anzeigen
D.h. mit dieser Option wird der existierende mount nicht versteckt und man kann die per usbmount gemountete Parition umounten.