1

I'm running this OS version on my raspberry pi version 4 ...

# uname -a
Linux raspberrypi 5.10.17-v7l+ #1421 SMP Thu May 27 14:00:13 BST 2021 armv7l GNU/Linux

I want to clone my current OS into a bootable image file without the use of an sdcard. Here is why I want to do this: I need to send the bootable image to a colleague over the internet for him to install onto his own sdcard, and he needs it today. He's in Japan and I'm in the U.S., so there is no time for me to ship him an sdcard.

I know that I could clone my OS onto an sdcard and then extract the image from that card. However, I don't have an extra sdcard now, and I don't have the means to go out and purchase an sdcard within the next day or so.

Therefore, could anyone suggest a way that I could directly clone my OS into a bootable image file either on the Raspberry PI itself, or onto an external computer?

Thank you very much for any suggestions.

PS: I want a full clone with all the filesystems, including /home, /etc, /var, etc. My colleague needs his raspberry pi to be identical to mine, including with all the user data being the same.

PPS: I now see that I have made this much more complicated than necessary. Since my sdcard contains all my raspberry pi filesystems, all I need to do is [1] shut down the raspberry pi (after doing a sync, to make sure); [2] eject the sdcard; [3] mount it on my linux box; [4] copy the disk image. Also, the link which was kindly and generously supplied by @SteveRobillard (below) offers a few other possibilities, one of which being image-util, which was also kindly suggested by @Seamus, below, and which I have now utilized to successfully make the image file.

HippoMan
  • 111
  • 2
  • https://raspberrypi.stackexchange.com/questions/311/how-do-i-backup-my-raspberry-pi – Steve Robillard Jun 11 '21 at 22:53
  • Thank you! The "ssh" from /dev/mmcblk0p1 might be the way to go. However, I now realize that I am probably missing an obvious solution that is even easier. All my filesystems are stored on the raspberry pi sdcard because there is no other storage, correct? If so, all I have to do is shut down the raspberry pi, eject the sdcard, mount it on my linux machine, and clone the image to my linux box. Correct? – HippoMan Jun 11 '21 at 23:02
  • There are several Q&A here that may solve your problem. Personally, I like the `image-utils` solution because: 1. It produces a bootable image file that can be shared & easily written to an SD card. 2. It is fast - ~ 4 minutes on my RPi 4B 3. It yields the smallest possible file – Seamus Jun 11 '21 at 23:12
  • Thank you very much. I am now trying `image-utils`. It seems to be taking significantly longer than 4 minutes, but that's fine. I see the .img file is growing, so I know it isn't hung. This is the solution I needed. Thanks again! – HippoMan Jun 11 '21 at 23:30
  • If you have a Windows computer, you can use win32diskimager to read from the card into a file. Note that you will have to create a blank file and then select it in the program before pressing read. It will produce a byte-to-byte disk image file (so a 32GB sd card will produce a 32GB file) so it doesn't compress really well and can be huge - most of my 1TB drive is full of raspberry pi disk image backups ;) – Unsigned_Arduino Jun 12 '21 at 15:25
  • Glad you found it useful. Re speed: I guess that's a function of the medium on which you're saving the image file (write speed), and the volume of data on your SD card. I use the "Lite" RPi OS distro, so mine is relativey small. – Seamus Jun 13 '21 at 00:10

0 Answers0