Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DietPi-RAMdisk | /DietPi folder empty after reboot #719

Closed
Fourdee opened this issue Jan 19, 2017 · 44 comments
Closed

DietPi-RAMdisk | /DietPi folder empty after reboot #719

Fourdee opened this issue Jan 19, 2017 · 44 comments
Milestone

Comments

@Fourdee
Copy link
Collaborator

Fourdee commented Jan 19, 2017

Reports:

http://dietpi.com/phpbb/viewtopic.php?f=11&t=1148&start=20#p5145
http://dietpi.com/phpbb/viewtopic.php?f=11&t=1148&start=20#p5147

Appears random (John).

Add additional debugging to dietpi-ramdisk.service

@Fourdee
Copy link
Collaborator Author

Fourdee commented Jan 23, 2017

@midwan

Which PSU + SD are you using on the Pine when it caused this: https://github.com/Fourdee/DietPi/issues/726#issue-202412586

@Fourdee
Copy link
Collaborator Author

Fourdee commented Jan 23, 2017

John reports possible flaky SD card (Kinsgton 8 GD SD card) causing this issue.

@midwan
Copy link

midwan commented Jan 23, 2017

@Fourdee
I used the Official Raspberry Pi PSU (5V, 2.5A) and a Sandisk Extreme 16GB SD card.

@Fourdee
Copy link
Collaborator Author

Fourdee commented Jan 23, 2017

@midwan

Thanks.

When the folder is missing, can you please do the following:
http://dietpi.com/phpbb/viewtopic.php?f=11&t=1148&start=20#p5143

Mostly interested in results of:

systemctl status dietpi-ramlog -l

@WolfganP
Copy link

I think the issue is even an step earlier, /boot/dietpi is empty as well so dietpi-ramlog and other scripts aren't present in the system.

@Fourdee
Copy link
Collaborator Author

Fourdee commented Jan 23, 2017

I think the issue is even an step earlier, /boot/dietpi is empty as well so dietpi-ramlog and other scripts aren't present in the system.

Seems to vary:

@midwan
Copy link

midwan commented Jan 25, 2017

@Fourdee

In my case, /boot/dietpi does have contents:

root@DietPi:~# ls -al /boot/dietpi
total 116
drwxr-xr-x 3 root root  4096 Jan 22 16:58 .
drwxr-xr-x 5 root root 16384 Jan  1  1970 ..
-rwxr-xr-x 1 root root 13693 Jan 22 16:47 boot
-rwxr-xr-x 1 root root     2 Jan 22 16:47 .dietpi-autostart_index
-rwxr-xr-x 1 root root  5207 Jan 22 16:47 dietpi-cpuinfo
-rwxr-xr-x 1 root root  8299 Jan 22 16:47 dietpi-cron
-rwxr-xr-x 1 root root 33446 Jan 22 16:47 dietpi-drive_manager
-rwxr-xr-x 1 root root  5420 Jan 22 16:47 dietpi-funtime
-rwxr-xr-x 1 root root    83 Jan 22 16:47 .dietpi-process_tool
-rwxr-xr-x 1 root root     4 Jan 22 16:47 .dietpi-survey
drwxr-xr-x 2 root root  2048 Jan 22 16:58 func
-rwxr-xr-x 1 root root   112 Jan 22 16:47 .hw_model
-rwxr-xr-x 1 root root  4277 Jan 22 16:47 .installed
-rwxr-xr-x 1 root root     2 Jan 22 16:47 .install_stage
-rwxr-xr-x 1 root root    24 Jan 22 16:47 .network
-rwxr-xr-x 1 root root   123 Jan 22 16:47 .uninstalled
-rwxr-xr-x 1 root root     2 Jan 22 16:47 .update_stage
-rwxr-xr-x 1 root root     4 Jan 22 16:47 .version

Here are the results, as requested:

  • Device used: Pine64, 2GB model
  • Software installed: MATE desktop, Plex Media Server, Samba server. Though they worked fine until I did the firmware update.
  • Last command run: Firmware update. It did the self-update first (was already on the latest version) then downloaded the firmware without errors, proceeded to extract it, then reboot.
  • PSU used: Official RPI (5V, 2.5A)
  • SD card used: SanDisk Ultra 16GB
  • fstab entries:
root@DietPi:~# cat /etc/fstab
#Internal Drives---------------------------------------------------
proc            /proc           proc    defaults                                                                                        0 0
/dev/mmcblk0p1  /boot           auto    defaults,noatime,discard                                                        0 2
/dev/mmcblk0p2  /               auto    defaults,noatime,discard                                                        0 1
tmpfs                   /tmp                    tmpfs   defaults,noatime,nodev,nosuid,mode=1777                         0 0
tmpfs                   /var/log                tmpfs   defaults,size=20m,noatime,nodev,nosuid,mode=1777        0 0
tmpfs                   /DietPi                 tmpfs   defaults,size=10m,noatime,nodev,nosuid,mode=1777        0 0

#External Drives---------------------------------------------------
#NB: Please use dietpi-drive_manager to setup and control your external drives.
#/dev/sda1       /mnt/usb_1      auto     defaults,noatime,nofail,x-systemd.automount  0 0
#/dev/sdb1       /mnt/usb_2      auto     defaults,noatime,nofail,x-systemd.automount  0 0
#/dev/sdc1       /mnt/usb_3      auto     defaults,noatime,nofail,x-systemd.automount  0 0
#/dev/sdd1       /mnt/usb_4      auto     defaults,noatime,nofail,x-systemd.automount  0 0
#/dev/sde1       /mnt/usb_5      auto     defaults,noatime,nofail,x-systemd.automount  0 0

#Samba Client------------------------------------------------------
#/mnt/samba . Please use dietpi-config and the Networking Options: NAS menu to setup this mount

#FTP Client Mount--------------------------------------------------
#/mnt/ftp_client . Please use dietpi-config and the Networking Options: NAS menu to setup this mount

#NFS Client Mount--------------------------------------------------
#/mnt/nfs_client . Please use dietpi-config and the Networking Options: NAS menu to setup this mount
# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that

DietPi-RAMlog status:

root@DietPi:~# systemctl status dietpi-ramlog -l
● dietpi-ramlog.service - DietPi-RAMlog
   Loaded: loaded (/etc/systemd/system/dietpi-ramlog.service; enabled)
   Active: failed (Result: exit-code) since Sun 2017-01-22 18:05:43 GMT; 6min ago
  Process: 543 ExecStart=/bin/bash -c /boot/dietpi/dietpi-ramlog 0 (code=exited, status=127)

Jan 22 18:05:42 DietPi bash[543]: /bin/bash: /boot/dietpi/dietpi-ramlog: No such file or directory
Jan 22 18:05:43 DietPi systemd[1]: dietpi-ramlog.service: control process exited, code=exited status=127
Jan 22 18:05:43 DietPi systemd[1]: Failed to start DietPi-RAMlog.
Jan 22 18:05:43 DietPi systemd[1]: Unit dietpi-ramlog.service entered failed state.

I hope that helps!

@Fourdee
Copy link
Collaborator Author

Fourdee commented Jan 25, 2017

@midwan

Thanks 👍

Looks like some of the DietPi scripts are missing from /boot:

root@DietPi:~# ls -al /boot/dietpi

/bin/bash: /boot/dietpi/dietpi-ramlog: No such file or directory

I'll run some tests.

@Fourdee
Copy link
Collaborator Author

Fourdee commented Jan 25, 2017

@midwan

Whats the size used in /boot?

df -h

Fourdee referenced this issue Jan 25, 2017
@Fourdee
Copy link
Collaborator Author

Fourdee commented Jan 25, 2017

Ok i've enabled verbose debugging for dietpi-ramdisk.

Logs will be saved to:
/etc/dietpi/logs/dietpi-ramdisk.log

This won't be enabled until v143 is released (or use of testing branch: https://github.com/Fourdee/DietPi/blob/master/TESTING-BRANCH.md), however, once the issue occurs, logs should give us much needed clues.

@Fourdee
Copy link
Collaborator Author

Fourdee commented Jan 26, 2017

Just wondering if this is a simple case of service running before local-fs.target

Adding following should prevent that:
After=local-fs.target

Fourdee referenced this issue Jan 26, 2017
+ DietPi-RAMdisk / DietPi-RAMlog. Ensure runs after local-fs.target:
https://github.com/Fourdee/DietPi/issues/719
@Fourdee Fourdee modified the milestones: v143, v144 Jan 29, 2017
@Fourdee
Copy link
Collaborator Author

Fourdee commented Jan 29, 2017

Debugging enabled for v143:

If you experience and issues with missing /DietPi or /boot files, on a fresh install , please paste results of the following command

cat /etc/dietpi/logs/dietpi-ramdisk.log

@Fourdee Fourdee mentioned this issue Jan 29, 2017
Fourdee referenced this issue Jan 29, 2017
v143
(29/01/17)

Images:

BPi Pro | Image has been updated to 4.9 kernel. Onboard WiFi is now functional, HDMI audio is not supported at this time (3.5mm only): https://github.com/Fourdee/DietPi/issues/732

Changes / Improvements / Optimizations:

General | RPi: DietPi kernel is now installed by default. This adds support for Allo Piano 2.1 DAC, and 192KHz 16bit HDMI output.

DietPi-RAMdisk | Enabled additional logging for this process, as some users are experiencing issues. This should help us find the cause: https://github.com/Fourdee/DietPi/issues/719

DietPi-Config | Audio > Sound card: Added support for RPi "Pi-DIGI+"

DietPi-Software | NeoVim: Now available for RPi Stretch: https://github.com/Fourdee/DietPi/issues/692

DietPi-Software | O!MPD: Now available for installation. Slick, feature-rich MPD web interface music player: http://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=5171#p5171

DietPi-Software | NetData: Updated to latest (1.5.0): https://github.com/Fourdee/DietPi/issues/728

DietPi-JustBoom | Added option to launch Alsamixer

DietPi-JustBoom | Added various options unique to the Allo Piano 2.1 DAC: https://github.com/Fourdee/DietPi/issues/714

Bug fixes:

General | Pine 64 FB cursor is now visible: https://github.com/Fourdee/DietPi/issues/596

General | LED heartbeat for H3 is now functional and applied during boot.

DietPi-Config | Display > Added support for JustBoom IR Remote. Supports Kodi & MPD controls by default: https://github.com/Fourdee/DietPi/issues/735

DietPi-Config | Audio > USB-DAC: When enabled, will always re-detect and apply active card index during boot. Many thanks to "J. Künz" for these fixes!

DietPi-Config | Audio > Sound card: Corrected options for BPi Pro. Many thanks to "J. Künz" for these fixes!

DietPi-Config | Audio > Sound card: Corrected options for OPi Zero (H2+) HDMI and 3.5mm analogue (default).

DietPi-Config | Audio > Sound card: Allo Piano 2.1 DAC for RPi is now functional. Driver provided by DietPi kernel: https://github.com/Fourdee/DietPi/issues/727

DietPi-Software | Failure to move MySQL DB store will now prevent further action being taken: https://github.com/Fourdee/DietPi/issues/715

DietPi-Software | Resolved an issue with VNC4server/RealVNC install, that prevented desktop launch command being inserted to xstartup, if a desktop was installed beforehand:

DietPi-Software | Resolved an issue where installing LMS and SqueezeLite at the same time, would result in apt failure 100: https://github.com/Fourdee/DietPi/issues/736
@Fourdee
Copy link
Collaborator Author

Fourdee commented Jan 30, 2017

@WolfganP
Copy link

WolfganP commented Feb 7, 2017

@Fourdee I'm sorry I've missed the images' update. I was waiting for a new version to re-write my SD and start config from scratch to test and get my system back to stability. Do you suggest to wait to v144 to test the new images + new commits related to this issue?

@Fourdee
Copy link
Collaborator Author

Fourdee commented Feb 8, 2017

@WolfganP

Do you suggest to wait to v144 to test the new images + new commits related to this issue?

You can test these images now.

The new images are essentially v143.5 and contain all the current commits. In other words, they are v144 at this time, containing all the updated code.

@Fourdee
Copy link
Collaborator Author

Fourdee commented Feb 13, 2017

Ok, informed users on forums, awaiting test results of the new images, from users who experienced the missing /DietPi folder/files:
http://dietpi.com/phpbb/viewtopic.php?f=11&t=1148&p=5617#p5617

@WolfganP
Copy link

I rebuilt my SD card from scratch a few days ago with the 1.43.5 RasPi image, using the system as plex media & file server, no issues observed so far. Thanks a lot @Fourdee !

@Fourdee
Copy link
Collaborator Author

Fourdee commented Feb 13, 2017

@WolfganP

no issues observed so far

Excellent, but please let us know if this changes.

@Fourdee
Copy link
Collaborator Author

Fourdee commented Mar 2, 2017

No further reports using the updated images. All images have now been updated using our new image creation procedure and force sync in dietpi-ramlog.

Marking as closed. Will reopen if further reports come in, using the latest DietPi v145 images.

@Fourdee Fourdee closed this as completed Mar 2, 2017
@WolfganP
Copy link

Just to report that I lost /Dietpi folder again today. Something weird about chown in the logs:

● dietpi-ramlog.service - DietPi-RAMlog
   Loaded: loaded (/etc/systemd/system/dietpi-ramlog.service; enabled)
   Active: active (exited) since Tue 2017-04-11 22:53:07 UTC; 12min ago
  Process: 399 ExecStart=/bin/bash -c /boot/dietpi/dietpi-ramlog 0 (code=exited, status=0/SUCCESS)

Apr 11 22:53:06 DietPi systemd[1]: Starting DietPi-RAMlog...
Apr 11 22:53:07 DietPi bash[399]: DietPi-Ramlog: Starting
Apr 11 22:53:07 DietPi bash[399]: chown: invalid user: ‘debian-tor:nogroup’
Apr 11 22:53:07 DietPi bash[399]: DietPi-Ramlog: Completed
Apr 11 22:53:07 DietPi systemd[1]: Started DietPi-RAMlog.

@Fourdee
Copy link
Collaborator Author

Fourdee commented Apr 16, 2017

@WolfganP

Thanks for the report,

chown: invalid user: ‘debian-tor:nogroup’

This is for the RAMlog, we have a special case permission for tor log files, safe to ignore.

Whats the status of RAMdisk /DietPi?:

systemctl status dietpi-ramdisk -l
cat /etc/dietpi/logs/dietpi-ramdisk.log

@msdos
Copy link

msdos commented May 27, 2017

I received the same error, but I think the problem is the SD card, it's a really old 2gb with only DietPi Jessie installed for the first time. I'm going to stop using the card instead of spending more time with it. I'm posting here just to say that dmesg gives me info as well, maybe it's useful for your debugging approaches.

[   46.855682] FAT-fs (mmcblk0p1): error, corrupted directory (invalid entries)
[   46.855690] FAT-fs (mmcblk0p1): Filesystem has been set read-only
[   47.178695] FAT-fs (mmcblk0p1): error, fat_get_cluster: invalid cluster chain (i_pos 0)
[   47.178855] FAT-fs (mmcblk0p1): error, fat_get_cluster: invalid cluster chain (i_pos 0)
[   47.698696] FAT-fs (mmcblk0p1): error, fat_get_cluster: invalid cluster chain (i_pos 0)
[   47.698891] FAT-fs (mmcblk0p1): error, fat_get_cluster: invalid cluster chain (i_pos 0)
[   47.699018] FAT-fs (mmcblk0p1): error, fat_get_cluster: invalid cluster chain (i_pos 0)
[   48.326605] Adding 815100k swap on /var/swap.  Priority:-1 extents:5 across:864252k SSFS
[  613.251797] FAT-fs (mmcblk0p1): error, fat_get_cluster: invalid cluster chain (i_pos 0)
[  613.783637] FAT-fs (mmcblk0p1): error, fat_get_cluster: invalid cluster chain (i_pos 0)

@douglasmiranda
Copy link

Another common cause for these kind of errors is if you have some volume on /etc/fstab that you are mounting on boot and it fails. Sometimes it fails before the system mounts the first volumes.

So you wait a while and the system will let you inform your root password to enter in maintenance mode, then you can edit your /etc/fstab file, remove / comment the entries that may be the cause of error. Check with mount -a, if there are no errors, just reboot.

@Fffrank
Copy link

Fffrank commented May 1, 2018

I'm a new user but unfortunately I believe I just joined this club. Installed DietPi on a fresh Odroid C2 w/ a Sandisk 128gb card. Had things up and running and was tinkering with it. Connected an external USB drive and rebooted -- and directory is now empty. Boots and I can login but can't run any dietpi commands.

total 80K
drwxr-xr-x 2 root   root   4.0K Apr 29 13:34 .
drw-rw---- 3 dietpi dietpi 4.0K Jan 10 07:16 ..
-rw-r--r-- 1 root   root    28K Apr 29 13:37 dietpi-firstrun-setup.log
-rw-r--r-- 1 root   root   1.7K Apr 30 10:59 dietpi-ramdisk.log
-rw-r--r-- 1 root   root    940 Apr 30 10:59 dietpi-ramlog.log
-rw-r--r-- 1 root   root      0 Apr 30 11:37 dietpi-software_apt.log
-rw-r--r-- 1 root   root    28K Apr 29 13:35 dietpi-update.log
-rw-r--r-- 1 root   root    213 Dec 31  1969 fs_expand.log
-rw-r--r-- 1 root   root   1.8K Dec 31  1969 fs_partition_resize.log```

@Fourdee
Copy link
Collaborator Author

Fourdee commented May 1, 2018

@Fffrank

Thanks for the report. To the best of our knowledge, this issue is always related to hardware instability.

Please paste results of the logs:

systemctl status dietpi-ramdisk -l
cat /etc/dietpi/logs/dietpi-ramdisk.log
dmesg | grep mmc

Also, which power supply are you running?

@Fffrank
Copy link

Fffrank commented May 1, 2018

@Fourdee This power supply: https://www.amazon.com/gp/product/B0719SX3GC/

Failed to get D-Bus connection: Unknown error -1
dietpi@DietPi:~$ sudo cat /etc/dietpi/logs/dietpi-ramdisk.log
cat: /etc/dietpi/logs/dietpi-ramdisk.log: No such file or directory
dietpi@DietPi:~$ dmesg | grep mmc
[    0.000000] Kernel command line: root=/dev/mmcblk0p2 rootwait ro console=tty0 no_console_suspend hdmimode=720p60hz m_bpp=32 vout= fsck.repair=yes net.ifnames=0 elevator=noop disablehpd=true
[    0.483615] aml_sd_emmc_probe: line 2898
[    0.483625] mmc driver version: 1.07, 2015-01-21: fix a bug in tuning which caused eMMC data CRC error
[    0.483983] aml_sd_emmc_reg_init 621
[    0.543079] [aml_sd_emmc_probe] aml_sd_emmc_probe() success!
[    0.543111] aml_sd_emmc_probe: line 2898
[    0.545943] aml_sd_emmc_reg_init 621
[    0.546136] get property:                  pinname, str:emmc
[    0.601764] [aml_sd_emmc_probe] aml_sd_emmc_probe() success!
[    0.751809] sd_emmc_regs->gclock =0x100024c, sd_emmc_regs->gadjust =0x42000
[    0.752151] mmcblk0: sd:aaaa SC128 119 GiB
[    0.754293]  mmcblk0: p1 p2
[    0.754587] aml_emmc_hw_reset 1356
[    0.766771] [aml_sd_emmc_irq] emmc: resp_timeout,vstat:0x2800,virqc:3fff
[    0.766791] aml_sd_emmc_data_thread 2155 emmc: cmd:1
[    0.766820] emmc: error -110 whilst initialising MMC card
[    5.952218] EXT4-fs (mmcblk0p2): mounted filesystem without journal. Opts: (null)
[    6.470710] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[    6.564644] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
dietpi@DietPi:~$

@Fourdee
Copy link
Collaborator Author

Fourdee commented May 2, 2018

@Fffrank

[ 0.766820] emmc: error -110 whilst initialising MMC card
[ 6.564644] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.

Looks like a corrupt SD filesystem. Any recent power cuts? If not, could be SD card failing, or PSU is insufficient (we highly recommend the official RPi PSU's).

You'll need to reinstall DietPi on the SD card.

@mzramna
Copy link

mzramna commented Apr 17, 2019

this also happends over btrfs filesystem,btrfs does not support swapfile like archives , it should be checked into the instalation script before starting the conversion

@MichaIng
Copy link
Owner

MichaIng commented Apr 17, 2019

@mzramna
Many thanks for reporting. For reference: #1285 (comment)

All our images are shipped with ext4 root partition, however we do not check root fs type during DietPi-PREP. Either we need to check and disallow DietPi-PREP on non-ext4 root fs, or, which I like more, simply refuse swap creation and print error on script level. This then also includes manual script usage to create swap on external drive etc.


Btw we have an open request to allow swap on BTRFS via separate swap partition: #1715
But this is nothing we can safely apply to drives with existing content, especially not root fs. And before doing huge efforts, we can simply wait for kernel 5.0 supporting swap files on BTRFS: https://kernelnewbies.org/LinuxChanges/#Linux_5.0.Btrfs_swap_file_support

  • But yeah will take a while until that kernel is available for devices, and most (currently supported devices) will most properly never see it 😉.
  • Allowing to use a whole partition for swap instead of a swap file is a dedicated reasonable request. So it is then up to the user to create a partition of desired space and the script will just toggle it for swap.

Fixed with: #2720

  • Swap creation aborts now if BTRFS is detected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants