Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi guys, I've been running Fedora on my laptops for a while now and Windows on my main desktop but lately I've been wanting to make the switch from a life long Windows user to a full time Linux user (with a virtual Windows box of course...there's no escaping it!) and I've been trying to work out in my head how I would make the switch without losing any functionality. For most things, I have a solution to but as for my data backup... I keep my OS on a separate hdd from all my personal data (pictures, music, videos, etc) and I have a software backup in Windows right now that mirrors my data hdd with another hdd every night.
Also, every night before the two drivers are mirrored, I have another program sync my data hdd with my laptop and mirror those. I know of no Linux equivalent tool to do this job. Can anyone point me in the right direction? Thanks!
Remastersys gives you a great way to back up. You can back up your system with your personal settings and passwords, You can back up your system without personal data, you can back up just your personal information or you can back up just the CDFS.
The backup makes a Live DVD that can be used in any other computer. And if you need to restore just double click the install icon and its all back where it belongs.
http://www.remastersys.klikit-linux.com/ Here is the method for downloading and installing remastersys.
Your best backup software will be something you put together yourself, based on your system. As has already been mentioned, rsync is fantastic to sync'ing your user data quickly and reliably. But you also need to backup your entire system occasionally, so you can do a "bare metal" restore quickly should disaster befall you.
Here's a script that I use (note that the filesystem backups are commented out and should be uncommented/modified before use). Some of the info I collect below is not technically needed for a restore, but could make one much easier.
Code:
# Create backup directory
DATE=`date +'%F'`
TARGET=/mnt/backup/$DATE
mkdir $TARGET
cd $TARGET || exit 1
# Partition, filespace and mount info
fdisk -l >fdisk-l.txt
df -h >df-h.txt
mount >mount.txt
cp /etc/fstab fstab.txt
# Installed devices info
lsusb >lsusb.txt
lspci -v >lspci-v.txt
cat /proc/bus/input/devices >input_devices.txt
cat /proc/bus/usb/devices >usb_devices.txt
# System, module and boot info
uname -a >uname-a.txt
lsmod >lsmod.txt
dmesg >dmesg.txt
cp /var/log/boot bootlog.txt
# Account info
cp /etc/passwd password.txt
cp /etc/group group.txt
# Network info
ifconfig -a >ifconfig-a.txt
netstat -nlptu | cut -c1-42,69- >netstat.txt
# LVM info
pvs >pvs.txt
vgs >vgs.txt
lvs >lvs.txt
pvscan >pvscan.txt
vgscan >vgscan.txt
lvscan >lvscan.txt
pvdisplay >pvdisplay.txt
vgdisplay >vgdisplay.txt
lvdisplay >lvdisplay.txt
mkdir lvm_metadata
cp /etc/lvm/backup/* lvm_metadata/.
# /proc info
cat /proc/cpuinfo >cpuinfo.txt
cat /proc/meminfo >meminfo.txt
find /proc/ide -name model -type f -print | xargs cat >ideinfo.txt
find /proc/scsi -name scsi -type f -print | xargs cat >scsiinfo.txt
# MBR and Track Zero info
dd if=/dev/sda of=sda_mbr.bin bs=512 count=1
dd if=/dev/sda of=sda_track0.bin bs=512 count=63
# Filesystem info
#( ! cd /boot || tar czvf $TARGET/boot.tar.gz -l . )
#( ! cd / || tar czvf $TARGET/root.tar.gz -l . )
#( ! cd /usr || tar czvf $TARGET/usr.tar.gz -l . )
#( ! cd /var || tar czvf $TARGET/var.tar.gz -l . )
#( ! cd /opt || tar czvf $TARGET/opt.tar.gz -l . )
#( ! cd /home || tar czvf $TARGET/home.tar.gz -l . )
#( ! cd /tmp || tar czvf $TARGET/tmp.tar.gz -l . )
#( ! cd /srv || tar czvf $TARGET/srv.tar.gz -l . )
# Set modes and timestamps
find . -type f -print | xargs chmod 444
find . -type d -print | xargs chmod 555
find . -print | xargs touch
# OPTIONAL: Burn a DVD
#growisofs -dvd-compat -Z /dev/hdc -r -v .
# All done
exit 0
Though it is somewhat more complicated to configure, I have found that bacula (www.bacula.org)
is a very comprehensive backup solution. You can not only backup linux machine, but also those running windows.
what is wrong with a simple script and tar? why are you guys making things complicated?
The OP said "...mirrors my data hdd with another hdd every night". rsync is much better than tar for that. Nothing wrong with tar for backups - that's what I use (see my simple script above) - but for the stated use, rsync is better.
A mirrored drive isn't a backup. If you delete a file you didn't want to and the drive is mirrored, you can't recover it. It will protect you against the first drive going bad however.
If you want to mirror a drive, you could create a raid 1 array.
Look at the tar info manual. You can use it to mass duplicate the files on one partition to another.
Code:
4.6 Notable `tar' Usages
========================
_(This message will disappear, once this node revised.)_
You can easily use archive files to transport a group of files from one
system to another: put all relevant files into an archive on one
computer system, transfer the archive to another system, and extract
the contents there. The basic transfer medium might be magnetic tape,
Internet FTP, or even electronic mail (though you must encode the
archive with `uuencode' in order to transport it properly by mail).
Both machines do not have to use the same operating system, as long as
they both support the `tar' program.
For example, here is how you might copy a directory's contents from
one disk to another, while preserving the dates, modes, owners and
link-structure of all the files therein. In this case, the transfer
medium is a "pipe", which is one a Unix redirection mechanism:
$ (cd sourcedir; tar -cf - .) | (cd targetdir; tar -xf -)
You can avoid subshells by using `-C' option:
$ tar -C sourcedir -cf - . | tar -C targetdir -xf -
The command also works using short option forms:
$ (cd sourcedir; tar --create --file=- . ) \
| (cd targetdir; tar --extract --file=-)
# Or:
$ tar --directory sourcedir --create --file=- . ) \
| tar --directory targetdir --extract --file=-
This is one of the easiest methods to transfer a `tar' archive.
You could use this to mirror files. The target directory could be on another computer anywhere on the Internet if you use ssh.
You could use the -g (--listed-incremental) to only copy new files for subsequent backups. Suppose you want to also create traditional tar backups. You can insert "| tee /backup/location/${date}.tar |" in the middle to be able to A) replicate new files on another computer or filesystem and B) create backup files on an external drive or nas drive.
[code]
You can also configure ssh to use public key authentication, so the target filesystem on the right hand side of the pipe could be on a computer anywhere on the internet.
A simple example:
Code:
tar -cf - bin/ | tee bin.tar | ssh hpmedia tar -xvf - -C Downloads/ >bin_tar_log
Note, that in this example, the redirection occurs before the first tar command and will be located on the local host and not the remote side.
Rsync can also be configured to use ssh as well.
If you want to make secure backups, the easiest way would be to backup to an external drive with an encrypted filesystem.
I have hardware RAID1 (mirroring) set up between two 750 GB HDs. I am using a cheap HighPoint RAID card, which works well enough. This is all to protect me from hardware failure, as far as everything else. I keep my important (information that might need to be backed up) together in just a few folders on my desktop and I just copy them to either another HD on my machine or an external. When I copy to an external or write files to a CD, I always encrypt everything for the protection of my information. I wouldn't worry about all this other stuff people are recommending, I would just go buy an big USB external HD from NewEgg or the like, and just straight up copy your important stuff. This will allow very quick retreival in the event of a loss of data.
I guess the question really comes down to the reason you want the backup, and the degree to which you deem it invaluable. Tar and rsync are wonderful copying solutions. They are rapid, as easy to use. There is no question that is an important consideration. Raid is an excellent hardware solution which allows you to double (or even more) the number of disks containing a given piece of information. Unfortunately you increase the number of disks in play at any given time, and the cost doubles of increases for each disk. Perhaps the cost is irrelevant. According to experts who have actually examined the reliability and success of restoration of data, the old utility 'dump' is the best way to insure the viability of the backup. Tar is nice, but a single extraneous bit can render the tar file unusable. Cpio is better, but the top of the heap is dump.
I happen to like bacula beause of the ability to support all platforms, and restore data properly to them.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.