User avatar
RaspbianUser1
Posts: 495
Joined: Thu Mar 05, 2020 6:34 pm

How to make turn a custom raspberry pi install into a image?

Tue Oct 13, 2020 1:52 pm

I know this question has probably been answered 1000 times but I can't find the answer after using google for 20 minutes and searching this forum.

Anyway, my question is kind of in the title, but if you don't understand what I want to do is.
While on the raspberry pi, I want to make a replica of the image its using.
I don't want it flashed on another SD card or anything, I want a .img file with everything in.

I have tried searching for a program/command but I can't find anything.

Thanks in advance
Running either Raspberry Pi OS desktop Full or Raspberry Pi OS MATE desktop
Overclocked at 2200MHz CPU and 700 MHz GPU with a over voltage of 7
Think before you delete something a stranger on the internet told you to.

scotty101
Posts: 4100
Joined: Fri Jun 08, 2012 6:03 pm

Re: How to make turn a custom raspberry pi install into a image?

Tue Oct 13, 2020 2:39 pm

Did your search turn up this page?

https://www.raspberrypi.org/documentati ... /backup.md

This describes how to create an image from an existing SD card using the SD Card Copier application.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

User avatar
RaspbianUser1
Posts: 495
Joined: Thu Mar 05, 2020 6:34 pm

Re: How to make turn a custom raspberry pi install into a image?

Tue Oct 13, 2020 3:11 pm

Thank you but is there a premade program as I plan to make quite a few in different installs
Running either Raspberry Pi OS desktop Full or Raspberry Pi OS MATE desktop
Overclocked at 2200MHz CPU and 700 MHz GPU with a over voltage of 7
Think before you delete something a stranger on the internet told you to.

User avatar
pasman1
Posts: 109
Joined: Mon Aug 10, 2020 3:01 pm
Location: Poland

Re: How to make turn a custom raspberry pi install into a image?

Tue Oct 13, 2020 3:52 pm

RPi4-4GB Multiboot RaspOS 32/5.10, RaspOS 64/5.4Bootloader: 2020-09-03, VL805: 000138a1

bls
Posts: 862
Joined: Mon Oct 22, 2018 11:25 pm
Location: Seattle, WA
Contact: Twitter

Re: How to make turn a custom raspberry pi install into a image?

Tue Oct 13, 2020 3:56 pm

If you're going to make several different install configurations, you might want to think about going the "other way". That is, starting from building customized images and then blast them to SD Cards when you need one. An easy way to do this is to use a tool like https://github.com/gitbls/sdm
Pi tools:
Quickly and easily build customized-just-for-you SD Cards: https://github.com/gitbls/sdm
Easily run your network's DHCP/DNS on a Pi: https://github.com/gitbls/ndm
Easy strongSwan VPN installer/manager: https://github.com/gitbls/pistrong
Lightweight Virtual VNC Config: https://github.com/gitbls/RPiVNCHowTo

trejan
Posts: 2949
Joined: Tue Jul 02, 2019 2:28 pm

Re: How to make turn a custom raspberry pi install into a image?

Tue Oct 13, 2020 4:10 pm

bls wrote:
Tue Oct 13, 2020 3:56 pm
If you're going to make several different install configurations, you might want to think about going the "other way". That is, starting from building customized images and then blast them to SD Cards when you need one. An easy way to do this is to use a tool like https://github.com/gitbls/sdm
This is the proper way to build images. Trying to create one from a live install is bad idea and you'll leak data like logins and passwords unless you're very meticulous about cleaning up and scrubbing the unused portion of the image. If nothing else, you must ensure that the SSH host keys are deleted from /etc/ssh as it is a security vulnerability to leave them there.

emma1997
Posts: 1088
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: How to make turn a custom raspberry pi install into a image?

Tue Oct 13, 2020 8:17 pm

I second that. In particular RonR's Image-Backup program made it so easy and efficient I now backup all the time instead of once in a while. I can't believe the hoops I used to jump through and some of my pals still do. If it ain't easy it tends to not get done.

The image shrink function had major impact on my disk space usage too.

User avatar
RaspbianUser1
Posts: 495
Joined: Thu Mar 05, 2020 6:34 pm

Re: How to make turn a custom raspberry pi install into a image?

Tue Oct 13, 2020 9:38 pm

I am really struggling here, I don't know how to use RonR's software, I don't understand what its asking from me, I can get it installed and started but I don't understand the questions its asking.

Is there a simple GUI program which can just do exactly what rpclone is doing but instead of writing to a external device, writing to an image file. I just want to be able to store my backups on the cloud rather than using an entire SD card
Running either Raspberry Pi OS desktop Full or Raspberry Pi OS MATE desktop
Overclocked at 2200MHz CPU and 700 MHz GPU with a over voltage of 7
Think before you delete something a stranger on the internet told you to.

User avatar
Botspot
Posts: 1540
Joined: Thu Jan 17, 2019 9:47 pm
Location: Texas
Contact: Website

Re: How to make turn a custom raspberry pi install into a image?

Tue Oct 13, 2020 10:05 pm

RaspbianUser1 wrote:
Tue Oct 13, 2020 9:38 pm
I am really struggling here, I don't know how to use RonR's software, I don't understand what its asking from me, I can get it installed and started but I don't understand the questions its asking.

Is there a simple GUI program?
Yes! At least, there is a simple GUI program to make your own image. It's Pi-Power-Tools.
img-mode.png
img-mode.png (21.47 KiB) Viewed 611 times
Want to run Minecraft Java on your RPi? Easiest way is with Pi-Apps - just click Install.
https://github.com/Botspot/pi-apps
Pi-Apps also includes Zoom, Visual Studio, Tor browser, Windows 10 theme, and 33 more.
Over 50,000 users!

RonR
Posts: 1683
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: How to make turn a custom raspberry pi install into a image?

Tue Oct 13, 2020 10:11 pm

RaspbianUser1 wrote:
Tue Oct 13, 2020 9:38 pm
I am really struggling here, I don't know how to use RonR's software, I don't understand what its asking from me, I can get it installed and started but I don't understand the questions its asking.

Is it really that complicated?: :)

Code: Select all

pi@raspberrypi:~ $ sudo ./image-backup

Image file to create? /mnt/backup.img

Initial image file ROOT filesystem size (MB) [3584]?

Added space for incremental updates after shrinking (MB) [0]?

Create /mnt/backup.img (y/n)? y

Except for the image file to create (/pathto/filename), simply take the defaults.

User avatar
RaspbianUser1
Posts: 495
Joined: Thu Mar 05, 2020 6:34 pm

Re: How to make turn a custom raspberry pi install into a image?

Tue Oct 13, 2020 10:13 pm

Initial image file ROOT filesystem size (MB) [3584]?

Added space for incremental updates after shrinking (MB) [0]?
What do I enter here
Running either Raspberry Pi OS desktop Full or Raspberry Pi OS MATE desktop
Overclocked at 2200MHz CPU and 700 MHz GPU with a over voltage of 7
Think before you delete something a stranger on the internet told you to.

User avatar
RaspbianUser1
Posts: 495
Joined: Thu Mar 05, 2020 6:34 pm

Re: How to make turn a custom raspberry pi install into a image?

Tue Oct 13, 2020 10:15 pm

Botspot wrote:
Tue Oct 13, 2020 10:05 pm
RaspbianUser1 wrote:
Tue Oct 13, 2020 9:38 pm
I am really struggling here, I don't know how to use RonR's software, I don't understand what its asking from me, I can get it installed and started but I don't understand the questions its asking.

Is there a simple GUI program?
Yes! At least, there is a simple GUI program to make your own image. It's Pi-Power-Tools.
img-mode.png
I did look at your software, does it allow you to copy the current raspberry pi install to an img file?
Running either Raspberry Pi OS desktop Full or Raspberry Pi OS MATE desktop
Overclocked at 2200MHz CPU and 700 MHz GPU with a over voltage of 7
Think before you delete something a stranger on the internet told you to.

User avatar
Botspot
Posts: 1540
Joined: Thu Jan 17, 2019 9:47 pm
Location: Texas
Contact: Website

Re: How to make turn a custom raspberry pi install into a image?

Tue Oct 13, 2020 10:17 pm

RaspbianUser1 wrote:
Tue Oct 13, 2020 10:15 pm
Botspot wrote:
Tue Oct 13, 2020 10:05 pm
Yes! At least, there is a simple GUI program to make your own image. It's Pi-Power-Tools.
img-mode.png
I did look at your software, does it allow you to copy the current raspberry pi install to an img file?
Yes it does. Pi-Power-Tools includes an IMG Flasher.
flash.png
flash.png (18.26 KiB) Viewed 589 times
In addition to that, PPT includes many unique features that no other tool on earth can do. See more on its instruction file (README)
Want to run Minecraft Java on your RPi? Easiest way is with Pi-Apps - just click Install.
https://github.com/Botspot/pi-apps
Pi-Apps also includes Zoom, Visual Studio, Tor browser, Windows 10 theme, and 33 more.
Over 50,000 users!

User avatar
RaspbianUser1
Posts: 495
Joined: Thu Mar 05, 2020 6:34 pm

Re: How to make turn a custom raspberry pi install into a image?

Tue Oct 13, 2020 10:26 pm

You misread/misunderstood my question.
Can you turn the current working system into an image file
Running either Raspberry Pi OS desktop Full or Raspberry Pi OS MATE desktop
Overclocked at 2200MHz CPU and 700 MHz GPU with a over voltage of 7
Think before you delete something a stranger on the internet told you to.

User avatar
Botspot
Posts: 1540
Joined: Thu Jan 17, 2019 9:47 pm
Location: Texas
Contact: Website

Re: How to make turn a custom raspberry pi install into a image?

Tue Oct 13, 2020 10:32 pm

RaspbianUser1 wrote:
Tue Oct 13, 2020 10:26 pm
You misread/misunderstood my question.
Can you turn the current working system into an image file
Oh, sorry.
No, PPT cannot do that.
Want to run Minecraft Java on your RPi? Easiest way is with Pi-Apps - just click Install.
https://github.com/Botspot/pi-apps
Pi-Apps also includes Zoom, Visual Studio, Tor browser, Windows 10 theme, and 33 more.
Over 50,000 users!

User avatar
RaspbianUser1
Posts: 495
Joined: Thu Mar 05, 2020 6:34 pm

Re: How to make turn a custom raspberry pi install into a image?

Tue Oct 13, 2020 10:37 pm

Ah ok, thank you for at least trying :)
Running either Raspberry Pi OS desktop Full or Raspberry Pi OS MATE desktop
Overclocked at 2200MHz CPU and 700 MHz GPU with a over voltage of 7
Think before you delete something a stranger on the internet told you to.

RonR
Posts: 1683
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: How to make turn a custom raspberry pi install into a image?

Tue Oct 13, 2020 10:42 pm

RaspbianUser1 wrote:
Tue Oct 13, 2020 10:13 pm
Initial image file ROOT filesystem size (MB) [3584]?

Added space for incremental updates after shrinking (MB) [0]?
What do I enter here

Simply hit the RETURN key to accept the default values.

User avatar
Botspot
Posts: 1540
Joined: Thu Jan 17, 2019 9:47 pm
Location: Texas
Contact: Website

Re: How to make turn a custom raspberry pi install into a image?

Tue Oct 13, 2020 10:43 pm

RaspbianUser1 wrote:
Tue Oct 13, 2020 10:37 pm
Ah ok, thank you for at least trying :)
No problem, thanks for asking. Once you've made your image, PPT will come in quite handy either for making a quick edit or for flashing your SD cards.
Want to run Minecraft Java on your RPi? Easiest way is with Pi-Apps - just click Install.
https://github.com/Botspot/pi-apps
Pi-Apps also includes Zoom, Visual Studio, Tor browser, Windows 10 theme, and 33 more.
Over 50,000 users!

User avatar
kerry_s
Posts: 1557
Joined: Thu Jan 30, 2020 7:14 pm

Re: How to make turn a custom raspberry pi install into a image?

Tue Oct 13, 2020 10:56 pm

it's a lot easier to backup if it's not the os your running.
if you have a spare sd card, do the clone, then you can convert the clone to an clone.img.gz.
i'm in fact doing it right know with my ubuntu install on a ssd. using a script i made.
i'm running from my usb flash drive(sda) & i'm copying my ssd drive(sdb) on to the flash drive(sda) as an .img.gz, afters i just copy the .img.gz to a backup drive. when i want it i just write it back.

this is the command i use from that part of the script.

Code: Select all

sudo dd if="$(zenity --entry --title="Device" --text="$(lsblk)" --entry-text="/dev/sdb")" | gzip > "$(zenity --entry --title="Backup" --text="Backup Name").img.gz"
Attachments
2020-10-13-124700_1680x1050_scrot.png
2020-10-13-124700_1680x1050_scrot.png (188.9 KiB) Viewed 536 times

User avatar
Milliways
Posts: 579
Joined: Fri Apr 25, 2014 12:18 am
Location: Sydney, Australia

Re: How to make turn a custom raspberry pi install into a image?

Wed Oct 14, 2020 12:45 am

RaspbianUser1 wrote:
Tue Oct 13, 2020 9:38 pm
I am really struggling here, I don't know how to use RonR's software, I don't understand what its asking from me, I can get it installed and started but I don't understand the questions its asking.

Is there a simple GUI program which can just do exactly what rpclone is doing but instead of writing to a external device, writing to an image file. I just want to be able to store my backups on the cloud rather than using an entire SD card
I routinely use a procedure (based on RonR's code - but with documentation) https://raspberrypi.stackexchange.com/a/103991/8697

This is my normal day to day backup tool which produces installable images. I use this to image a working Pi OS to a Samba share on my Mac.

User avatar
RaspbianUser1
Posts: 495
Joined: Thu Mar 05, 2020 6:34 pm

Re: How to make turn a custom raspberry pi install into a image?

Wed Oct 14, 2020 1:03 am

Thank you, I will give it a look later but from initial glance it seems ok, RonR needs to edit the post to include a walkthrough/documentation
Running either Raspberry Pi OS desktop Full or Raspberry Pi OS MATE desktop
Overclocked at 2200MHz CPU and 700 MHz GPU with a over voltage of 7
Think before you delete something a stranger on the internet told you to.

User avatar
RaspbianUser1
Posts: 495
Joined: Thu Mar 05, 2020 6:34 pm

Re: How to make turn a custom raspberry pi install into a image?

Wed Oct 14, 2020 10:36 pm

Ok, I have learnt you can't really make an img from a running install.

I can plug the install/setup into a usb adaptor then run a different raspberry pi image.
I want a img file.
What command can I use?
My install appears as /dev/sda
what command can I make an image from this
Running either Raspberry Pi OS desktop Full or Raspberry Pi OS MATE desktop
Overclocked at 2200MHz CPU and 700 MHz GPU with a over voltage of 7
Think before you delete something a stranger on the internet told you to.

RonR
Posts: 1683
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: How to make turn a custom raspberry pi install into a image?

Wed Oct 14, 2020 10:42 pm

RaspbianUser1 wrote:
Wed Oct 14, 2020 10:36 pm
Ok, I have learnt you can't really make an img from a running install.

How did you come to this (totally incorrect) conclusion?

User avatar
RaspbianUser1
Posts: 495
Joined: Thu Mar 05, 2020 6:34 pm

Re: How to make turn a custom raspberry pi install into a image?

Wed Oct 14, 2020 10:59 pm

I don't know, im just guessing as no one seems to be helping, as usual Kerry_S is being helpful and I am trying the zenity GUI script they sent
Running either Raspberry Pi OS desktop Full or Raspberry Pi OS MATE desktop
Overclocked at 2200MHz CPU and 700 MHz GPU with a over voltage of 7
Think before you delete something a stranger on the internet told you to.

RonR
Posts: 1683
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: How to make turn a custom raspberry pi install into a image?

Wed Oct 14, 2020 11:06 pm

RaspbianUser1 wrote:
Wed Oct 14, 2020 10:59 pm
I don't know, im just guessing as no one seems to be helping, as usual Kerry_S is being helpful and I am trying the zenity GUI script they sent

I was under the impression you were having success using image-backup. It definitely creates image files from a running install.

Return to “General discussion”