Issues creating an image-file from a SD-card Topic is solved

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
Lelo
Posts: 17
Joined: Wed Oct 11, 2017 10:50 pm

Issues creating an image-file from a SD-card

Post by Lelo »

Hello.

I have succesfully converted Buster-based ARMbian-Images to DietPi using the very nice "Other device"-instruction:
An Orange Pi Zero and an Banana Pi M2+ are running nearly fine now.

But I have discovered two problems:

- Before starting the converted DiePi I made an Image-file with Win32DiskImager. As I only have 32GB SD-cards the
.IMG-file went 32GB big, but after zipping it the file size was below 2GB. Is there a way/tool to create an .IMG-file
which only uses the space really used on the SD-card (pure .IMG-file, no extra zipping)?

- When i wrote this .IMG-file to another SD-card with a capacity of also 32GB using W32DiskImager and balena Etcher
both programs stated that I would need a little more space on the target SD-card. How is that possible?

So: How do I create an .IMG-file with minimum-size and compatible to other SD-card capacities?


Cheers,
Lelo
User avatar
Joulinar
Posts: 2085
Joined: Sat Nov 16, 2019 12:49 am

Re: Issues creating an image-file from a SD-card

Post by Joulinar »

For the image creation DietPi use following script.

Code: Select all

bash -c "$(curl -sSL https://raw.githubusercontent.com/MichaIng/DietPi/dev/.meta/dietpi-imager)"
  1. install Debian base image
  2. run the PREP script
  3. shutdown that device
  4. take out SD Card
  5. mount SD Card on a different DietPi device or DietPi VM
  6. run dietpi-imager script
  7. Select Drive as source
  8. select dd as cloning tool, DO NOT select Clonezilla installer, since this only works for x86_64 target systems
  9. select external usb drive
  10. select rootFS
  11. specify file name
  12. be patient, creation of the image will take some time
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Lelo
Posts: 17
Joined: Wed Oct 11, 2017 10:50 pm

Re: Issues creating an image-file from a SD-card

Post by Lelo »

Thanks for your response, but I don´t succeed with this:
I have a Windows-laptop with an "Linux Mint XFCE" installed in VirtaulBox. It looks like a USB3-Port is not supported in VB,
but connecting the carderader to a USB2 port shows me the SD-card mounted in Thunar-filemanager.

I opened a terminal, entered the command you stated (with & without sudo) and got this reponse ("-->" = translation):

Code: Select all

sudo bash -c "$(curl -sSL https://raw.githubusercontent.com/MichaIng/DietPi/dev/.meta/dietpi-imager)"
[sudo] Passwort:     
bash: Zeile 19: /boot/dietpi/func/dietpi-globals: Datei oder Verzeichnis nicht gefunden ---> File or directory not found
bash: Zeile 21: G_CHECK_ROOT_USER: Befehl nicht gefunden ---> command not found
bash: Zeile 22: G_CHECK_ROOTFS_RW: Befehl nicht gefunden ---> command not found
bash: Zeile 24: G_INIT: Befehl nicht gefunden ---> command not found
environment: Zeile 59: G_WHIP_MENU: Befehl nicht gefunden ---> command not found
Where did I go wrong?
User avatar
Joulinar
Posts: 2085
Joined: Sat Nov 16, 2019 12:49 am

Re: Issues creating an image-file from a SD-card

Post by Joulinar »

You would need to have a virtual machine running DietPi ;)
Should not be a problem on Virtual Box 8)
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Lelo
Posts: 17
Joined: Wed Oct 11, 2017 10:50 pm

Re: Issues creating an image-file from a SD-card

Post by Lelo »

Ah, OK, I thought "some DD-scripting" would do well with any linux.
Worked with VBox and the Dietpi-PC-Image fine then. Thanx for your support. :)
User avatar
Joulinar
Posts: 2085
Joined: Sat Nov 16, 2019 12:49 am

Re: Issues creating an image-file from a SD-card

Post by Joulinar »

yes, dietpi-imager is expecting a couple of DietPi functions (G_) as you can see on your error message
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
robcarr
Posts: 3
Joined: Mon Jul 20, 2020 4:23 pm

Re: Issues creating an image-file from a SD-card

Post by robcarr »

Joulinar wrote: Thu Jul 16, 2020 5:04 pm You would need to have a virtual web machine running DietPi ;)
Should not be a problem on Virtual Box 8)
That's a good idea, actually.
Last edited by robcarr on Thu Jul 30, 2020 6:23 pm, edited 1 time in total.
User avatar
Joulinar
Posts: 2085
Joined: Sat Nov 16, 2019 12:49 am

Re: Issues creating an image-file from a SD-card

Post by Joulinar »

there is a read to run image available for VirtualBox on DietPi download page ;)
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply