TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: ALL
from: MARKUS ROBERT KESSLER
date: 2021-03-20 08:13:00
subject: Re: Raspbian on ext4: Str

On Sat, 20 Mar 2021 00:00:55 +0000 Martin Gregorie wrote:

Hi,

> On Fri, 19 Mar 2021 22:55:43 +0000, Markus Robert Kessler wrote:
>
>> - What can be done remotely now to "repair" the FS? -- I can hardly
>> pull the card out of it and run an fsck on a second machine via VPN.
>> B.t.w., badblocks came back with 0 errors, the SD card seems still ok.
>>
> A few questions:
>
> - How full is the card? "df -h" should show that.
>
> - How long has thus card been in use?

installation was end of November on a fresh 16 GB card.

As recommended in this group, I did not perform reboots every day /
night, since there are only some bash and python scripts running, which
consume only few resources and are ending after running properly.

$ who -r
         run-level 3  Nov 30 09:21
$
$
$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        15G  2.4G   12G  18% /
devtmpfs        184M     0  184M   0% /dev
tmpfs           216M     0  216M   0% /dev/shm
tmpfs           216M   22M  194M  11% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           216M     0  216M   0% /sys/fs/cgroup
/dev/mmcblk0p1  253M   54M  199M  22% /boot
tmpfs            44M     0   44M   0% /run/user/0
$
$
$ cd /etc/resolvconf/update-libc.d
$ ll
ls: cannot access 'avahi-daemon': Structure needs cleaning
total 8.0K
drwxr-xr-x 2 root root 4.0K Feb 13  2020 ./
drwxr-xr-x 3 root root 4.0K Feb 13  2020 ../
-????????? ? ?    ?       ?            ? avahi-daemon
$ cat avahi-daemon
cat: avahi-daemon: Structure needs cleaning
$ fstrim -a -v
/boot: 197.4 MiB (206990848 bytes) trimmed on /dev/mmcblk0p1
/: 0 B (0 bytes) trimmed on /dev/mmcblk0p2
$ ll
ls: cannot access 'avahi-daemon': Structure needs cleaning
total 8.0K
drwxr-xr-x 2 root root 4.0K Feb 13  2020 ./
drwxr-xr-x 3 root root 4.0K Feb 13  2020 ../
-????????? ? ?    ?       ?            ? avahi-daemon
$

> - Are you running 'fstrim' on the card and, if so , how frequently?
>   -- but see below ---
>

Well, indeed, I never used fstrim so far.
But in this case it seems to do nothing, though.

> - Can you describe how you collect and store data on the Pi4 - by that I
>   mean how big are the files, how many are held on the Pi, how long is
>   each file held, or are you using a database?

Data is received via I2C bus, processed and transmitted to a webserver
outside. These are only some Kilobytes, and there is no sensor data
stored on disk.

> - If you're using files, how is each written to? IOW is it left open and
>   data added until it hits a preset limit and a new one is opened, or is
>   the file normally closed and every so often the file is opened, data
>   appended to it and the file closed again. How often are old files
>   discarded to make room for more data and how are the old files chosen
>   for deletion?
>
> - How easy is it to change the maximum number and size of files [or
>   rows in the database table(s)] on the Pi?
>
> ** Guess **
> Could it be that you have never run fstrim? If so, running it may help:
> something like "sudo fstrim -v /home" should do the trick - however I've
> just tried it on a Pi 2B running Buster and, since I don't usually run
> fstrim on the Pi, I thought it would do its thing (I run it weekly on a
> Lenovo laptop with a Sanyo 120 GB SSD and Fedora Linux; several Kb of
> blocks are trimmed each time fstrim is run. However, on the Pi 2 (16GB
> SD card fitted) 'fstrim' just reports zero bytes trimmed, i.e. it didn't
> do anything.

Yes, same here. See above.

> I assume from this that by design fstrim does nothing when pointed at a
> partition on and SD card. Can anybody confirm this? The manpage is
> silent about using in on SD cards.
>
> However, the other stuff I asked about should let us make sensible
> suggestions.

So, the errors still persist, and I don't dare to do a reboot...

Best regards,

Markus

--
Please reply to group only.
For private email please use http://www.dipl-ing-kessler.de/email.htm

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.