DietPi folder empty

Hi guys,

I use DietPi on my rpi 3 a few days. It’s amazing!! Today i noticed that my DietPi folder in the root is empty.
The pi still working (Emby is installed on it) and after a reboot everhing seems to be normal. What can I do to recover the DietPi folder?

I noticed it after a reboot (see attachement)
I was on the latest version. I have a boot.bak folder with a full DietPi folder (before an update?).

Thx for tips!
Knipsel.JPG

Sounds like RPi bootloader upgrade is messing with the /boot folder

Whats the results of:

ls -lha /boot
ls -lha /boot.bak # Assuming thats the location of the backed up folder

Hi, this is the output:root@VanDerMedMan:~# ls -lha /boot
total 22M
drwxr-xr-x 4 root root 16K Jan 1 1970 .
drwxr-xr-x 21 root root 4.0K Dec 26 19:52 …
-rwxr-xr-x 1 root root 41 Dec 26 19:53 .firmware_revision
-rwxr-xr-x 1 root root 19K Dec 26 18:20 COPYING.linux
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0000.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0001.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0002.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0003.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0004.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0005.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0006.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0007.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0008.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0009.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0010.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0011.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0012.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0013.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0014.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0015.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0016.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0017.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0018.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0019.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0020.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0021.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0022.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0023.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0024.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0025.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0026.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0027.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0028.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0029.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0030.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0031.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0032.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0033.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0034.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0035.REC
-rwxr-xr-x 1 root root 24K Jan 1 1980 FSCK0036.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0037.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0038.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0039.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0040.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0041.REC
-rwxr-xr-x 1 root root 16K Jan 1 1980 FSCK0042.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0043.REC
-rwxr-xr-x 1 root root 336K Jan 1 1980 FSCK0044.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0045.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0046.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0047.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0048.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0049.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0050.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0051.REC
-rwxr-xr-x 1 root root 24K Jan 1 1980 FSCK0052.REC
-rwxr-xr-x 1 root root 48K Jan 1 1980 FSCK0053.REC
-rwxr-xr-x 1 root root 136K Jan 1 1980 FSCK0054.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0055.REC
-rwxr-xr-x 1 root root 24K Jan 1 1980 FSCK0056.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0057.REC
-rwxr-xr-x 1 root root 16K Jan 1 1980 FSCK0058.REC
-rwxr-xr-x 1 root root 16K Jan 1 1980 FSCK0059.REC
-rwxr-xr-x 1 root root 16K Jan 1 1980 FSCK0060.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0061.REC
-rwxr-xr-x 1 root root 16K Jan 1 1980 FSCK0062.REC
-rwxr-xr-x 1 root root 40K Jan 1 1980 FSCK0063.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0064.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0065.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0066.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0067.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0068.REC
-rwxr-xr-x 1 root root 24K Jan 1 1980 FSCK0069.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0070.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0071.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0072.REC
-rwxr-xr-x 1 root root 16K Jan 1 1980 FSCK0073.REC
-rwxr-xr-x 1 root root 16K Jan 1 1980 FSCK0074.REC
-rwxr-xr-x 1 root root 16K Jan 1 1980 FSCK0075.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0076.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0077.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0078.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0079.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0080.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0081.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0082.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0083.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0084.REC
-rwxr-xr-x 1 root root 40K Jan 1 1980 FSCK0085.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0086.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0087.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0088.REC
-rwxr-xr-x 1 root root 16K Jan 1 1980 FSCK0089.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0090.REC
-rwxr-xr-x 1 root root 8.0K Jan 1 1980 FSCK0091.REC
-rwxr-xr-x 1 root root 1.5K Dec 26 18:24 LICENCE.broadcom
-rwxr-xr-x 1 root root 19K Sep 23 15:53 LICENSE.oracle
-rwxr-xr-x 1 root root 6.5K Nov 1 17:50 README.md
drwxr-xr-x 2 root root 8.0K Dec 26 18:43 System Volume Information
-rwxr-xr-x 1 root root 14K Dec 26 19:53 bcm2708-rpi-b-plus.dtb
-rwxr-xr-x 1 root root 14K Dec 26 19:53 bcm2708-rpi-b.dtb
-rwxr-xr-x 1 root root 14K Dec 26 19:53 bcm2708-rpi-cm.dtb
-rwxr-xr-x 1 root root 15K Dec 26 19:53 bcm2709-rpi-2-b.dtb
-rwxr-xr-x 1 root root 16K Dec 26 19:53 bcm2710-rpi-3-b.dtb
-rwxr-xr-x 1 root root 15K Dec 26 19:53 bcm2710-rpi-cm3.dtb
-rwxr-xr-x 1 root root 18K Dec 26 19:52 bootcode.bin
-rwxr-xr-x 1 root root 136 Dec 26 18:28 cmdline.txt
-rwxr-xr-x 1 root root 2.1K Jan 3 20:36 config.txt
-rwxr-xr-x 1 root root 8.8K Jan 3 20:36 dietpi.txt
-rwxr-xr-x 1 root root 6.5K Dec 26 19:52 fixup.dat
-rwxr-xr-x 1 root root 2.5K Dec 26 19:52 fixup_cd.dat
-rwxr-xr-x 1 root root 9.6K Dec 26 19:52 fixup_db.dat
-rwxr-xr-x 1 root root 9.6K Dec 26 19:52 fixup_x.dat
-rwxr-xr-x 1 root root 145 Sep 23 15:53 issue.txt
-rwxr-xr-x 1 root root 4.0M Dec 26 19:53 kernel.img
-rwxr-xr-x 1 root root 4.1M Dec 26 19:52 kernel7.img
drwxr-xr-x 2 root root 8.0K Dec 26 18:24 overlays
-rwxr-xr-x 1 root root 2.7M Dec 26 19:52 start.elf
-rwxr-xr-x 1 root root 620K Dec 26 19:52 start_cd.elf
-rwxr-xr-x 1 root root 4.8M Dec 26 19:52 start_db.elf
-rwxr-xr-x 1 root root 3.8M Dec 26 19:52 start_x.elf

root@VanDerMedMan:~# ls -lha /boot.bak
total 20M
drwxr-xr-x 5 root root 4.0K Dec 26 18:28 .
drwxr-xr-x 21 root root 4.0K Dec 26 19:52 …
-rwxr-xr-x 1 root root 19K Dec 26 18:20 COPYING.linux
-rwxr-xr-x 1 root root 1.5K Dec 26 18:24 LICENCE.broadcom
-rwxr-xr-x 1 root root 19K Sep 23 15:53 LICENSE.oracle
-rwxr-xr-x 1 root root 6.5K Nov 1 17:50 README.md
drwxr-xr-x 2 root root 4.0K Dec 26 18:43 System Volume Information
-rwxr-xr-x 1 root root 14K Dec 26 18:20 bcm2708-rpi-b-plus.dtb
-rwxr-xr-x 1 root root 14K Dec 26 18:20 bcm2708-rpi-b.dtb
-rwxr-xr-x 1 root root 14K Dec 26 18:20 bcm2708-rpi-cm.dtb
-rwxr-xr-x 1 root root 15K Dec 26 18:20 bcm2709-rpi-2-b.dtb
-rwxr-xr-x 1 root root 16K Dec 26 18:20 bcm2710-rpi-3-b.dtb
-rwxr-xr-x 1 root root 15K Dec 26 18:20 bcm2710-rpi-cm3.dtb
-rwxr-xr-x 1 root root 18K Dec 26 18:24 bootcode.bin
-rwxr-xr-x 1 root root 136 Dec 26 18:28 cmdline.txt
-rwxr-xr-x 1 root root 2.0K Dec 26 17:57 config.txt
drwxr-xr-x 5 root root 4.0K Dec 26 17:57 dietpi
-rwxr-xr-x 1 root root 8.8K Dec 26 17:57 dietpi.txt
-rwxr-xr-x 1 root root 6.5K Dec 26 18:24 fixup.dat
-rwxr-xr-x 1 root root 2.5K Dec 26 18:24 fixup_cd.dat
-rwxr-xr-x 1 root root 9.6K Dec 26 18:24 fixup_db.dat
-rwxr-xr-x 1 root root 9.6K Dec 26 18:24 fixup_x.dat
-rwxr-xr-x 1 root root 145 Sep 23 15:53 issue.txt
-rwxr-xr-x 1 root root 4.0M Dec 26 18:20 kernel.img
-rwxr-xr-x 1 root root 4.1M Dec 26 18:20 kernel7.img
drwxr-xr-x 2 root root 4.0K Dec 26 18:24 overlays
-rwxr-xr-x 1 root root 2.7M Dec 26 18:24 start.elf
-rwxr-xr-x 1 root root 620K Dec 26 18:24 start_cd.elf
-rwxr-xr-x 1 root root 4.8M Dec 26 18:24 start_db.elf
-rwxr-xr-x 1 root root 3.8M Dec 26 18:24 start_x.elf

I tried to copy the content of /boot.bak/dietpi to /DietPi but after a reboot everything in DietPi folder is gone again.
If I copy the content and try first the dietp-config command before a reboot I get a permission error.

Hi Bernie,

FSCK0048.REC

This looks like a filesystem repair occurred. Possibility unstable PSU. Which SD card and PSU are you running at the moment?
Any power cuts your aware of?

tried to copy the content of /boot.bak/dietpi to /DietPi but after a reboot everything in DietPi folder is gone again.
If I copy the content and try first the dietp-config command before a reboot I get a permission error.

We should be able to recover it, but as above, I believe PSU/SD may be the fault here, and it may reoccur.

Bernie,

To restore the backed up bootfs:

rm -R /boot/*
rm -R /DietPi/*
cp -R /boot.bak/* /boot/
cp -R /boot.bak/* /DietPi/
reboot

The SD card is new (10 days old) and there was no power failure. I have an official rpi power unit. (2,5A on 5,1V).

Thx for the lines! I will try this tomorrow and let you know how it was.

Regards!

I tried it first with the DietPi folder to test and get this:

cp -R /boot.bak/* /DietPi/

cp: error writing ‘/DietPi/start.elf’: No space left on device
cp: failed to extend ‘/DietPi/start.elf’: No space left on device
cp: error writing ‘/DietPi/start_cd.elf’: No space left on device
cp: failed to extend ‘/DietPi/start_cd.elf’: No space left on device
cp: error writing ‘/DietPi/start_db.elf’: No space left on device
cp: failed to extend ‘/DietPi/start_db.elf’: No space left on device
cp: error writing ‘/DietPi/start_x.elf’: No space left on device
cp: failed to extend ‘/DietPi/start_x.elf’: No space left on device

The sd card is 64 gb size.

df -Bm gives me

Filesystem 1M-blocks Used Available Use% Mounted o n
/dev/root 59887M 6986M 51056M 13% /

Hi Bernie,


Ah yes, we are copying some files we dont need and filling up the 10MB limit on RAMdisk. Please try this:

rm -R /boot/*
rm -R /DietPi/*
cp -R /boot.bak/* /boot/

cp /boot.bak/config.txt /DietPi/
cp /boot.bak/dietpi.txt /DietPi/
cp /boot.bak/cmdline.txt /DietPi/
cp -R /boot.bak/dietpi /DietPi/

reboot

Thanks Bernie,

Which SD card brand and model are you using? (eg: Sandisk ultra 8GB)?

This is my type of sdcard: Transcend 64GB microSD Premium 400x Class 10 UHS-I

Yes!!! DietPi is repaired. Thx a lot. After reboot It needed to be updated to the latest version.

I only have still these warnings at startup:

-bash: warning: setlocale: LC_ALL: cannot change locale (0.UTF-8)
-bash: warning: setlocale: LC_ALL: cannot change locale (0.UTF-8)
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (0.UTF-8)
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (0.UTF-8)
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (0.UTF-8)

Is there something to do on it?

@Fourdee: Thx for the great assistance! Please send me the PayPal adres to support your project, with the link in the sig I can’t use PayPal for some reason.

Hi Bernie,

I’ve experienced consistent IO failures with Transcend’s cards, on various devices during DietPi testing over the years, i personally wouldn’t recommend them for stability.
With the FSCK recovery and official PSU, i believe unstable SD card is to blame.

I’d highly recommend Sandisk, any model, they have proven to me over the years (they take a hammering) that they are fully stable and reliable.

bash: warning: setlocale: LC_ALL: cannot change locale (0.UTF-8)

I’ve seen this before, think we may have a solution on forums, let me find and link it.

PayPal link worked now. Check your PayPal :wink:

Bernie,

Found it: http://dietpi.com/phpbb/viewtopic.php?f=11&t=970&start=10&hilit=cannot+change+locale

Try:

rm /etc/environment

Then run:

dpkg-reconfigure locales

Make sure [*] en_GB.UTF-8 UTF-8[/color] is ticked (space bar).
Enter
Select en_GB.UTF-8 as default
Enter

Reboot system and check if issue is resolved

Thanks Bernie, really appreciate it.
I actually need to order some more Sandisk SD cards (6 isnt enough for 20+ devices and testing lol) , so will be put to good use :smiley:

Thank you.

:smiley:

I’m from Belgium, so does this matter for the selection? Time zone Belgium = UTC +1

Hi all!

Similar problem to Bernie’s (empty /DietPi), except I don’t have /boot.bak.

root@jpi:/# ls
bin   dev     etc  lost+found  opt   root  sbin  sys  usr
boot  DietPi  lib  mnt         proc  run   srv   tmp  var

But /boot/dietpi seems to contain something:

root@jpi:/# ls /boot/dietpi
boot               dietpi-config         dietpi-logclear         dietpi-survey
conf               dietpi-cpuinfo        dietpi-morsecode        dietpi-sync
dietpi-autostart   dietpi-cpu_set        dietpi-obtain_hw_model  dietpi-update
dietpi-backup      dietpi-cron           dietpi-process_tool     finalise
dietpi-banner      dietpi-drive_manager  dietpi-ramdisk          func
dietpi-bugreport   dietpi-funtime        dietpi-ramlog           login
dietpi-cleaner     dietpi-launcher       dietpi-services         misc
dietpi-cloudshell  dietpi-letsencrypt    dietpi-software

How should I go on to restore my /DietPi folder?

Hi,

We’ll need to check the status of the DietPi-RAMdisk service to see why it failed:

systemctl status dietpi-ramdisk -l

Also, can we see your /etc/fstab to check mount entry for /DietPi:

cat /etc/fstab

And, lets check permissions on /DietPi:

ls -lha /DietPi