LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-06-2018, 10:31 PM   #1
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Rep: Reputation: 176Reputation: 176
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.
 
Old 09-06-2018, 11:06 PM   #2
Honest Abe
Member
 
Registered: May 2018
Distribution: CentOS 7, OpenSUSE 15
Posts: 420
Blog Entries: 1

Rep: Reputation: 202Reputation: 202Reputation: 202
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.
 
1 members found this post helpful.
Old 09-07-2018, 01:13 AM   #3
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Have a look at Clonezilla to make an image of your system partition(s). Store the image on an external hard drive or similar.
 
1 members found this post helpful.
Old 09-07-2018, 12:55 PM   #4
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by Honest Abe View Post
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.
 
Old 09-07-2018, 12:57 PM   #5
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by hydrurga View Post
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.
 
Old 09-07-2018, 02:53 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,029

Rep: Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632
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.
 
1 members found this post helpful.
Old 09-07-2018, 06:44 PM   #7
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,421
Blog Entries: 28

Rep: Reputation: 6167Reputation: 6167Reputation: 6167Reputation: 6167Reputation: 6167Reputation: 6167Reputation: 6167Reputation: 6167Reputation: 6167Reputation: 6167Reputation: 6167
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.
 
1 members found this post helpful.
Old 09-07-2018, 09:14 PM   #8
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by jefro View Post
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?
 
Old 09-07-2018, 09:15 PM   #9
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by frankbell View Post
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?
 
Old 09-08-2018, 04:06 AM   #10
Honest Abe
Member
 
Registered: May 2018
Distribution: CentOS 7, OpenSUSE 15
Posts: 420
Blog Entries: 1

Rep: Reputation: 202Reputation: 202Reputation: 202
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.
 
1 members found this post helpful.
Old 09-08-2018, 10:27 AM   #11
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
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.
 
Old 09-08-2018, 10:37 AM   #12
rokytnji
LQ Veteran
 
Registered: Mar 2008
Location: Waaaaay out West Texas
Distribution: antiX 23, MX 23
Posts: 7,162
Blog Entries: 21

Rep: Reputation: 3485Reputation: 3485Reputation: 3485Reputation: 3485Reputation: 3485Reputation: 3485Reputation: 3485Reputation: 3485Reputation: 3485Reputation: 3485Reputation: 3485
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.

Last edited by rokytnji; 09-08-2018 at 10:43 AM.
 
1 members found this post helpful.
Old 09-08-2018, 10:58 AM   #13
mark_alfred
Senior Member
 
Registered: Jul 2003
Location: Toronto, Ontario, Canada
Distribution: Ubuntu Linux 16.04, Debian 10, LineageOS 14.1
Posts: 1,572

Rep: Reputation: 210Reputation: 210Reputation: 210
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.
 
1 members found this post helpful.
Old 09-08-2018, 04:30 PM   #14
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by Honest Abe View Post
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
 
Old 09-08-2018, 04:45 PM   #15
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by rokytnji View Post
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] HP MX310 Linux Server Backup Failure (How do I make a bootable CD? Recovery Image?) esyson Linux - Newbie 3 06-30-2015 05:42 PM
Make a complete snapshot/backup image of slackware MattFly Slackware 12 05-16-2015 02:15 AM
Backup System Image mhm Linux - Server 4 11-28-2007 06:51 AM
How to make an image backup of my HDD? alibeheshti Linux - Newbie 9 06-01-2007 12:13 PM
system backup HD image nicolas765 Linux - General 2 02-28-2007 06:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration