LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   What's the best (and simplest) way to make a system backup/image/snapshot? (https://www.linuxquestions.org/questions/linux-newbie-8/whats-the-best-and-simplest-way-to-make-a-system-backup-image-snapshot-4175637936/)

Gregg Bell 09-06-2018 10:31 PM

What's the best (and simplest) way to make a system backup/image/snapshot?
 
I'm contemplating an upgrade (or fresh install) from Xubuntu 16.04LTS to Xubuntu 18.04LTS and I've been duly warned to make a system backup/image/snapshot before attempting it. I have backed up my Home folder on Back in Time, but not the system I guess. What's the simplest way of making such a backup? Thanks.

Honest Abe 09-06-2018 11:06 PM

Not so sure about best, but surely pretty simple -

Code:

dd if=/dev/sda conv=sync,noerror bs=64K | gzip -c > /PATH/TO/DRIVE/backup_image.iso.gz
makes a clone of a disk, compresses on the fly and writes to a file. It is run from single user mode to reduce overhead IO.

Note: This is a full metal backup/complete disk (bitwise) backup.

hydrurga 09-07-2018 01:13 AM

Have a look at Clonezilla to make an image of your system partition(s). Store the image on an external hard drive or similar.

Gregg Bell 09-07-2018 12:55 PM

Quote:

Originally Posted by Honest Abe (Post 5900761)
Not so sure about best, but surely pretty simple -

Code:

dd if=/dev/sda conv=sync,noerror bs=64K | gzip -c > /PATH/TO/DRIVE/backup_image.iso.gz
makes a clone of a disk, compresses on the fly and writes to a file. It is run from single user mode to reduce overhead IO.

Note: This is a full metal backup/complete disk (bitwise) backup.

Thanks Abe. Unfortunately, with my lack of knowledge of terminal commands that seems pretty complicated to me.

Gregg Bell 09-07-2018 12:57 PM

Quote:

Originally Posted by hydrurga (Post 5900780)
Have a look at Clonezilla to make an image of your system partition(s). Store the image on an external hard drive or similar.

Thanks hydrurga. I'm going to check out Clonezilla.

jefro 09-07-2018 02:53 PM

It rather depends on what you want to save.

Saving ...
A list of installed programs may help.
Entire image may help.
Only unique data that you have like home or download, documents and such may help.
Gparted can save a partition off.

Clonezilla and dd can assist in a full or partial image if you intend to return to 16. Otherwise it may not be easy to get unique data off the image.

frankbell 09-07-2018 06:44 PM

I would recommend back up your home directory and any system configuration files that you have changed. Those would be files in /etc.

I normally do not back up configuration files that I have left at default.

Gregg Bell 09-07-2018 09:14 PM

Quote:

Originally Posted by jefro (Post 5900993)
It rather depends on what you want to save.

Saving ...
A list of installed programs may help.
Entire image may help.
Only unique data that you have like home or download, documents and such may help.
Gparted can save a partition off.

Clonezilla and dd can assist in a full or partial image if you intend to return to 16. Otherwise it may not be easy to get unique data off the image.

Thanks jefro. That makes sense. I definitely need to make a list of installed programs. And I'm figuring doing the Clonezilla
full image can't hurt. What do you mean, though, about Gparted saving a partition off?

Gregg Bell 09-07-2018 09:15 PM

Quote:

Originally Posted by frankbell (Post 5901051)
I would recommend back up your home directory and any system configuration files that you have changed. Those would be files in /etc.

I normally do not back up configuration files that I have left at default.

Thanks Frank. That sounds wonderfully simple. So I can just save the whole /etc folder onto a usb drive?

Honest Abe 09-08-2018 04:06 AM

Quote:

Thanks Abe. Unfortunately, with my lack of knowledge of terminal commands that seems pretty complicated to me.
No biggie Gregg, use a solution that suits you. But don't get scared of the CLI.
If you have chosen to stick with a *NIX distro, why not unleash its full potential ? Remember every command comes with a manual (and info) to show what it arguments are used for and few has examples too.

AwesomeMachine 09-08-2018 10:27 AM

For an upgrade you don't need to image the drive. Just back up /home, and any custom config files. Anyway, if you image the entire disk, you probably won't be able to mount the image. You'd need to restore it to a disk to really do anything with it.

rokytnji 09-08-2018 10:37 AM

Quote:

What's the best (and simplest) way to make a system backup/image/snapshot?
i'd say redo backup might be up your learner curve alley. Works like Acronis ghost and other paid Windows applications for this function.

http://redobackup.org/

Isos of your installed system are fine and dandy but there are other ways to think of backup. "dd" and "tar" and 'zip"
of a installed system. Booting your Ubuntu live CD.

Then format the drive partitions how you wish.
Move that zipped compressed file you dd made and uncompress it in / partition.

Shut down the live cd and computer. Reboot. you should now boot up to your old byte for byte copied system just like if you booted up a iso but instead of read only. It is also writable.
my saved command for what I describe that copys rub bootloader and the whole mess is. use sudo

the below command I use i give props to rubberman at linuxforums.com. It is not mine.

to zip up < /home is on root / partition to make this command simpler >

Code:

dd if=/dev/sda | gzip -c >/media/disk/system-image.gz
/media/disk is your external drive /media/sdb. system-image.gz is what you are inserting and zipping up in there.

to uncompress in my emptied linux formatted hard drive with a linux file system and partions.
in a live cd again . go into where you have that file sitting system-image.gz on you external usb drive

Code:

gunzip -c /media/disk/system-image.gz | dd of=/dev/sda
In case I left anything out. Here is the rest of my notes

Quote:

Boot up your Live Mepis DVD.
2. Open a terminal window on the GUI desktop.
3. Switch to the root account with the command su
4. Plug in the external drive. If it is recognized a disc icon will appear on the desktop. If it isn't then you will need to mount it manually. We'll assume it is auto-mounted. It should be mounted as /media/something where something may be "disk" or some other label. You will need that path to backup the system disc. Whatever you do, DO NOT mount or try to access the system disc at this time.
5. Assuming that the external drive was mounted as /media/disk, execute the following command in the command-line window:, refer to my command in upper part of this post to zip up your install.MBR, grub, and all.
Edit; in case the mount words confuse you. most DE show on the desktop the drive when it is plugged in. but it is not mounted yet. You can check with right click. if it says mount. Don't touch it.
That is what I mean by my mount words.

2nd Edit; If it says unmount because you have automount enabled for whatever reason. Unmount it with the right click menu then.

mark_alfred 09-08-2018 10:58 AM

When I used Ubuntu, I think it came with deja-dup as its backup utility. It was good. It could be opened in the Ubuntu settings area, where there should be a "backup" option. Or, it can be run via the command "deja-dup-preferences", which gives a GUI to do a backup. Just check that deja-dup is installed, via Synaptic or via your favourite package management tool.

Gregg Bell 09-08-2018 04:30 PM

Quote:

Originally Posted by Honest Abe (Post 5901141)
No biggie Gregg, use a solution that suits you. But don't get scared of the CLI.
If you have chosen to stick with a *NIX distro, why not unleash its full potential ? Remember every command comes with a manual (and info) to show what it arguments are used for and few has examples too.

Thanks Abe. You're right. I'm getting a little better at using CLI. Slowly. lol

Gregg Bell 09-08-2018 04:45 PM

Quote:

Originally Posted by rokytnji (Post 5901227)
i'd say redo backup might be up your learner curve alley. Works like Acronis ghost and other paid Windows applications for this function.

http://redobackup.org/

Isos of your installed system are fine and dandy but there are other ways to think of backup. "dd" and "tar" and 'zip"
of a installed system. Booting your Ubuntu live CD.

Then format the drive partitions how you wish.
Move that zipped compressed file you dd made and uncompress it in / partition.

Shut down the live cd and computer. Reboot. you should now boot up to your old byte for byte copied system just like if you booted up a iso but instead of read only. It is also writable.
my saved command for what I describe that copys rub bootloader and the whole mess is. use sudo

the below command I use i give props to rubberman at linuxforums.com. It is not mine.

to zip up < /home is on root / partition to make this command simpler >

Code:

dd if=/dev/sda | gzip -c >/media/disk/system-image.gz
/media/disk is your external drive /media/sdb. system-image.gz is what you are inserting and zipping up in there.

to uncompress in my emptied linux formatted hard drive with a linux file system and partions.
in a live cd again . go into where you have that file sitting system-image.gz on you external usb drive

Code:

gunzip -c /media/disk/system-image.gz | dd of=/dev/sda
In case I left anything out. Here is the rest of my notes



Edit; in case the mount words confuse you. most DE show on the desktop the drive when it is plugged in. but it is not mounted yet. You can check with right click. if it says mount. Don't touch it.
That is what I mean by my mount words.

2nd Edit; If it says unmount because you have automount enabled for whatever reason. Unmount it with the right click menu then.

Thanks a lot, rokytnji, for all the great info. I went to Redo and read the page and that does really look like something I could do. And thanks for passing along the commands.


All times are GMT -5. The time now is 01:17 AM.