DietPi-Login | Failed to load DietPi-Globals

Hello,
After i made some updates today and tried to restart pihole i got this error on login:
I did some research but couldn’t find a solution and i am not an expert.

Linux DietPi 4.19.66-v7+ #1253 SMP Thu Aug 15 11:49:46 BST 2019 armv7l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
-bash: /DietPi/dietpi/func/dietpi-globals: No such file or directory
[> FAILED> ] DietPi-Login | Failed to load DietPi-Globals. Skipping DietPi login scripts…
root@DietPi:~#

So the DietPi folder is empty as i figured. I have a full backup in /mnt/dietpi-backup
Anyone can tell me how to restore the system from this backup? Should i do manually by copying the files to the DietPi ?

Did you create the backup with the dietpi-backup utilty?

If so run it again and select restore.

John

yes i did with dietpi-backup but the problem now is that nothing of dietpi works

-bash: /DietPi/dietpi/func/dietpi-globals: No such file or directory
[FAILED] DietPi-Login | Failed to load DietPi-Globals. Skipping DietPi login scripts...
root@DietPi:~# dietpi-backup
-bash: dietpi-backup: command not found
root@DietPi:~#

I’d clone the card and try copying the files manaully on the copy.

acostas
Note that /DietPi is the RAMdisk mountpoint for some files/dirs in /boot, especially /boot/dietpi which are the DietPi scripts/programs.

In your case mounting the tmpfs or moving the DietPi scripts in place seems to have failed. Please paste:

systemctl status DietPi.mount
tail /var/tmp/dietpi/logs/dietpi-ramdisk.log

here is what I get:

root@DietPi:~# systemctl status DietPi.mount
● DietPi.mount - /DietPi
   Loaded: loaded (/etc/fstab; generated; vendor preset: enabled)
   Active: active (mounted) since Sat 2019-09-07 16:20:32 EEST; 3min
44s ago
    Where: /DietPi
     What: tmpfs
     Docs: man:fstab(5)
           man:systemd-fstab-generator(8)
  Process: 183 ExecMount=/bin/mount tmpfs /DietPi -t tmpfs -o defaults,size=10m,
noatime,nodev,nosuid,mode=1777 (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 4915)
   CGroup: /system.slice/DietPi.mount

Sep 07 16:20:32 DietPi systemd[1]: Mounting /DietPi...
Sep 07 16:20:32 DietPi systemd[1]: Mounted /DietPi.



root@DietPi:~# tail /var/tmp/dietpi/logs/dietpi-ramdisk.log
Wed 17 Jul 13:57:40 EEST 2019 | DietPi-RAMdisk: Copying DietPi to RAM...
Wed 17 Jul 13:57:40 EEST 2019 | DietPi-RAMdisk: Copied DietPi to RAM.
Sun  4 Aug 20:17:07 EEST 2019 | DietPi-RAMdisk: Copying DietPi to RAM...
Sun  4 Aug 20:17:10 EEST 2019 | DietPi-RAMdisk: Copied DietPi to RAM.
Sat  7 Sep 15:31:12 EEST 2019 | DietPi-RAMdisk: Storing DietPi to disk...
Sat  7 Sep 15:31:12 EEST 2019 | DietPi-RAMdisk: Stored DietPi to disk.
Sat  7 Sep 15:31:16 EEST 2019 | DietPi-RAMdisk: Copying DietPi to RAM...
Sat  7 Sep 15:31:20 EEST 2019 | DietPi-RAMdisk: Copied DietPi to RAM.
Sat  7 Sep 16:20:31 EEST 2019 | DietPi-RAMdisk: Storing DietPi to disk...
Sat  7 Sep 16:20:32 EEST 2019 | DietPi-RAMdisk: Stored DietPi to disk.

MichaIng ok it seems that everything on SD card is read-only

Is there a way to fix this or i have to format the card?

acostas
Looks like, last log file entry is about storing scripts to disk on shutdown, but nothing about copying them to RAMdisk on boot, even that the DietPi tmpfs was mounted successfully.

If indeed SDcard is R/O, please check:

  • dmesg for any probably helpful error logs.
  • Run fsck -f /dev/mmcblk0p2 + fsck /dev/mmcblk0p1 to check for file systems errors and in case fix them. Not sure if fixing is possible, depends on if writing to SDcard is blocked/broken on hardware level or if its just a mount issue, e.g. the system remounts it as R/O automatically due to I/O errors.
  • If fsck on the running system does not work, try it on an external Linux system. At best run it multiple times until no errors are found anymore, if fsck is able to fix them at least.
  • Generally it is also a hint about how bad/of what kind the error is, if the SDcard can be mounted with R/W access on an external system or not.

If nothing helps, but you don’t want to reflash, you could copy/backup the SDcard content, flash the new image, copy/overwrite content from the backup. But it is not the cleanest way and the image must match the same Debian version. If it’s currently Stretch, you must use our luckily still available RPi Stretch legacy image: https://dietpi.com/downloads/images/legacy/

I’m having the same problem after doing ‘pihole -up’ via ssh. Failed to load dietpi-globals. And I dont have a backup. What should i do?

Sorry for necro but as I encountered this issue and this was one of the areas i found some help Ill go through my process.

For me, I encountered the issue of the /DietPi/ folder being empty after a reboot. The SD card was also read only. I tested this by simply doing

touch /etc/samba/smb.conf

as this was one of the files i knew was still there. Seeing it was read only i did

mount -o remount, rw /

This made me able to edit files again. After this came the problem of not having any dietpi-drive_manager or any of those. I did download them manually but dont do that. I did wget to get them.

wget https://raw.githubusercontent.com/MichaIng/DietPi/master/dietpi/dietpi-drive_mana           ger -O /DietPi/dietpi/dietpi-drive_manager

then manually ran it with

. /DietPi/dietpi/dietpi-_drive_manager

then ran

. /DietPi/dietpi/dietpi-drive_manager 4

but that cleared out everything I had manually downloaded in the /DietPi folder
the problem apparently was in fstab. there was an issue with the mounting of the boot partition. Potentially linked to dietpi-drive_manager and unmounting of an external harddrive

So the first thing I did was remove x-systemd.automount because some part of the internet hinted me to it. rebooted and it was still borked. Next what actually fixed it was turning it from this

#----------------------------------------------------------------
# PHYSICAL DRIVES
#----------------------------------------------------------------
PARTUUID=xxxxxxf7-02 / ext4 noatime,lazytime,rw 0 1
UUID=xxx1-xxxB /media/root/boot vfat noatime,lazytime,rw,nofail,noauto,x-systemd.automount

into this

#----------------------------------------------------------------
# PHYSICAL DRIVES
#----------------------------------------------------------------
PARTUUID=xxxxxxf7-02 / ext4 noatime,lazytime,rw 0 1
UUID=xxx1-xxxB /boot vfat noatime,lazytime,rw 0 2

Meaning i removed /media/root/boot and made it only /boot, also copied the top row to look like the bottom row. this was because i based this of another fstab from another one of my servers. After this I rebooted and was greeted by the good old dietpi loginscreen. and fstab was back to nromal like below

#----------------------------------------------------------------
# PHYSICAL DRIVES
#----------------------------------------------------------------
PARTUUID=xxxxxxf7-02 / ext4 noatime,lazytime,rw 0 1
PARTUUID=xxxxxxf7-01 /boot vfat noatime,lazytime,rw 0 2



I dont know what caused it, I think everything went to shit when I was unable to unmount an ext hdd and I just shut the pi down and unplugged instead. No boot stuff was related to the drive afaik.

Happened to me as well now, not really sure why =(

root@mainframe:~# mkdir test
mkdir: cannot create directory ‘test’: Read-only file system

[✗] Update local cache of available packages
Error: Unable to update package cache. Please try “sudo apt update”

After reboot:

's password:

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
-bash: /boot/dietpi/func/dietpi-globals: No such file or directory
[FAILED] DietPi-Login | Failed to load DietPi-Globals. Skipping DietPi login scripts…

everything seems messed up and all I did was shutdown -h now and when the system booted up, this was why i got. I recently upgraded to 8.0 and before that everything was running fine for 15 weeks. Now gotta re-format the card and setup the system again =(

Unfortunately it is not that uncommon that an SD card is dying. One of the downsides of psychical device (SD cards). Such data corruption usually happen on heavy I/O operation like apt package updates or if you hosting applications that download constantly stuff, causing I/O operation.

Theoretically you could have tried to check on file system errors on your SD card.