This is a static archive of the old Zorin Forum.

The information below may be outdated. Visit the new Zorin Forum here ›

If you have registered on the old forum, you will need to create an account on the new forum.

Back up Clone Image and Restore using DD

Aravisian

Thu Jan 03, 2019 12:38:01 pm

Being unfamiliar with Linux and Terminal, I am prone to make disastrous mistakes. I have already had to wipe and reload... This may help others, as well.
I would like to start a process of backing up a clone image of my drive on a regular basis on an external drive that I can restore from in the event it is necessary. My plan is a bit complex. So, needless to say, I have a lot of questions. It may not need to be that complex.
I have written up a short guide for myself with the references I used listed in three websites at the top of the 'write up.' This 'write up' is pasted at the bottom of this post. You will notice some of the lines in it are copy and pasted from the source articles linked at the top.
Looking for someone more knowledgeable than myself that is willing to help myself and readers understand it and to execute it with good results. The back up; I think I have some rudimentary understanding of. The restore part- not so much.
B.U. and Restore
https://wiki.archlinux.org/index.php/di ... g#Using_dd
https://wiki.archlinux.org/index.php/Dd ... nd_restore
https://www.makeuseof.com/tag/easily-cl ... -image-dd/

sudo terminal first

dd if=/dev/sd(X) of=/dev/sd(Y)

sd(X) is primary drive and sd(Y) is secondary. Use Gparted to find disk names. In my case, sda is my hard drive. So:
dd if=/dev/sda of=/dev/sdY

dd if=/dev/sda of=/dev/sdb bs=64K conv=noerror,sync status=progress
Note:
Be careful that if the output partition of= (sdb1 in the example) does not exist, dd will create a file with this name and will start filling up your root file system.
bs= increases block size for faster file transfer. noerror causes utility to continue to read if there is an error instead of halting.
sync fills errors blocks with zeroes to keep data offset in sync.
status=progress shows statistics of transfer and Estimated Time of Completion. Increasing block size also increases risk of an error filling larger blocks.
Note:

To regain unique UUIDs of an ext2/3/4 filesystem, use tune2fs /dev/sdXY -U random on every partition.

RESTORE:

sudo dd if=/dev/sda conv=sync,noerror bs=64K | gzip -c > /path/to/backup.img.gz

Finally, save extra information about the drive geometry necessary in order to interpret the partition table stored within the image. The most important of which is the cylinder size.

fdisk -l /dev/sda > /path/to/list_fdisk.info

gunzip -c /path/to/backup.img.gz | dd of=/dev/sda

First and most obvious question: When booting up to a restored clone image, would it be the same as if I booted up normally from the time period that the back up was made? As in, all my settings and tweaks would be in place, proper wallpaper on the screen and customization and software present?
First thing the sites tell you as that your backup drive must be equal to or larger than your source drive. That is a tall order on on po'boy like myself... Surely the backup drive needs to only be larger than than what I am using on my system, right? So if I am using a 16gig flash drive (which is much bigger than the space I am occupying on my hard drive), that should be sufficient, right?
Above it says from arch, "use tune2fs /dev/sdXY -U random". I am a mechanic. If you happen to be unfamiliar with mechanical and I say, "use a torque wrench to check your torque specs" you may just say, "yeah, sure, sure... thanks... What is a torque wrench, what are the specs and how do I do that?" I do not understand "use tune2fs."
I appreciate any help or insight offered. Hopefully, an efficient and useful 'restore' process can be created.

Finston Pickle

Thu Jan 03, 2019 7:25:12 pm

If you search for threads about "Redo", you will find a GUI method to back up your .iso image of your machine. You may feel more comfortable using Redo.

I use an external HDD of the same size as my machine's HDD to do this.

I also back up all my home settings using the built in app "backups" to a further, same sized HDD. This should be done more often than redo, but I tend to do them both, sequentially, about every three to six months.

I have never had to restore either yet - but I am confident that it would work.

I periodicall run into probles like "not enough disk space" and find that reformatting the external HDD to the same format it started with, using the inbuilt app "disks", sorts out the issue.

It is a shame, but Redo can only restore the .iso to the original machine - not being able to clone your machine to a fresh PC - for some reason I don't understand. I think that DD is the same.

zorinantwerp

Thu Jan 03, 2019 9:21:13 pm

Hi

Noted your explantion with interest. Complexity is often born with the learning curve into a new OS.
It is not clear to me if you indeed run ZORIN OS but be aware that 'Archlinux' is not for mortals so steer away from their philosophy and commands :)

For me 'Clonezilla' is available as a bootable ISO, which you can burn to DVD or write to a USB stick. Clonezilla is straightforward to use, opting for keyboard-driven menus, rather than obscure commands, meaning that anyone can get to grips with it.

check out with Harold.
Code:
https://www.youtube.com/watch?time_continue=3&v=41tTudaQb0I&ab_channel=RichardLloyd


good luck

Aravisian

Thu Jan 03, 2019 10:35:51 pm

Thanks to you both.
Yes... this is one of those fields where opinions vary... I have been recommended clonezilla as much as strongly recommended to avoid it like plague.
I built three of my first conky's yesterday, operating on my desktop as I type this. Yes, I am very green to Linux, but not afraid to learn.
So, while it is probable that I will use a GUI for now just to be safe... I'd like to learn the dd method, as well. I'll look into Clonezilla, again. Maybe test it out. While a mistake in using dd could be deadly (That is why to back up, right? :) ), it is also a very easy method and may be more foolproof than a GUI due to less functions to create errors, it seems.

I have been using the built in BackUp. I do not know how to use it to restore, though... I have found very little information on its actual use, strangely. You click back up and it says it backs up... It doesn't way where it went. It's like when you flush during potty training; left standing there scratching your head wondering where it went.
Or using a toaster for the first time. You put it bread and then later, toast pops out and you wonder where the bread went to.
I finally found the back up looking in (..) where I cannot write to it or copy or move it. So, as it is one the machine it backed up, I cannot see how I can trust it.
For now, I was thinking about backing up once every Sunday evening. IF I was able to use gigsticks for the task, I would back up one week on one, then the next week on the other, alternating back and forth ticking off each one on a chart I made on the front of the boxes that hold each. I did say my plan was complicated... But it seemed that was the best way to minimize loss.

Yes, I am exclusively running Zorin 12.4 core on this computer, one partition.

Swarfendor437

Fri Jan 04, 2019 8:45:34 pm

I can highly recommend redobackup - get it from here:

https://sourceforge.net/p/redobackup/wiki/Home/

They used to have their own site but the domain is up for sale. Whilst the project is no longer live the redobackup software works for Windows and GNU/Linux alike. The only thing you need to be aware of though is it cannot resize (shrink) to fit to a smaller drive - it has to be the same or larger and it is only 249 Mb with a very nice and crucially simple interface. ;) :D

Finston Pickle

Sun Jan 06, 2019 7:34:47 pm

Again, I would suggest using Redo for the O/S and Backups for the most recent "home" settings

Swarfendor437

Sun Jan 06, 2019 11:08:19 pm

If you want to just backup data and settings make sure you show hidden folders (Ctrl+ H) when in /home directory then just select your user name in /home and drag to an external drive. ;) :D

Aravisian

Mon Jan 07, 2019 1:34:24 am

Swarfendor437 wrote:If you want to just backup data and settings make sure you show hidden folders (Ctrl+ H) when in /home directory then just select your user name in /home and drag to an external drive. ;) :D

I would never have thought of that. Not something you can do on the popular O.S. That would cover the essentials, even if it is not the whole system and software.
I did examine Clonezilla and I admit, it just felt a little too touch and go to me. Redo looks more usable to me.

Aravisian

Fri Jan 25, 2019 12:35:48 pm

Yesterday, while following a tutorial on how to solve an issue, the write up said to
Code:
sudo apt-get install python-xlib

So, I did. The issue was not resolved and since I Clean Up after myself, I then ran
Code:
sudo apt-get remove python-xlib

Some of you are probably shaking your head right now.

THIRD time of having to reinstall the O.S.
(And note to all; Never run "remove python-xlib" unless you want to watch most of Gnome and the O.S. apparently go with it.)

There was some luck; I had run Deja-dup (Duplicity) the day before and saved the output on my flash drive. It helped... I had to reinstall all programs (As well as remove unwanted ones) and then put all the tweaks back in place (That's right, Azenis is back, baby!)
I removed Thunar and am using SpaceFM (File Manager, now.) I really like it's power a lot better though the above suggests it is too dangerous for me.
Oh well...
Deja-Dup only returns an error of "Permission denied" everytime I try to run a back up, now. I uninstalled it completely (Purged) and reinstalled it and same result. Pruged, again and:
Anyone have any recommendations for a good Backup Utility?
I seem to need one...


I have downloaded Redo.iso (Their website domain is up for sale, by the way) and Unetbootin but that must wait until I can buy a flashdrive to accommodate it.

Swarfendor437

Fri Jan 25, 2019 12:55:42 pm

I suspect the site is up for sale because of the cost of hosting. redobackup is obtainable from:

https://sourceforge.net/projects/redobackup/files/

As to your misdemeanour, we've all been there... one of the reasons I always approach the command:

Code:
autoremove...


With EXTREME caution!!! ;) :D

Aravisian

Fri Jan 25, 2019 1:24:26 pm

Swarfendor437 wrote:I suspect the site is up for sale because of the cost of hosting. redobackup is obtainable from:

https://sourceforge.net/projects/redobackup/files/

As to your misdemeanour, we've all been there... one of the reasons I always approach the command:

Code:
autoremove...


With EXTREME caution!!! ;) :D

Sometimes, we learn with bruises.
I did get redo.iso from sourceforge but had clicked the "Support" tab while there and ended up at a chalkboard, instead.
But I will try to make a backup with it when I get an external hard drive or a gigstick.
In the meantime, a light backup utility still could help. DejaDup helped a little bit in this case (Though many of the folders that claimed to hold files only held 0kb sized files all through them. Discovering that sucked.)

It's funny, I did a search on "remove python-xlib" and I found NOTHING that would indicate it would remove so much necessary stuff with it. Yet, that is what happened. I ran "sudo apt-get remove python-xlib" and then watched the terminal list off all manner of things being removed, including Zorin Appearance, tweak tool, GTK, gnome backend... I figured trying to stop the process was too late and it MAY know what it is doing... After Terminal closed, things seemed normal for a moment, then things started to hang, then crash. I rebooted and that was when it was all over. Would NOT have seen that coming.

EDIT: I should point out for the record I did a search on removing python-xlib after I had already laid waste to my operating system with TsarBomba.

Aravisian

Fri Jan 25, 2019 5:11:10 pm

Currently copying (recursively) all folders from home folder to a recovery folder on USB disk.
If my O.S. dies of dysentery, again - How do I apply that back to a fresh install? dconf and dbus folders are not moving over since I lack permissions and knowledge...

Swarfendor437

Fri Jan 25, 2019 5:46:53 pm

There are some similarities between GNU/Linux to that other OS - System files in use can't be moved. What you do is ensure all hidden files are shown in your /home folder, create folder on backup device named after your user name, open it and drag all your folders across from /home into the backup folder. After fresh install make sure any apps not present in Zorin are installed. Then open your home folder, delete all the new items and replace with ones from backup folder so all your apps settings are back to the way rhey were before it went West, South or whatever. ;) :D

Aravisian

Sat Jan 26, 2019 1:47:35 am

Swarfendor437 wrote: After fresh install make sure any apps not present in Zorin are installed.

I think I will make an app install list, then. I should have done that sooner.
After the last experience, I realized I needed a few reminders. Some of my conky's broke after re-install. I couldn't remember what I had done before to get them working. This time, wrote out repair instructions using a text editor and saved that file.
I also made a couple other sets of instructions for how to install some tricky objects.
Swarfendor437 wrote:Then open your home folder, delete all the new items and replace with ones from backup folder so all your apps settings are back to the way they were before it went West, South or whatever. ;) :D

Sounds easy enough. This answers a question I made in another thread, as well; As to what was in root that determined the tweaks or settings of my system.
Thanks for all the help. Taking the guesswork out is a large relief.