LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-18-2008, 01:42 PM   #1
Cotobear
Member
 
Registered: Nov 2007
Location: Canada
Distribution: Slackware 12.0
Posts: 100

Rep: Reputation: 16
Back up slack


Hey everyone, hope the week went well for you all.

I just recently screwed up my slack distribution to the point of no return and did a fresh install. Now that I've got everything working without any superfluous crap floating around on the computer, I figured it'd be nice to back up the system so that I can restore to this point if it ever happens again that I have to start over.

There's quite a few guides out there on backing up linux, but I was wondering if anyone had suggestions on programs/guides that worked well for them.

Thanks in advance,
Coto
 
Old 01-18-2008, 02:09 PM   #2
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Back up what you've changed after setup. This means:

- your home directory, where all your own data should be, including personal settings in the "hidden" directories whose name begins with a dot
- those system-wide configuration files that you have altered either manually or trough some sort of "front-end"
- if you have installed some files to the filesystem that are not available trough the usual .tar.gz package system or available from the reposities
- packages that you have downloaded and installed, unless they are available in the reposity (if you store them under your home directory, they'll come along with the first step)

That's pretty much it. You can get the software from the reposities so there is no point in backing that up; your home directory fills probably most of the backup. If you have altered system wide configuration files you can either do it again after a fresh install, or grab them along and afterwards put them back, as long as the target system still understands those configuration files.

If you like, you can make a list of what you've changed, and then a script that copies those files to a backup directory (or archive) and when called with a different argument (for example, or a different script), copies them back to their original places. It's rather easy. But if you haven't changed the system-wide configs a lot, maybe just wireless configuration files (like wpa_supplicant) or something, it's easier to just copy those and not make a script out of it.

In Linux backing up is relatively easy, because just about everything consists of files, and there is no registry (as in Windows). And user data is in the home directory.

Of course if you have a spare harddisk identical to that you currently use, just use dd to make a 1-to-1 image from your harddisk. Surely the easiest way, though taking and putting back the backup takes some time, and consumes quite a lot of space I'd just backup homedir and the important configs.

There are programs to do incremental backups and such, but if you just want to have basic backups from that state, you don't need magic tools like in Windows. tar, find, cp and such are your friends.
 
Old 01-18-2008, 04:00 PM   #3
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
Just use tar. It's perfect for backups. In conjunction with a livecd of some sorts (gentoo minimal) theres really no need for anything else IMO.

On my DIY build, I spend so much time building and tweaking it, this is what I do. Hack a gentoo minimal cd to your liking:
http://jaguarlinux.com/pub/DIY/livecd/

boot into it. mount your slackware partition. cd into it.

tar cjf slackware-12.0-<insert-date>.tar.bz2 *

boot back into slackware. throw your tarball onto the root of your livecd iso. Make a livedvd. If you ever need to format then completely restore, it's a breeze all from within the livecd.

I have a gentoo minimal livecd with a nice slackware bootsplash theme at:
http://jaguarlinux.com/pub/slackware/mactel-livecd/

food for thought

Last edited by jong357; 01-18-2008 at 04:07 PM.
 
Old 01-18-2008, 07:24 PM   #4
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
I second the tar suggestion. I pretty-much just mount my Slackware partition and do a "tar cvjf" of it, and store that somewhere. If I ever need to restore my Slackware partition to its original state I just "tar xvjf -C" it. You've got lots of choices about where to store the tarball - separate partition, server, optical media, tape, etc. jong357's suggestion about putting the tarball on a Live CD/DVD is great IMHO. I would just add that encrypting the tarball is something you should consider. I encrypt mine like:
Code:
/usr/bin/openssl enc -aes-256-cbc -salt -in slackware.tar.bz2 -out slackware.enc
 
Old 01-18-2008, 10:30 PM   #5
shadowsnipes
Senior Member
 
Registered: Sep 2005
Distribution: Slackware
Posts: 1,443

Rep: Reputation: 73
I wrote a script for my computer that backs up Linux and (some of) Windows to an external USB hard drive using rsync.

It can be changed to fit someones else's system and it uses error some error checking to make sure I don't flub anything up. With no args it simply does a test backup for everything and logs the result. The -r option does a "real backup" and lets me selectively choose what I want to backup. The -all option backs everything up. At the end of the script I get the option to automatically umount all the mount points that I used during the backup. Real backups are logged as well and all logs go to a log directory.

For my Linux system I backup my user's home directory, /root, /etc, /boot (custom configs and kernels), and /var/log. I do have a lot of custom packages for my system but I keep all of them under /root/Packages so it is already covered in the backup script.

It is easy to do an incremental backup with rsync as well. Here is an example line from my script that does an incremental backup of my user's home directory.

Code:
rsync -avh --delete --exclude-from="$homeDir/rsync-exclude.txt" -b --backup-dir="/mnt/ExternalLinux/DesktopBkup/Slackware$(date +%m-%d-%y)$homeDir" $homeDir/ /mnt/ExternalLinux/DesktopBkup$homeDir/ >> $logfile
The --delete option deletes files in the backup that are no longer in the source. The log files from the tests always show me what files get deleted, though they aren't necessarily truly deleted if using incremental backups as the last backup will have the file still. The dated incremental backup is actually the difference between the current backup and the last backup.

To do a restore operation you essentially just flip the source and target. rysnc is really fast and you can backup to a remote server using it (with compression).

I definitely recommend you spend time learning how to use it instead of simply just using tar, though a dd (as an overnight cron job that is) of the whole disk would be fine as well if you don't care about wasting backup drive space.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
i am back to slack ahmed gamal Slackware 96 04-16-2008 10:22 PM
And back to slack I come... Diademed Slackware 25 07-25-2005 09:29 AM
Please help me come back to Slack Mow Slackware 6 04-19-2005 06:54 AM
trying to get back to slack hkl8324 Slackware 4 07-22-2004 06:06 AM
I am back to slack code_noc Slackware 2 10-15-2003 02:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:07 PM.

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