backing up linux
Hi
I am new to linux so I would like to know how to work with partitions and backing up and restoration of Linux. Which are the best tools available for this?? I am using linux Mint thanks kk |
depends on your specific needs. it looks like the arch wiki, etc., have a large number of options.
personally i'm a command line purist, so I use parted to work with partitions. for backups, cron runs a weekly script that tars my important files and mails them to a computer in my living room. obviously, this wouldn't be appropriate for administrating a multi-user network. a few hints if you go the scripting route: - you can check what is using up space on your computer with sudo du -h --max-depth 1 / an easy way to back up most of the important files is to tar and xz /home and /etc if they are small enough (though this is unlikely if you have, for example, a big .cache folder in your home directory used for your browser, etc.) - you can run dpkg --get-selections > packages.bak to save your package selections to a file, then restore them with dpkg --set-selections. - you can check if a file has been changed or modified before replacing it to save some space/bandwidth |
I use rsync (comes with most Linux distros). It is super fast and you can copy your backup to a new system/partition. The partition doesn't have to be the same size or larger (as is the case with dd which is another way to backup your system).
You can learn all about its use from the archwiki website: https://wiki.archlinux.org/index.php...kup_with_rsync You need to use terminal, but as you see the command is not that complicated. I would suggest using Code:
# rsync -aAHXv . . . To back up your /home, you would issue another rsync command (the command mentioned above is for the entire system). Here is an example of a /home backup: Code:
rsync -a --info=progress2 --exclude={"/Videos/*","/.cache/*"} /home/your-user-name/ /path/to/backup/media/ It is advisable to copy your root ("/") files separate from your /home files since if you bork your system, you would only have to use the backup for root to get it up and running again which would save you time. It took 25 minutes to copy my root files with rsync, and 17 minutes to copy my /home files. And it took the same amount of time to copy the rsync backup files to a new partition. Some of the info listed above comes from http://askubuntu.com/questions/54565...seless-folders Another possibility is to use dd to backup each of your partitions. Here is a clear explanation from Arch Wiki: https://wiki.archlinux.org/index.php/Disk_cloning This is a bit easier than rsync but if you are not careful (if you put the partition/path that you are copying to before the partition that you are copying from), you will have to reinstall your system. dd comes on virtually all Linux distros. You can also use Clonzilla which more or less guides you through the process (I believe it is a type of GUI and utilizes dd). You would use your package manager (dnf, aptitude, apt-get, pacman, etc) to install it. It is just as time-consuming as dd is -- it can take over an hour to copy a partition. You can use all three on any Linux distro and you can even use them on Windows and Mac. Hope this is helpful. |
Quote:
It is already installed on your live Linux Mint DVD or USB. However, it is not installed by default when you install Mint to the hard drive. So you have to install it with this command: Code:
sudo apt-get install gparted When you ask about backing up and restoring Linux, you have to be more specific. Are you thinking of backing up your operating system? Or just talking about backing up your personal data? For backing up personal data, you can learn to use the rsync commands, or tar commands. But my personal choice is the grsync program. Code:
sudo apt-get install grsync |
thank you
Really appreciated the feedback and will look into this thoroughly ,
kk |
Quote:
Otherwise... For basic, frequent backups, I use a file synchronization tool and external storage. My favorite is Freefilesync, which works and looks the same in Windows as it does in my Linux distros of choice. If you can't find or install that, there are a number of front-end GUIs for rsync. grsync is pretty good. The first backup takes a long time depending on how much data you have. Subsequent backups are differential-incremental and go very fast. For settings, I like to take my Firefox settings with me. Just show hidden files and folders in home. The hidden folder .mozilla can be copied somewhere and restored to its new home. Additionally, as a second line of defense, make a full backup of home using duplicity and its front-end deja-dup. For application reinstallation your package manager can save a list of current programs for one-shot reinstallation (exception->software from PPAs). |
+1 Clonezilla for backing up an entire drive or partition, especially once all the programs wanted are installed and configured as desired. It takes but a short time to get used to its workings and many images may be backed up on a USB device. Many times I have gone back to a stored image after a failed dist-upgrade or a screwed up system for one reason or another.
|
I noticed my example of rsync backup of /home is incomplete. I forgot to include and name the directory where the backup directories/files will be placed (otherwise they will be scattered among other files/directories).
Here is a corrected command: Code:
# rsync -a --info=progress2 --delete --exclude={"/Videos/*","/.cache/*"} /home/name-of-user/ /path/to/backup/media/Rsync-home-backup-Dec2015/ Notice the --delete option. You would add this option so that when you run the backup later (weekly,daily,etc.), rsync would only add/delete what has changed. Also notice that the directories that you are backing up and the directory where you are storing the backup must end in a forward slash (/). |
rsync gets my vote as it is very flexible, you might want to think about how you use the "--exclude-from=" option.
If you want restore it to a fresh install (because the original is foobared) then the new install will have its own set of . files, possibly different from those on your original, so write an exclude file to include all of those. Fred. |
Thank you once again! Iwill give rsync a shot
kk |
Quote:
Then do rsync backup for folders that keeps updating. If the server or machine goes south, restore the clone to a new VM or hardware then do an rsync for the latest backup and keep on going. I used Clonezilla to clone a 10 year old server and restore to VM and works just fine. |
There is a backup option for my VPS, so i used that graphics user interface to back up my Linux box. I am not that a tech guy, lol
|
Quote:
It works fine with no slashes at the end. Code:
rsync -r -t -p -o -v --progress --delete -u -s --exclude-from=sdb2_data/MyStuff/Computing/grsync-exclude.txt /home/dan/sdb2_data/MyStuff /media/dan/sdd2_413gb |
Quote:
So neither using it or leaving it off is correct or incorrect, but it does change the behavior of the command, so you need to use the correct syntax for your application. |
Yes, got it.
/home/suicidaleggroll copies /home/suicidaleggroll and all directories therein (when using -r). /home/suicidaleggroll/ copies only all directories, but not /home/suicidaleggroll |
All times are GMT -5. The time now is 01:11 PM. |