MichaIng / DietPi

Lightweight justice for your single-board computer!
https://dietpi.com/
GNU General Public License v2.0
4.88k stars 497 forks source link

Error message while creating image file #5839

Closed DrCWO closed 2 years ago

DrCWO commented 2 years ago

Creating a bug report/issue

Required Information

Steps to reproduce

  1. I have the image of Dietpi on a SD-Card inserted with a SD-Card-reader in USB of Pi
  2. export SKIP_ARCHIVE=1
  3. bash -c "$(curl -sSfL 'https://raw.githubusercontent.com/MichaIng/DietPi/dev/.build/images/dietpi-imager')"

Expected behaviour

Actual behaviour

Extra details

I think it's time to thank you for DietPi and the great support you offer. I reported some issues in the past and I am very happy of your quick response time and also for answering all my sometimes silly questions. THANK YOU 👍

DrCWO commented 2 years ago

Despite this error message I kept it running but after a short time I saw this in the mask and gave up...

 - Command: fstrim -v --quiet-unsupported /tmp/DietPi-Imager_mnt                                                     │
        │  - Exit code: 1                                                                                                      │
        │  - DietPi version: v8.10.2 (MichaIng/master) | HW_MODEL: 4 | HW_ARCH: 3 | DISTRO: 6                                  │
        │  - Image creator: DietPi Core Team                                                                                   │
        │  - Pre-image: from scratch                                                                                           │
        │  - Error log:       
DrCWO commented 2 years ago

Just to let you know: Same with https://raw.githubusercontent.com/MichaIng/DietPi/master/.build/images/dietpi-imager

DrCWO commented 2 years ago

One more info. If I do export SHRINK_ONLY=0 before starting the script I don't get the syntax error.

But I still get the error message of fstrim 👎

#### Details:
- Date           | Thu Oct 27 11:54:14 BST 2022
- DietPi version | v8.10.2 (MichaIng/master)
- Image creator  | DietPi Core Team
- Pre-image      | from scratch
- Hardware       | RPi 4 Model B (aarch64) (ID=4)
- Kernel version | `Linux DietPi 5.15.61-v8+ #1579 SMP PREEMPT Fri Aug 26 11:16:44 BST 2022 aarch64 GNU/Linux`
- Distro         | bullseye (ID=6,RASPBIAN=0)
- Command        | `fstrim -v --quiet-unsupported /tmp/DietPi-Imager_mnt`
- Exit code      | 1
- Software title | DietPi-Imager
Joulinar commented 2 years ago

Can you scroll up on the SSH session and check for the real error message please

DrCWO commented 2 years ago

[ INFO ] DietPi-Imager | fstrim -v --quiet-unsupported /tmp/DietPi-Imager_mnt, please wait... [FAILED] DietPi-Imager | fstrim -v --quiet-unsupported /tmp/DietPi-Imager_mnt

DrCWO commented 2 years ago

I also wondered why there are two partitions on my SD-Card. Seems to be sda1 with the boot files and sda2 with root. I don't know if this is standard for Raspberry Pi. I also run DietPi on a R2S and there I only have sda1 ??

Joulinar commented 2 years ago

Number of partitions depends on SBC model. For Raspberry Pi it's standard to have 2 partition. BootFS located on vfat and RootFS on ext4. On a NanoPi R5S, we actually have up to 8 partition because of the FriendlyElec base image 🙄

MichaIng commented 2 years ago

I'm not sure why on some drives fstrim fails, even with --quiet-unsupported, but I assured now that this failure does not halt the script, but it will just continue: https://github.com/MichaIng/DietPi/commit/8e11fc4

DrCWO commented 2 years ago

I retested and you are right, it continues running, sorry for my wrong comment. When I saw the error I stopped it as I did not know if the created image will be OK after the error message...

Will it be OK even with the reported error?

Joulinar commented 2 years ago

Will it be OK even with the reported error?

Yes, should be ok

MichaIng commented 2 years ago

Yes, the error is still shown for transparency, just not halting the script. fstrim is not required, more a cleanup step in attempt to allow better compression of the resulting image. However, actually at least on SSDs and SD cards this shouldn't have any effect, since it is regular TRIM. Probably we can remove the step completely.

I fixed the other error message as well, have overseen this in your OP: https://github.com/MichaIng/DietPi/commit/1a34ccf Visual only, but unnecessary, thanks for reporting 👍.