Simple question, how to backup OS installed on eMMC?
eMMC backup
|
06-30-2017, 12:26 PM
Where are you looking to back it up? on an SD drive? a USB drive? Another local host? cloud or similar?
------
it doesn't get happy it doesn't get sad it just runs programs
06-30-2017, 12:31 PM
07-01-2017, 03:52 PM
Any feedback?
07-01-2017, 03:56 PM
(This post was last modified: 07-01-2017, 03:58 PM by MarkHaysHarris777.)
(07-01-2017, 03:52 PM)amilino Wrote: Any feedback? hi, you use a dangerous tool called dd to write an 'image' file to another device, like usb, and then you compress it with gzip. dd stands for 'humorously' Disk Destroyer kidding; ... be careful ; it will destroy your drives if you're not careful or don't know what you're doing. read the man page: man dd Join us on chat (see below for irc address) and we'll help you with it.
marcushh777
please join us for a chat @ irc.pine64.xyz:6667 or ssl irc.pine64.xyz:6697 ( I regret that I am not able to respond to personal messages; let's meet on irc! )
The basic idea is to use dd to read the eMMC, and save it to a file. To image the eMMC, it's best to boot from a SD image, so you don't have to deal with issues from backup up a "live" system. When you boot from the microSD, the eMMC is visible as /dev/mmcblk1. You'll want some progress whilst copying, and you'll probably want to compress the file so you don't have a 16GB file which really only has around 3GB of stuff in it. Hence the use of gzip, as it'll compress stuff a bit, and also ignore all the empty space.
So you could do something like this (where /media/pine64/64GB_USB3 was the mount folder for my usb drive, and eMMC_backup.img.gz was the name I chose to save the file as): Code: dd status=progress bs=512 if=/dev/mmcblk1 | gzip > /media/pine64/64GB_USB3/eMMC_backup.img.gz But we can do better than that. gzip is a bit slow still, it only uses one of the four pinebook cpu cores, which seems a bit of waste, as that wil make it so the copy will take a quite a long time. pigz, on the other hand, is a gzip compatiable compressor with a difference... it will use all the cpu cores available. Consequently a 2516 second transfer instead took 970 seconds, just by switching to pigz. And is even faster if the --fast parameter is used, still with light compression and no storage of empty space benefits. So my prefered option, after doing a sudo apt install pigz to install it, is the following: Code: dd status=progress bs=512 if=/dev/mmcblk1 | pigz --fast > /media/pine64/64GB_USB3/eMMC_backup.img.gz And to restore the backup? The traditional: Code: gunzip -c /media/pine64/64GB_USB3/eMMC_backup.img.gz | dd of=/dev/mmblk1 bs=512 status=progress or the much faster: Code: pigz -d -c /media/pine64/64GB_USB3/eMMC_backup.img.gz | dd of=/dev/mmblk1 bs=512 status=progress should do the trick. However, since the of parameter of good 'ol disk destroyer is being used here... make sure you don't type this one wrong.... as you might find yourself writing the image to the wrong drive with disasterous consequences! And as a side note, as the OP found out, if you are using NTFS formatted drives, ntfs-3g isn't installed by default, so a quick sudo apt install ntfs-3g is needed to enable NTFS write support.
For backup purposes maybe also look into dcfldd , which is a fork of dd that also supports hashing and verification on the fly...
Come have a chat in the Pine IRC channel >>
07-02-2017, 07:54 AM
Thank you, it is working. Created backup successfully.
pfeerick's suggestion is probably what I would do. It is clear, works on almost any unix-type OS build from the past 30-35 years (though I doubt you'll find pigz easily available for early 90s SCO boxen, heh), and it's good to know what these userland utils do.
------
it doesn't get happy it doesn't get sad it just runs programs
07-03-2017, 10:53 AM
(This post was last modified: 07-03-2017, 10:54 AM by MarkHaysHarris777.)
(07-03-2017, 10:49 AM)zer0sig Wrote: pfeerick's suggestion is probably what I would do. It is clear, works on almost any unix-tpe OS build fro the past 30-35 years (though I doubt you'll find pigz easily available for early 90s SCO boxen, heh), and it's good to know what these userland utils do. Indeed ! ... and pfeerick was actually brave enough to explain it on-line , in front of God and everyone , without qualification and with poise ! (and the OP actually used it without destroying anything!) (impressive)
marcushh777
please join us for a chat @ irc.pine64.xyz:6667 or ssl irc.pine64.xyz:6697 ( I regret that I am not able to respond to personal messages; let's meet on irc! ) |
Users browsing this thread: 3 Guest(s)