LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Slackware Backup tutorial (https://www.linuxquestions.org/questions/slackware-14/slackware-backup-tutorial-666078/)

feveĀ£ 08-28-2008 11:14 AM

Slackware Backup tutorial
 
Can anyone help me with a step by step backup method of my running system. I cant turn it off for backups and I am having a hard time with the answers on the forums. They assume I already have certain knowledge that I dont.

I have a slave drive installed and would like to use it as a replacement in case the master fails.

Thanks in advance.

Fevel

niels.horn 08-28-2008 12:05 PM

Tell us a bit more about what you want to backup.

If you want a mirror of your 'master' drive, you might be able to configure this on your motherboard through your BIOS, but I think the two drives have to be of equal capacity.

If you just want to backup some important data and don't mind reinstalling your OS (I presume Slackware) in case of hardware failure, you can use a rsync script in cron (that's the way I do it).

What do you have on your master drive? Only one partition? Or is it a dual- or multi-boot setup?
You can go low-level with dd from Linux as well to backup the MBR etc.

Tell us some more and we'll try to guide you!

ErV 08-28-2008 12:24 PM

You can use tar.
http://linux.cudeso.be/linuxdoc/backuprestore.php

keefaz 08-28-2008 12:39 PM

I use rsync for backup, why because it is simple :)
rsync can backup a directory to another in same machine or in a remote machine etc..

simple to set up a crontab like:
Code:

30  20  *  *  * rsync -a /home/me /mnt/hd/backup > /dev/null 2>&1
Every day at 20:30 the directory /home/me is backed up in /mnt/hd/backup
and not whole directory, just new or recent modified files (the first time, it will back up the whole directory)
easy :)

trickykid 08-28-2008 12:41 PM

Having a slave drive in the same computer is not essentially a backup plan. Probably what you actually could do in this type of scenario is to setup RAID1, mirror the drives. In case one fails, you're data is still intact until you replace the bad drive, then sync them back up, waiting for the next failure if it ever occurs.

niels.horn 08-28-2008 12:59 PM

Quote:

Originally Posted by trickykid (Post 3262862)
Having a slave drive in the same computer is not essentially a backup plan.

Exactly. But how far do you want to go? I backup my data to my wife's computer and vice versa.
But what if our house burns down? We still loose everything.
Backing up to a second drive is better than not backing up at all. Some *really* important files you can save on some shared drive on the internet or send to your own google-mail address.

I also have like 10GB of pictures from my digital camera on my computer. I rsync all (of course, only the new ones go) to my wife's desktop.
But I also burn a DVD once in a while and store it at another address. Because if my house burns down, a plane crashed in my street, etc., I might loose all furniture, but at least I'll have all those pictures to restore in a new system (after finding a new house, that is...)

Woodsman 08-28-2008 01:25 PM

Quote:

I have a slave drive installed and would like to use it as a replacement in case the master fails.
Setting up RAID with an additional internal drive makes sense. However, I developed a personal backup strategy that uses both a second internal drive as well as an external drive. I use rsnapshot. You can read the details here:

A Backup Strategy

trickykid 08-28-2008 01:26 PM

Quote:

Originally Posted by niels.horn (Post 3262877)
Exactly. But how far do you want to go? I backup my data to my wife's computer and vice versa.
But what if our house burns down? We still loose everything.
Backing up to a second drive is better than not backing up at all. Some *really* important files you can save on some shared drive on the internet or send to your own google-mail address.

Exactly. That's why I mentioned or suggested using RAID. If they want backups just in case of a drive failure, that is the exact reasoning RAID exists.

Now backups are different. Sure you can store data on a separate machine or other media for a just in case. That's still backing up your data to have in another location.

Storing offsite in case your house burns down, etc cause you kept all your eggs in one location is called disaster recovery. It's the worst case scenario.

But yeah, in this case, if I were the user, I'd just implement RAID1 to mirror the drives, then also have a backup plan as well if they really want to ensure data integrity and it's safe.

I have all my precious photos, videos of kids stored on a backup server at home. Which keeps a copy on an external drive on the same backup server. Then I have that replicated on two remote servers, one at my mothers which is a 2 hour drive and another on a friends server in California I have access to, a good 1,500 miles away.

I also started archiving this data to an archival grade DVD(s) and store those in a fire proof safe. I think I'm covered for disaster recovery. What can I say, I've been a backup administrator for over 6 years now at all my employers since becoming an System Administrator. ;)

niels.horn 08-28-2008 05:31 PM

Quote:

Originally Posted by trickykid (Post 3262899)
I have all my precious photos, videos of kids stored on a backup server at home. Which keeps a copy on an external drive on the same backup server. Then I have that replicated on two remote servers, one at my mothers which is a 2 hour drive and another on a friends server in California I have access to, a good 1,500 miles away.

I also started archiving this data to an archival grade DVD(s) and store those in a fire proof safe. I think I'm covered for disaster recovery. What can I say, I've been a backup administrator for over 6 years now at all my employers since becoming an System Administrator. ;)

I know exectly what you mean... I work as an Operations Manager taking care os several Data Centers, with hundreds of computers.
We have redundancy for about everything, off-site backups, contingency systems, disaster recovery plans, a complete backup site in another state, etc.

Our professional job makes us a bit paranoia in out private life! :D

But I always ask the same question: how far do you want to go to guarantee continuity? It all comes at a cost, so sometimes - when on a lower budget - you have to accept a not-ideal solution.
As for a private person: a simple RAID setup or even local rsync between two drives is better than nothing. And a hard drive costs almost nothing nowadays, so everybody can have some kind of backup solution at home.

glore2002 08-30-2008 01:29 PM

rsync with fat32 partition.
 
Quote:

Originally Posted by keefaz (Post 3262860)
I use rsync for backup, why because it is simple :)
rsync can backup a directory to another in same machine or in a remote machine etc..

simple to set up a crontab like:
Code:

30  20  *  *  * rsync -a /home/me /mnt/hd/backup > /dev/null 2>&1
Every day at 20:30 the directory /home/me is backed up in /mnt/hd/backup
and not whole directory, just new or recent modified files (the first time, it will back up the whole directory)
easy :)

If I execute the following command as user:
Code:

rsync -a /home/me/Packages/ /home/me/backup/ > /dev/null 2>&1
It works perfectly well (I like this way of creating a backup)

But, if I try to backup to a fat32 partition (as user):

Code:

rsync -a /home/me/Packages/ /media/winfat32/BackupSlackware/ > /dev/null 2>&1
Files are not copied but all empty subdirectories are created.

If I do the same as root, things work ok. Everything is copied. Should I always be root to backup to a fat32 partition? or Should I modify something in fstab to be able to backup -rsync- as user?

fat32 partition is (at least, I guess so :-) shared completely rwx permissions.

Fstab looks like:

Code:


/dev/sda5        /media/winfat32  vfat        auto,users,rw,umask=000 0 0


I will appreciate your help!
Thank you!

Glore2002.-

keefaz 08-30-2008 02:59 PM

I don't know, never tried to do a rsync to a fat32 partition.
A quick google search led me to this link:
http://lists.debian.org/debian-user/.../msg00955.html
With the important part:
Quote:

Originally Posted by Andy Rowan
Another lesson is that the FAT32 partition should be mounted with the "shortname=mixed" option. If not, the rsync gets messed up. The default option is "lower," which means that files and directories with short names will have their names forced to lower case. But then rsync will think they're different from the ones it sees in the source that are upper case, and it will send the upper case ones again, and then delete the lower case ones. But since it's really the same files, the end result is it transfers a bunch of data and then deletes it all! Not good.

I don't know if it is relevant, but a quick test with a temp directory with only one file in it (and no subdirs) would reveal the messed filenames issue, try rsync it to /media/winfat32, test with different directory and file names, lower case, upper case, etc..
[edit]
And maybe one more relevant link:
http://ubuntuforums.org/showthread.php?t=451684
Good Hunting!

glore2002 08-30-2008 03:50 PM

shortname=mixed
 
How should I add that parameter in /etc/fstab? For what I understand I have to make sure my fat32 partition will let any user read, write and execute any file.

Code:

/dev/sda5        /media/winfat32  vfat        auto,users,rw,umask=000 0 0
Thanks,
Glore2002.-

ErV 08-30-2008 03:55 PM

When rsync fails to do what you want, it probably (99% probability) printing problems to stderr/terminal.
Try running rsync manually, from terminal and without "> /dev/null 2>&1" part. See what it doesn't like.

glore2002 08-30-2008 04:07 PM

Output from rsync.
 
Thanks ErV for adding your reply!

When executing rsync in terminal (as my user) I get the following error message. I will only post a couple of lines since all messages are the same. Only thing that changes is the folder rsync is trying to backup.

$ rsync -a /home/me/Packages/ /media/winfat32/BackupSlackware/

Code:

rsync: failed to set times on "/media/winfat32/BackupSlackware/.": Operation not permitted (1)
rsync: failed to set times on "/media/winfat32/BackupSlackware/AMVConverter": Operation not permitted (1)
rsync: failed to set times on "/media/winfat32/BackupSlackware/ANTIVIRUS": Operation not permitted (1)


Thank you,
Glore2002.-

ErV 08-30-2008 05:16 PM

Quote:

Originally Posted by glore2002 (Post 3264759)
$ rsync -a /home/me/Packages/ /media/winfat32/BackupSlackware/

Code:

rsync: failed to set times on "/media/winfat32/BackupSlackware/.": Operation not permitted (1)
rsync: failed to set times on "/media/winfat32/BackupSlackware/AMVConverter": Operation not permitted (1)
rsync: failed to set times on "/media/winfat32/BackupSlackware/ANTIVIRUS": Operation not permitted (1)


Looks like it can't set file last access/modification date, because this operation either isn't supported on fat32 or isn't enabled in fstab somehow.

This is also the error I'm always getting when I try to copy something to ntfs(3g) partitions.

The best thing you can do is to use native *nix filesystem for backups (jfs, xfs, reiserfs, ext2, ext3), because you also probably use large drive (larger than 8GB) and fat32 wastes a lot of space on the drive. If it's not possible, you might try following:
1) Check rsync docs, maybe there is a switch that either makes rsync avoid this operation or ignore errors (there might be problems, because rsync probably relies on last access date information).
2) Check "man mount". There might be options for vfat that allows this operation.
3) As the last resort you can create large file on fat32 system, make filesystem within it, mount it as loop device and use it as backup.
Example how you can do it
(creates 100mb file with ext3 filesystem, then mounts it to /mnt/tmp2. should be run as root) :
Code:

dd if=/dev/zero of=1.bin bs=1M count=100
mkfs.ext3 1.bin
mount 1.bin /mnt/tmp2 -o loop -t ext3

You won't be able to access contents of filesystem within this file from within windows without using some kind of special utilities (I don't know what windows software can be used for this).
Later you can mount this file with filesystem using fstab, as normal partition. Just make sure vfat partition (with file) will be mounted first.


All times are GMT -5. The time now is 02:56 AM.