E
E
Evgeny Dolbanovsky2018-05-29 20:40:34
Debian
Evgeny Dolbanovsky, 2018-05-29 20:40:34

How to make an image of an installed Debian OS on a server?

We have a freshly installed and configured OS Debian 9 on the server:
1st vps server
2nd raspberry pi 2 server
How to create an image for quick deployment of the system in case of a crash?
I do it simply:
1 shutdown (so that the processes end) and turn off the power after a minute
2 pull out the flash drive with the system from the raspberry, insert it into the laptop with Ubuntu and through dd make an image in blocks of 1 megabyte by 3500 mb from the beginning of the disk with the system, with a margin of + 500 mb so that do not cut off part of the system.
dd if=/home/art/images.img of=/dev/sdb conv=sync,noerror bs=1M count=3500
3. I format the flash drive with which I made the image, upload the created image back to the flash drive, insert it into the raspberry, and deploy the system to the entire flash drive and everything works fine, there are no critical errors in the logs.
Now the question is, what am I doing wrong?
After creating the image, I upload it back to the USB flash drive, such a scheme always works, but as soon as the working system catches a crash, for some reason the deployed image does not work.
That is, we catch a crash, go and upload the image of the working system, but it refuses to work, although the image was made from a stable system, and for the first time after creating the image, it unfolds and works until the crash.
Tried: formatting of all kinds and special software, different flash drives (did not try external hdd), Debian 7,8,9.
Some kind of mysticism, but I feel it’s about creating an image, I’m doing something wrong) Help kind people, who can do anything)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
Puma Thailand, 2018-05-29
@opium

You need to ddshit the entire flash drive and not a piece

D
Dmitry Shitskov, 2018-05-30
@Zarom

If you need a compact image, then it is better to use software for creating images, for example. Clonezilla, which incl. if necessary, it can also create an image using the dd method.

F
fpir, 2018-05-30
@fpir

You can backup the system with tar, in which case you can return to the previous state, depending on which directories you will restore. At the same time, grub will need to be restored separately (in the event of a fatal destruction of the media, for example)
Here, in more detail , sorry, I didn’t really read it, the first one was Google, but it seems to be about that.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question