Unable to boot into DietPi | Failed to load DietPi-Globals

I was unable to unmount a USB drive so I issued a reboot command to my Pi4 running DietPi. Now when I try booting I receive the error

[FAILED] DietPi-Login | Failed to load DietPi-Globals. Skipping DietPi login scripts...

While trying to troubleshoot I stumbled upon someone a few years ago who had the same issues as I am having. DietPi-Login | Failed to load DietPi-Globals

I receive the following info from the troubleshooting commands mentioned in the other thread

root@Pi-Hole4:~# systemctl status DietPi.mount
Unit DietPi.mount could not be found.



root@Pi-Hole4:~# tail /var/tmp/dietpi/logs/dietpi-ramdisk.log
Fri 17 Apr 12:14:02 CDT 2020 | DietPi-RAMdisk: Storing DietPi to disk…
Fri 17 Apr 12:14:02 CDT 2020 | DietPi-RAMdisk: Stored DietPi to disk.
Fri 17 Apr 12:14:03 CDT 2020 | DietPi-RAMdisk: Copying DietPi to RAM…
Fri 17 Apr 12:14:03 CDT 2020 | DietPi-RAMdisk: Copied DietPi to RAM.
Fri 24 Apr 00:17:02 CDT 2020 | DietPi-RAMdisk: Copying DietPi to RAM…
Fri 24 Apr 00:17:02 CDT 2020 | DietPi-RAMdisk: Copied DietPi to RAM.
Fri 1 May 16:56:02 CDT 2020 | DietPi-RAMdisk: Storing DietPi to disk…
Fri 1 May 16:56:02 CDT 2020 | DietPi-RAMdisk: Stored DietPi to disk.
Fri 1 May 16:56:03 CDT 2020 | DietPi-RAMdisk: Copying DietPi to RAM…
Fri 1 May 16:56:03 CDT 2020 | DietPi-RAMdisk: Copied DietPi to RAM.

I have attached the results of dmesg.

When I try to run “fsck -f /dev/mmcblk0p2” I get

root@Pi-Hole4:~# fsck -f /dev/mmcblk0p2
fsck from util-linux 2.33.1
e2fsck 1.44.5 (15-Dec-2018)
/dev/mmcblk0p2 is mounted.
e2fsck: Cannot continue, aborting.

Here the the results of lsblk -f

NAME FSTYPE LABEL UUID FSAVAIL FSUSE% MOUNTPOINT
mmcblk0
├─mmcblk0p1 vfat boot 5203-DB74
└─mmcblk0p2 ext4 rootfs 2ab3f8e1-7dc6-43f5-b0db-dd5759d51d4e 5.6G 76% /

My backup is over a year old so it I can save the system instead of restoring from the last DietPi backup that would be great. Thank you in advance for any help with this. If you need more information from me please let me know.
fstab.txt (1.28 KB)
DietPiBootError.txt (18.8 KB)

Hi,

you can place your SD card into another Linux box (if possible) and rerun fsck. This way you can check the partition without being mounted.

As well can you post ls -la /boot/dietpi/func/

Sorry about the delay in response.

Here is what happens when I run the ls command

root@Pi-Hole4:~# ls -la /boot/dietpi/func/
ls: cannot access ‘/boot/dietpi/func/’: No such file or directory

It looks like the whole boot directory is empty.

I have attached the fsck results. The first time I ran the command it fixed a few errors, however when saving the output the live distro froze up on me and I lost the file.
fsck Results.txt (836 Bytes)

hope there are not more data lost :thinking:

let’s check missing DietPi folder

ls -la /
ls -la /boot
ls -la /boot/dietpi

Here is the results of those three commands

root@Pi-Hole4:~# ls -la /
total 76
drwxr-xr-x 21 root root 4096 Apr 13 14:26 .
drwxr-xr-x 21 root root 4096 Apr 13 14:26 …
drwxr-xr-x 2 root root 4096 Apr 12 12:29 bin
drwxr-xr-x 2 root root 4096 Sep 25 2019 boot
drwxr-xr-x 15 root root 3440 Apr 13 14:30 dev
lrwxrwxrwx 1 root root 5 May 6 2020 DietPi → /boot
drwxr-xr-x 75 root root 4096 Apr 13 14:30 etc
drwxr-xr-x 3 root root 4096 Jan 7 2020 home
drwxr-xr-x 17 root root 4096 Apr 1 2020 lib
drwx------ 2 root root 16384 Sep 25 2019 lost+found
drwxr-xr-x 2 root root 4096 Jul 6 2020 media
drwxr-xr-x 9 root root 4096 Apr 13 14:24 mnt
drwxr-xr-x 5 root root 4096 Apr 7 2020 opt
dr-xr-xr-x 145 root root 0 Dec 31 1969 proc
drwx------ 7 root root 4096 Apr 13 14:30 root
drwxr-xr-x 19 root root 600 Apr 13 14:38 run
drwxr-xr-x 2 root root 4096 Apr 12 12:30 sbin
drwxr-xr-x 2 root root 4096 Jan 7 2020 srv
dr-xr-xr-x 12 root root 0 Dec 31 1969 sys
drwxrwxrwt 7 root root 140 Apr 13 14:30 tmp
drwxr-xr-x 10 root root 4096 Jan 7 2020 usr
drwxr-xr-x 12 root root 4096 Mar 31 2020 var
root@Pi-Hole4:~# ls -la /boot
total 8
drwxr-xr-x 2 root root 4096 Sep 25 2019 .
drwxr-xr-x 21 root root 4096 Apr 13 14:26 …
root@Pi-Hole4:~# ls -la /boot/dietpi
ls: cannot access ‘/boot/dietpi’: No such file or directory
root@Pi-Hole4:~#

I have also attached an updated dmesg. Thank you for your assistance.

If this is a lost cause I can work on rebuilding the system. While it wont be fun it is possible. It is my own fault for not keeping my backups up to date on this device.
dmesg.txt (18.8 KB)

hmm that’s strange. It seems your /boot folder is completely empty and bootFS not being mounted correctly. Usually your system should not boot that way :thinking:

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

probably issue is on your fstab as it is missing the part for RootFS and BootFS. Can you share cat /etc/fstab. As well can you share fstab from your backup

Sure! Unfortunately I had to leave my house to run to my parents to help them with something. I’ll post a reply in a few hours with the requested information. I apologize about the delay and really appreciate all of your assistance.

no hurry, it’s 1am at my side. will end up my day for now :slight_smile:

Sorry again about the delayed response. I hope you’re getting some rest now, it sounds like it is pretty late where you are! I think this is all of the information you want. If there is more information you need please let me know and I will gladly post it. I really appreciate all of your help, thank you so much!

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

root@Pi-Hole4:~# lsblk -o name,fstype,label,size,ro,type,mountpoint,partuuid,uuid
NAME        FSTYPE LABEL   SIZE RO TYPE MOUNTPOINT PARTUUID                             UUID
mmcblk0                   28.9G  0 disk                                                 
├─mmcblk0p1 vfat   boot    256M  0 part            6c586e13-01                          5203-DB74
└─mmcblk0p2 ext4   rootfs 28.6G  0 part /          6c586e13-02                          2ab3f8e1-7dc6-43f5-b0db-dd5759d51d4e

cat /etc/fstab

root@Pi-Hole4:~# cat /etc/fstab
# You can use "dietpi-drive_manager" to setup mounts.
# NB: It overwrites and re-creates physical drive mount entries on use.
#----------------------------------------------------------------
# NETWORK
#----------------------------------------------------------------


#----------------------------------------------------------------
# TMPFS
#----------------------------------------------------------------
tmpfs /tmp tmpfs size=1024M,noatime,lazytime,nodev,nosuid,mode=1777
tmpfs /var/log tmpfs size=50M,noatime,lazytime,nodev,nosuid,mode=1777

#----------------------------------------------------------------
# MISC: ecryptfs, vboxsf (VirtualBox shared folder), gluster, bind mounts
#----------------------------------------------------------------


#----------------------------------------------------------------
# SWAPFILE
#----------------------------------------------------------------
/var/swap none swap sw 0 0

#----------------------------------------------------------------
# PHYSICAL DRIVES
#----------------------------------------------------------------
#UUID=5203-DB74 /mnt/5203-DB74 vfat noatime,lazytime,rw,nofail,noauto,x-systemd.automount
#UUID=2ab3f8e1-7dc6-43f5-b0db-dd5759d51d4e /mnt/2ab3f8e1-7dc6-43f5-b0db-dd5759d51d4e ext4 noatime,lazytime,rw,nofail,noauto,x-systemd.automount

As well can you share fstab from your backup

root@Pi-Hole4:/mnt/dietpi-backup/data/etc# cat fstab
# Please use "dietpi-drive_manager" to setup mounts
#----------------------------------------------------------------
# NETWORK
#----------------------------------------------------------------


#----------------------------------------------------------------
# TMPFS
#----------------------------------------------------------------
tmpfs /tmp tmpfs size=1024M,noatime,lazytime,nodev,nosuid,mode=1777

#----------------------------------------------------------------
# MISC: ecryptfs, vboxsf (VirtualBox shared folder), bind mounts
#----------------------------------------------------------------


#----------------------------------------------------------------
# SWAPFILE
#----------------------------------------------------------------


#----------------------------------------------------------------
# PHYSICAL DRIVES
#----------------------------------------------------------------
PARTUUID=6c586e13-02 / ext4 noatime,lazytime,rw 0 1
PARTUUID=6c586e13-01 /boot vfat noatime,lazytime,rw 0 2
/var/swap none swap sw 0 0
tmpfs /var/log tmpfs size=50M,noatime,lazytime,nodev,nosuid,mode=1777

ok you are missing 2 lines in your current fstab.

pls can you add the following at the end of the file into PHYSICAL DRIVES section and do a reboot

PARTUUID=6c586e13-02 / ext4 noatime,lazytime,rw 0 1
PARTUUID=6c586e13-01 /boot vfat noatime,lazytime,rw 0 2

You, my friend, are a genius. Everything is working now. I am going to start a new backup in a few minutes.
The only issue I ran into was fstab was not able to be written to at first because the partition was in read only mode. I fixed that using the command

mount / -o remount,rw

and was able to append your two lines.

Thank you again for all of the assistance. I really appreciate it.

can you do a reboot and verify all is working, including to be able to write to RootFS as well as BootFS. Usually r/o file systems indicates issues on the SD card

I feel silly asking this however I have very little Linux knowledge. Do I do this by making sure I can write a file to the root directory and the boot directory? If so, then I think everything is working. I was able to write a file “test.txt” to root and boot.

To make sure I am explaining everything correctly I have attached a screenshot.

yes that’s basically right way. But it could be way simpler :wink:

touch /test.file
touch /boot/test.file

touch will create the file right away and it is not needed to use nano

Ah, very nice. Thanks :slight_smile:
Ya, I just used Nano to make a test file at what I assumed each location would be. I have a few decades of Windows and Networking experience and am currently patching a 22 host VMware environment as I write this so I am not a complete tech noob… Just a noob when it comes to things I do not have experience with, like Linux :smiley:

I was start supporting this project with just little knowledge on these thinks but it’s growing over time, the more you look into it. And not to forget my best friend Google :rofl:

Google is my best friend as well. It is how I found out about the mount / -o remount,rw command I mentioned earlier. I also did quite a bit of Google-fu before opening up this thread.

yeah at the end we found it :slight_smile:
good you are back online now