boot problem

this is what i get on login
DietPi on Raspberry Pi Zero

-bash: /boot/dietpi/func/dietpi-globals: No such file or directory
[FAILED] DietPi-Login | Failed to load DietPi-Globals. Skipping DietPi login scripts...

Hi,

many thanks for your message. Looks like some of DietPi scripts got corrupted. Let’s check how scripts looks like

ls -la /boot/dietpi/func/

ls: cannot access '/boot/dietpi/func/': No such file or directory

same with /boot/dietpi/

ls: cannot access '/boot/dietpi/': No such file or directory

ok something wrong on your system. What version of DietPi you are running? Pls can you provide

ls -la /

I am not sure how to find DietPi version

on login I have this:
Linux DietPi 4.19.118+ #1311 MonApr 27

on boot I get

Failed to start DietPi-RAMlog

also this:

root@DietPi:~# systemctl status dietpi-ramlog.service
● dietpi-ramlog.service - DietPi-RAMlog
   Loaded: loaded (/etc/systemd/system/dietpi-ramlog.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2020-08-26 16:23:46 EEST; 7min ago
  Process: 217 ExecStartPre=/bin/mkdir -p /var/tmp/dietpi/logs (code=exited, status=0/SUCCESS)
  Process: 223 ExecStart=/bin/dash -c /boot/dietpi/func/dietpi-ramlog 0 2>&1 >> /var/tmp/dietpi/logs/dietpi-ramlog.log (code=exited, status=127)
 Main PID: 223 (code=exited, status=127)

Aug 26 16:23:46 DietPi systemd[1]: Starting DietPi-RAMlog...
Aug 26 16:23:46 DietPi dash[223]: /bin/dash: 1: /boot/dietpi/func/dietpi-ramlog: not found
Aug 26 16:23:46 DietPi systemd[1]: dietpi-ramlog.service: Main process exited, code=exited, status=127/n/a
Aug 26 16:23:46 DietPi systemd[1]: dietpi-ramlog.service: Failed with result 'exit-code'.
Aug 26 16:23:46 DietPi systemd[1]: Failed to start DietPi-RAMlog.



root@DietPi:~# ls -la /
total 174
drwxr-xr-x 21 root root   4096 Jul  8 16:24 .
drwxr-xr-x 21 root root   4096 Jul  8 16:24 ..
lrwxrwxrwx  1 root root      5 Jun  3 20:45 DietPi -> /boot
drwxr-xr-x  2 root root   4096 Jun  6 10:13 bin
drwxr-xr-x  3 root root 104448 Jan  1  1970 boot
drwxr-xr-x 14 root root   3440 Aug 26 16:23 dev
drwxr-xr-x 79 root root   4096 Jul  8 16:24 etc
drwxr-xr-x  3 root root   4096 Jan  8  2020 home
drwxr-xr-x 16 root root   4096 Jan  8  2020 lib
drwx------  2 root root  16384 Sep 26  2019 lost+found
drwxr-xr-x  2 root root   4096 Jul  8 16:24 media
drwxr-xr-x  6 root root   4096 Jan  8  2020 mnt
drwxr-xr-x  3 root root   4096 Sep 26  2019 opt
dr-xr-xr-x 67 root root      0 Jan  1  1970 proc
drwx------  8 root root   4096 Aug 27  2020 root
drwxr-xr-x 22 root root    580 Aug 26 16:23 run
drwxr-xr-x  2 root root   4096 Jun  3 20:41 sbin
drwxr-xr-x  2 root root   4096 Jan  8  2020 srv
dr-xr-xr-x 12 root root      0 Jan  1  1970 sys
drwxrwxrwt  7 root root    180 Aug 26 16:24 tmp
drwxr-xr-x 10 root root   4096 Jan  8  2020 usr
drwxr-xr-x 13 root root   4096 Jun 12 08:15 var

Looks like you are missing all dietpi scripts. Pls can you post

ls -la /boot

It’s too long so I shortened

root@DietPi:~# ls -la /boot
total 62299
drwxr-xr-x  3 root root   104448 Jan  1  1970 .
drwxr-xr-x 21 root root     4096 Jul  8 16:24 ..
-rwxr-xr-x  1 root root    18693 Jun  3 20:42 COPYING.linux
-rwxr-xr-x  1 root root      512 Jan  1  1980 FSCK0000.REC
-rwxr-xr-x  1 root root      512 Jan  1  1980 FSCK0001.REC
-rwxr-xr-x  1 root root      512 Jan  1  1980 FSCK0002.REC
-rwxr-xr-x  1 root root    12800 Jan  1  1980 FSCK0003.REC
-rwxr-xr-x  1 root root   529408 Jan  1  1980 FSCK0004.REC
-rwxr-xr-x  1 root root     6144 Jan  1  1980 FSCK0005.REC
-rwxr-xr-x  1 root root   137728 Jan  1  1980 FSCK0006.REC
-rwxr-xr-x  1 root root      512 Jan  1  1980 FSCK0007.REC
-rwxr-xr-x  1 root root      512 Jan  1  1980 FSCK0008.REC
-rwxr-xr-x  1 root root      512 Jan  1  1980 FSCK0009.REC
-rwxr-xr-x  1 root root      512 Jan  1  1980 FSCK0010.REC
-rwxr-xr-x  1 root root      512 Jan  1  1980 FSCK0011.REC
-rwxr-xr-x  1 root root      512 Jan  1  1980 FSCK0012.REC
-rwxr-xr-x  1 root root      512 Jan  1  1980 FSCK0013.REC
-rwxr-xr-x  1 root root      512 Jan  1  1980 FSCK0014.REC
-rwxr-xr-x  1 root root      512 Jan  1  1980 FSCK0015.REC
-rwxr-xr-x  1 root root      512 Jan  1  1980 FSCK0016.REC
-rwxr-xr-x  1 root root      512 Jan  1  1980 FSCK0017.REC
-rwxr-xr-x  1 root root      512 Jan  1  1980 FSCK0018.REC
-rwxr-xr-x  1 root root      512 Jan  1  1980 FSCK0019.REC
-rwxr-xr-x  1 root root      512 Jan  1  1980 FSCK0020.REC
-rwxr-xr-x  1 root root      512 Jan  1  1980 FSCK0021.REC
...........................................................................................
...........................................................................................
...........................................................................................
-rwxr-xr-x  1 root root      512 Jan  1  1980 FSCK3076.REC
-rwxr-xr-x  1 root root      512 Jan  1  1980 FSCK3077.REC
-rwxr-xr-x  1 root root     1536 Jan  1  1980 FSCK3078.REC
-rwxr-xr-x  1 root root   190464 Jan  1  1980 FSCK3079.REC
-rwxr-xr-x  1 root root     3072 Jan  1  1980 FSCK3080.REC
-rwxr-xr-x  1 root root     2048 Jan  1  1980 FSCK3081.REC
-rwxr-xr-x  1 root root      512 Jan  1  1980 FSCK3082.REC
-rwxr-xr-x  1 root root     3584 Jan  1  1980 FSCK3083.REC
-rwxr-xr-x  1 root root     8704 Jan  1  1980 FSCK3084.REC
-rwxr-xr-x  1 root root     8704 Jan  1  1980 FSCK3085.REC
-rwxr-xr-x  1 root root     2048 Jan  1  1980 FSCK3086.REC
-rwxr-xr-x  1 root root      512 Jan  1  1980 FSCK3087.REC
-rwxr-xr-x  1 root root     1024 Jan  1  1980 FSCK3088.REC
-rwxr-xr-x  1 root root      512 Jan  1  1980 FSCK3089.REC
-rwxr-xr-x  1 root root   529408 Jan  1  1980 FSCK3090.REC
-rwxr-xr-x  1 root root     6144 Jan  1  1980 FSCK3091.REC
-rwxr-xr-x  1 root root   529408 Jan  1  1980 FSCK3092.REC
-rwxr-xr-x  1 root root     6144 Jan  1  1980 FSCK3093.REC
-rwxr-xr-x  1 root root   529408 Jan  1  1980 FSCK3094.REC
-rwxr-xr-x  1 root root     6144 Jan  1  1980 FSCK3095.REC
-rwxr-xr-x  1 root root   529408 Jan  1  1980 FSCK3096.REC
-rwxr-xr-x  1 root root     6144 Jan  1  1980 FSCK3097.REC
-rwxr-xr-x  1 root root   529408 Jan  1  1980 FSCK3098.REC
-rwxr-xr-x  1 root root     6144 Jan  1  1980 FSCK3099.REC
-rwxr-xr-x  1 root root     6144 Jan  1  1980 FSCK3100.REC
-rwxr-xr-x  1 root root   529408 Jan  1  1980 FSCK3101.REC
-rwxr-xr-x  1 root root     6144 Jan  1  1980 FSCK3102.REC
-rwxr-xr-x  1 root root   529408 Jan  1  1980 FSCK3103.REC
-rwxr-xr-x  1 root root     6144 Jan  1  1980 FSCK3104.REC
-rwxr-xr-x  1 root root   529408 Jan  1  1980 FSCK3105.REC
-rwxr-xr-x  1 root root     6144 Jan  1  1980 FSCK3106.REC
-rwxr-xr-x  1 root root   529408 Jan  1  1980 FSCK3107.REC
-rwxr-xr-x  1 root root     6144 Jan  1  1980 FSCK3108.REC
-rwxr-xr-x  1 root root   529408 Jan  1  1980 FSCK3109.REC
-rwxr-xr-x  1 root root     6144 Jan  1  1980 FSCK3110.REC
-rwxr-xr-x  1 root root   529408 Jan  1  1980 FSCK3111.REC
-rwxr-xr-x  1 root root     6144 Jan  1  1980 FSCK3112.REC
-rwxr-xr-x  1 root root   529408 Jan  1  1980 FSCK3113.REC
-rwxr-xr-x  1 root root     6144 Jan  1  1980 FSCK3114.REC
-rwxr-xr-x  1 root root   529408 Jan  1  1980 FSCK3115.REC
-rwxr-xr-x  1 root root     6144 Jan  1  1980 FSCK3116.REC
-rwxr-xr-x  1 root root     3584 Jan  1  1980 FSCK3117.REC
-rwxr-xr-x  1 root root     9728 Jan  1  1980 FSCK3118.REC
-rwxr-xr-x  1 root root    17920 Jan  1  1980 FSCK3119.REC
-rwxr-xr-x  1 root root     7168 Jan  1  1980 FSCK3120.REC
-rwxr-xr-x  1 root root    14848 Jan  1  1980 FSCK3121.REC
-rwxr-xr-x  1 root root    44032 Jan  1  1980 FSCK3122.REC
-rwxr-xr-x  1 root root   138240 Jan  1  1980 FSCK3123.REC
-rwxr-xr-x  1 root root     5632 Jan  1  1980 FSCK3124.REC
-rwxr-xr-x  1 root root     9728 Jan  1  1980 FSCK3125.REC
-rwxr-xr-x  1 root root    66560 Jan  1  1980 FSCK3126.REC
-rwxr-xr-x  1 root root     7680 Jan  1  1980 FSCK3127.REC
-rwxr-xr-x  1 root root     4096 Jan  1  1980 FSCK3128.REC
-rwxr-xr-x  1 root root     5120 Jan  1  1980 FSCK3129.REC
-rwxr-xr-x  1 root root    19968 Jan  1  1980 FSCK3130.REC
-rwxr-xr-x  1 root root     8192 Jan  1  1980 FSCK3131.REC
-rwxr-xr-x  1 root root     7680 Jan  1  1980 FSCK3132.REC
-rwxr-xr-x  1 root root    36352 Jan  1  1980 FSCK3133.REC
-rwxr-xr-x  1 root root     6144 Jan  1  1980 FSCK3134.REC
-rwxr-xr-x  1 root root    16896 Jan  1  1980 FSCK3135.REC
-rwxr-xr-x  1 root root    15872 Jan  1  1980 FSCK3136.REC
-rwxr-xr-x  1 root root     2048 Jan  1  1980 FSCK3137.REC
-rwxr-xr-x  1 root root     2048 Jan  1  1980 FSCK3138.REC
-rwxr-xr-x  1 root root    10240 Jan  1  1980 FSCK3139.REC
-rwxr-xr-x  1 root root    12800 Jan  1  1980 FSCK3140.REC
-rwxr-xr-x  1 root root    71680 Jan  1  1980 FSCK3141.REC
-rwxr-xr-x  1 root root    15360 Jan  1  1980 FSCK3142.REC
-rwxr-xr-x  1 root root     2048 Jan  1  1980 FSCK3143.REC
-rwxr-xr-x  1 root root     2560 Jan  1  1980 FSCK3144.REC
-rwxr-xr-x  1 root root     8704 Jan  1  1980 FSCK3145.REC
-rwxr-xr-x  1 root root    62464 Jan  1  1980 FSCK3146.REC
-rwxr-xr-x  1 root root    19968 Jan  1  1980 FSCK3147.REC
-rwxr-xr-x  1 root root     4608 Jan  1  1980 FSCK3148.REC
-rwxr-xr-x  1 root root     5632 Jan  1  1980 FSCK3149.REC
-rwxr-xr-x  1 root root     9216 Jan  1  1980 FSCK3150.REC
-rwxr-xr-x  1 root root     4608 Jan  1  1980 FSCK3151.REC
-rwxr-xr-x  1 root root     4608 Jan  1  1980 FSCK3152.REC
-rwxr-xr-x  1 root root     9728 Jan  1  1980 FSCK3153.REC
-rwxr-xr-x  1 root root    18944 Jan  1  1980 FSCK3154.REC
-rwxr-xr-x  1 root root    10752 Jan  1  1980 FSCK3155.REC
-rwxr-xr-x  1 root root     1536 Jan  1  1980 FSCK3156.REC
-rwxr-xr-x  1 root root     2048 Jan  1  1980 FSCK3157.REC
-rwxr-xr-x  1 root root     1536 Jan  1  1980 FSCK3158.REC
-rwxr-xr-x  1 root root      512 Jan  1  1980 FSCK3159.REC
-rwxr-xr-x  1 root root     6144 Jan  1  1980 FSCK3160.REC
-rwxr-xr-x  1 root root      512 Jan  1  1980 FSCK3161.REC
-rwxr-xr-x  1 root root   536576 Jan  1  1980 FSCK3162.REC
-rwxr-xr-x  1 root root     6144 Jan  1  1980 FSCK3163.REC
-rwxr-xr-x  1 root root    24358 Jun  3 20:42 bcm2708-rpi-b-plus.dtb
-rwxr-xr-x  1 root root    24095 Jun  3 20:42 bcm2708-rpi-b.dtb
-rwxr-xr-x  1 root root    23876 Jun  3 20:42 bcm2708-rpi-cm.dtb
-rwxr-xr-x  1 root root    24536 Jun  3 20:42 bcm2708-rpi-zero-w.dtb
-rwxr-xr-x  1 root root    23800 Jun  3 20:42 bcm2708-rpi-zero.dtb
-rwxr-xr-x  1 root root    25422 Jun  3 20:42 bcm2709-rpi-2-b.dtb
-rwxr-xr-x  1 root root    25571 Jun  3 20:42 bcm2710-rpi-2-b.dtb
-rwxr-xr-x  1 root root    27231 Jun  3 20:42 bcm2710-rpi-3-b-plus.dtb
-rwxr-xr-x  1 root root    26612 Jun  3 20:42 bcm2710-rpi-3-b.dtb
-rwxr-xr-x  1 root root    25426 Jun  3 20:42 bcm2710-rpi-cm3.dtb
-rwxr-xr-x  1 root root    41273 Jun  3 20:42 bcm2711-rpi-4-b.dtb
-rwxr-xr-x  1 root root    52480 Jun  3 20:44 bootcode.bin
-rwxr-xr-x  1 root root      119 Jun  4 22:17 cmdline.txt
-rwxr-xr-x  1 root root     2640 Jun  6 10:12 config.txt
-rwxr-xr-x  1 root root     9362 Jan  3  2020 dietpi-README.md
-rwxr-xr-x  1 root root    12631 Jul  8 16:24 dietpi.txt
-rwxr-xr-x  1 root root     6746 Jun  3 20:44 fixup.dat
-rwxr-xr-x  1 root root     5405 Jun  3 20:44 fixup4.dat
-rwxr-xr-x  1 root root     2663 Jun  3 20:44 fixup_cd.dat
-rwxr-xr-x  1 root root     9820 Jun  3 20:44 fixup_db.dat
-rwxr-xr-x  1 root root     9818 Jun  3 20:44 fixup_x.dat
-rwxr-xr-x  1 root root      145 Sep 26  2019 issue.txt
-rwxr-xr-x  1 root root  5158072 Jun  3 20:42 kernel.img
-rwxr-xr-x  1 root root  5466824 Jun  3 20:42 kernel7.img
-rwxr-xr-x  1 root root  5801056 Jun  3 20:42 kernel7l.img
-rwxr-xr-x  1 root root 13945344 Jun  3 20:42 kernel8.img
drwxr-xr-x  2 root root    16896 Jun  3 20:44 overlays
-rwxr-xr-x  1 root root  2884708 Jun  3 20:44 start.elf
-rwxr-xr-x  1 root root  2272992 Jun  3 20:44 start4.elf
-rwxr-xr-x  1 root root   816124 Jun  3 20:44 start4cd.elf
-rwxr-xr-x  1 root root  3774532 Jun  3 20:44 start4db.elf
-rwxr-xr-x  1 root root  3031652 Jun  3 20:44 start4x.elf
-rwxr-xr-x  1 root root   694052 Jun  3 20:44 start_cd.elf
-rwxr-xr-x  1 root root  4861512 Jun  3 20:44 start_db.elf
-rwxr-xr-x  1 root root  3799144 Jun  3 20:44 start_x.elf

puhh looks like your file system got corrupted. Let’s check and try to fix

dosfsck -a /dev/mmcblk0p1
root@DietPi:~# dosfsck -a /dev/mmcblk0p1
fsck.fat 4.1 (2017-01-24)
0x41: Dirty bit is set. Fs was not properly unmounted and some data may be corrupt.
 Automatically removing dirty bit.
Performing changes.
/dev/mmcblk0p1: 3397 files, 125616/516190 clusters

I guess the folder /boot/dietpi is still missing right? If yes we would need to clone it from our GitHub repository. Will write some small how-to later the evening as I’m travelling today.

Yes
Still missing

ok lt’s clone the directory fro GitHub

apt install git
git clone https://github.com/MichaIng/DietPi.git /tmp/dietpi
rm -r /boot/dietpi/
cp -r /tmp/dietpi/dietpi /boot/
apt purge git
reboot

After reboot, you will be ask to perform first setup again.

everything OK
thank you

ok good, at least this has been fixed. But no guarantee that all files are ok now. Because you had such a huge amount (more than 3100) of corrupted FSCK* files. :wink: