DietPi Broken

Having issues with your DietPi installation, or, found a bug? Post it here.
thekevinkalis
Posts: 1
Joined: Wed Apr 03, 2019 8:19 pm

DietPi Broken

Post by thekevinkalis »

Hi all, I've just removed my SD card to make an image backup and upon restarting my setup, I get this error.

-bash: /DietPi/dietpi/func/dietpi-globals: No such file or directory
grep: /DietPi/dietpi.txt: No such file or directory
-bash: /DietPi/dietpi/dietpi-login: No such file or directory

I'm running an Odroid C2, with DietPi base and Home Assistant installed.

Hoping someone can help me with this, as I made quite a few changes since my last backup (only 3 days ago) :cry:
User avatar
MichaIng
Site Admin
Posts: 2293
Joined: Sat Nov 18, 2017 6:21 pm

Re: DietPi Broken

Post by MichaIng »

@thekevinkalis
Sorry for the late reply, especially since your critical issue.

Is this still an issue?

DietPi-RAMdisk obviously failed to start. Ways to debug:

Code: Select all

journalctl -u dietpi-ramdisk
cat /var/tmp/dietpi/logs/dietpi-ramdisk.log
Seferi
Posts: 10
Joined: Mon Sep 23, 2019 4:07 pm

Re: DietPi Broken

Post by Seferi »

Hi, this is what I'm getting and really dont know how to fix it. I appreciate the help:

Code: Select all

   -- Logs begin at Wed 2019-10-16 10:28:41 CEST, end at Wed 2019-10-16 10:32:53 CEST. --
Oct 16 10:28:45 DietPi systemd[1]: Starting DietPi-RAMdisk...
Oct 16 10:28:45 DietPi dash[221]: /bin/dash: 1: /boot/dietpi/func/dietpi-ramdisk: Exec format error
Oct 16 10:28:45 DietPi systemd[1]: diet
pi-ramdisk.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Oct 16 10:28:45 DietPi systemd[1]: diet
pi-ramdisk.service: Failed with result 'exit-code'.
Oct 16 10:28:45 DietPi systemd[1]: Fail
ed to start DietPi-RAMdisk.  
User avatar
MichaIng
Site Admin
Posts: 2293
Joined: Sat Nov 18, 2017 6:21 pm

Re: DietPi Broken

Post by MichaIng »

@Seferi
"Exec format error", a wrong dash binary or broken script?

Please try dash -c 'echo success' from console? If it fails as well, please try:
apt install --reinstall dash

If dash works well without reinstall, then try to redownload the script and execute it:

Code: Select all

wget https://raw.githubusercontent.com/MichaIng/DietPi/master/dietpi/func/dietpi-ramdisk -O /boot/dietpi/func/dietpi-ramdisk
chmod +x /boot/dietpi/func/dietpi-ramdisk
/boot/dietpi/func/dietpi-ramdisk 0
If this works well now, please try to start the service: systemctl start dietpi-ramdisk
Verify via tail -1 /var/tmp/dietpi/logs/dietpi-ramdisk.log.
If this works as well, please reboot.
Seferi
Posts: 10
Joined: Mon Sep 23, 2019 4:07 pm

Re: DietPi Broken

Post by Seferi »

Thanks for replying mate. Dash gives success. I downloaded the script.

Code: Select all

/boot/dietpi/func/dietpi-ramdisk 0


Gives:

Code: Select all

Wed Oct 16 14:01:11 CEST 2019 | DietPi-RAMdisk: Copying DietPi to RAM...
Wed Oct 16 14:01:11 CEST 2019 | DietPi-RAMdisk: DietPi is already in RAM. Aborting...

Code: Select all

sudo tail -1 /var/tmp/dietpi/logs/dietpi-ramdisk.log

Gives:

Code: Select all

Wed 16 Oct 13:47:31 CEST 2019 | DietPi-RAMdisk: Copied DietPi to RAM.
After reboot I'm getting:

Code: Select all

-bash: .: /DietPi/dietpi/func/dietpi-globals: cannot execute binary file
[FAILED] DietPi-Login | Failed to load DietPi-Globals. Skipping DietPi login scripts...
User avatar
MichaIng
Site Admin
Posts: 2293
Joined: Sat Nov 18, 2017 6:21 pm

Re: DietPi Broken

Post by MichaIng »

@Seferi
Very strange, could you paste: ls -Al /boot/dietpi /DietPi/dietpi
Seferi
Posts: 10
Joined: Mon Sep 23, 2019 4:07 pm

Re: DietPi Broken

Post by Seferi »

Code: Select all

  /DietPi/dietpi:
total 1024
-rwxr-xr-x 1 root root     21 Oct 16 13:47 .dietpi-led_control
-rwxr-xr-x 1 root root    578 Oct 16 13:47 .dietpi-services_include_exclude
-rwxr-xr-x 1 root root    194 Oct 16 13:47 .hw_model
-rwxr-xr-x 1 root root      2 Oct 16 13:47 .install_stage
-rwxr-xr-x 1 root root   5735 Oct 16 13:47 .installed
-rwxr-xr-x 1 root root     57 Oct 16 13:47 .network
-rwxr-xr-x 1 root root     16 Oct 16 13:47 .prep_info
-rwxr-xr-x 1 root root    125 Oct 16 13:47 .version
-rwxr-xr-x 1 root root   5275 Oct 16 13:47 boot
-rwxr-xr-x 1 root root   8676 Oct 16 13:47 dietpi-autostart
-rwxr-xr-x 1 root root  18772 Oct 16 13:47 dietpi-backup
-rwxr-xr-x 1 root root   6938 Oct 16 13:47 dietpi-bugreport
-rwxr-xr-x 1 root root  15393 Oct 16 13:47 dietpi-cleaner
-rwxr-xr-x 1 root root  44859 Oct 16 13:47 dietpi-cloudshell
-rwxr-xr-x 1 root root 135880 Oct 16 13:47 dietpi-config
-rwxr-xr-x 1 root root   5256 Oct 16 13:47 dietpi-cpuinfo
-rwxr-xr-x 1 root root   8030 Oct 16 13:47 dietpi-cron
-rwxr-xr-x 1 root root  64663 Oct 16 13:47 dietpi-drive_manager-rwxr-xr-x 1 root root   7874 Oct 16 13:47 dietpi-explorer
-rwxr-xr-x 1 root root   4121 Oct 16 13:47 dietpi-launcher
-rwxr-xr-x 1 root root  21362 Oct 16 13:47 dietpi-letsencrypt
-rwxr-xr-x 1 root root   7988 Oct 16 13:47 dietpi-login
-rwxr-xr-x 1 root root   7672 Oct 16 13:47 dietpi-morsecode
-rwxr-xr-x 1 root root  37483 Oct 16 13:47 dietpi-services
-rwxr-xr-x 1 root root 520984 Oct 16 13:47 dietpi-software
-rwxr-xr-x 1 root root   6779 Oct 16 13:47 dietpi-survey
-rwxr-xr-x 1 root root  16939 Oct 16 13:47 dietpi-sync
-rwxr-xr-x 1 root root  16703 Oct 16 13:47 dietpi-update
drwxr-xr-x 2 root root    420 Oct 16 13:47 func
drwxr-xr-x 2 root root    120 Oct 16 13:47 misc
-rwxr-xr-x 1 root root   1675 Oct 16 13:47 postboot
-rwxr-xr-x 1 root root   1454 Oct 16 13:47 preboot

/boot/dietpi:
total 961
-rwxr-xr-x 1 root root     21 Oct 15 10:39 .dietpi-led_control
-rwxr-xr-x 1 root root    578 Oct 15 10:39 .dietpi-services_include_exclude
-rwxr-xr-x 1 root root    194 Oct 15 10:39 .hw_model
-rwxr-xr-x 1 root root      2 Oct 15 10:39 .install_stage
-rwxr-xr-x 1 root root   5735 Oct 15 10:39 .installed
-rwxr-xr-x 1 root root     57 Oct 15 10:39 .network
-rwxr-xr-x 1 root root     16 Oct 15 10:39 .prep_info
-rwxr-xr-x 1 root root    125 Oct 15 10:39 .version
-rwxr-xr-x 1 root root   5275 Oct 15 10:39 boot
-rwxr-xr-x 1 root root   8676 Oct 15 10:39 dietpi-autostart
-rwxr-xr-x 1 root root  18772 Oct 15 10:39 dietpi-backup
-rwxr-xr-x 1 root root   6938 Oct 15 10:39 dietpi-bugreport
-rwxr-xr-x 1 root root  15393 Oct 15 10:39 dietpi-cleaner
-rwxr-xr-x 1 root root  44859 Oct 15 10:39 dietpi-cloudshell
-rwxr-xr-x 1 root root 135880 Oct 15 10:39 dietpi-config
-rwxr-xr-x 1 root root   5256 Oct 15 10:39 dietpi-cpuinfo
-rwxr-xr-x 1 root root   8030 Oct 15 10:39 dietpi-cron
-rwxr-xr-x 1 root root  64663 Oct 15 10:39 dietpi-drive_manager-rwxr-xr-x 1 root root   7874 Oct 15 10:39 dietpi-explorer
-rwxr-xr-x 1 root root   4121 Oct 15 10:39 dietpi-launcher
-rwxr-xr-x 1 root root  21362 Oct 15 10:39 dietpi-letsencrypt
-rwxr-xr-x 1 root root   7988 Oct 15 10:39 dietpi-login
-rwxr-xr-x 1 root root   7672 Oct 15 10:39 dietpi-morsecode
-rwxr-xr-x 1 root root  37483 Oct 15 10:39 dietpi-services
-rwxr-xr-x 1 root root 520984 Oct 15 10:39 dietpi-software
-rwxr-xr-x 1 root root   6779 Oct 15 10:39 dietpi-survey
-rwxr-xr-x 1 root root  16939 Oct 15 10:39 dietpi-sync
-rwxr-xr-x 1 root root  16703 Oct 15 10:39 dietpi-update
drwxr-xr-x 2 root root   2048 Jul 14 17:34 func
drwxr-xr-x 2 root root    512 Jul 14 17:34 misc
-rwxr-xr-x 1 root root   1675 Oct 15 10:39 postboot
-rwxr-xr-x 1 root root   1454 Oct 15 10:39 preboot 
Seferi
Posts: 10
Joined: Mon Sep 23, 2019 4:07 pm

Re: DietPi Broken

Post by Seferi »

Should I install dietpi and pihole again from scratch?
User avatar
MichaIng
Site Admin
Posts: 2293
Joined: Sat Nov 18, 2017 6:21 pm

Re: DietPi Broken

Post by MichaIng »

@Seferi
Not required so far, although it looks like some data corruption if bash sees our globals script as binary... It is a plain text bash script.
However RAMdisk HAS indeed been loaded and at least the main script meta data look fine.

Which DietPi version do you use? I guess v6.25?
If so please try the following to have all together updated to v6.26 and hopefully fixed:

Code: Select all

wget https://raw.githubusercontent.com/MichaIng/DietPi/2aa9cf03cbf10dfc26d5d6bbde2a1fbaf23d0f28/dietpi/func/dietpi-globals -O /DietPi/dietpi/func/dietpi-globals
. /DietPi/dietpi/func/dietpi-globals
dietpi-update 1
Seferi
Posts: 10
Joined: Mon Sep 23, 2019 4:07 pm

Re: DietPi Broken

Post by Seferi »

Thanks mate. I updated as you described and after reboot I'm getting:

Code: Select all

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