You are not logged in.

#1 2011-07-28 07:07:53

pecan
Member
Registered: 2007-04-06
Posts: 93

Backup filesystem

I'm wondering if there's an easy way to backup my arch install. I currently have all of arch on one SSD and I'd like to have an easy way of backing this up monthly  (manually is fine) and storing it on one of my larger hard drives. Size isn't really an issue, I currently have about 2.5TB spare. The main point of this is I need an easy way of getting back to a fairly recent arch if i accidentally break it since I do use it for important work. All work/media files are stored on other drives so it's really just the OS state I need to store. Any tips?

Offline

#2 2011-07-28 07:38:37

lukaszan
Member
Registered: 2011-05-05
Posts: 117

Re: Backup filesystem

Searching the forum/wiki to start with.

Offline

#3 2011-07-28 07:49:06

Ashren
Member
From: Denmark
Registered: 2007-06-13
Posts: 1,229
Website

Re: Backup filesystem

mondorescue. It has a bit of a quirky cli interface, but it does work well. I've succesfully done P2V with this tool from both a proliant (RHEL) and an Asus eeepc (Arch) and on the same hardware it should be breeze to restore a system.

It creates an ISO which is bootable where you can restore your system from. The backup can function incrementally.

Last edited by Ashren (2011-07-28 07:49:30)

Offline

#4 2011-07-28 07:58:22

pecan
Member
Registered: 2007-04-06
Posts: 93

Re: Backup filesystem

I have actually read and tried several solutions from the wiki, including mondorescue which crashes when I try to backup to hard disk or DVD. The reason I asked was people's personal experiences may help filter down a list of 20 to a list of 1-2 programs. Currently mono log says install growisofs when I try the DVD option (which I can't find in the repos or AUR) and when I try to backup to disk I get this 'cannot remove `/media/HD1/mondo.tmp.7iwdVi/mnt1': Device or resource busy' which I'm unsure about, it is ntfs-3g mounted?

EDIT: Installed growisofs by installing  dvd+rw-tools package, still get the lock trouble I get with hard disk backup

Last edited by pecan (2011-07-28 08:09:00)

Offline

#5 2011-07-28 08:42:16

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: Backup filesystem

Use Rsync. I use this script (in my /root/bin) to regularly backup:

#!/bin/bash
#
if ! [ -d /mnt/sysbu ]
then
  mkdir -p -v /mnt/sysbu
fi

# Make sure we do not double mount
( mount | grep /dev/sda2 ) && umount -v /dev/sda2

mount -v -t ext3 /dev/sda2 /mnt/sysbu
rsync -av --delete --delete-excluded --exclude="/tmp/" --exclude="/sys/" --exclude="/proc/" --exclude="/mnt/" --exclude="/dev/"  /   /mnt/sysbu
df -h
umount -v /mnt/sysbu

This is almost ready to replay in case of emergency. Only the excluded directories need to be re-created manually. You can as well remove the "--delete-excluded" option, it is there only to slightly speed up the process.

Last edited by bernarcher (2011-07-28 08:43:41)


To know or not to know ...
... the questions remain forever.

Offline

#6 2011-07-28 11:01:37

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: Backup filesystem

I use synbak at home... My file server just goes through all my machines and pulls a backup in from them.

Offline

#7 2011-07-28 12:05:29

siriusb
Member
From: Hungary
Registered: 2010-01-01
Posts: 422

Re: Backup filesystem

+1 rsync
alternative: fsarchiver

Offline

#8 2011-07-28 13:50:00

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: Backup filesystem

Do you have separate / and /home partitions?  If so, just use a partition cloner.  Clonezilla backs up my 7.5-gig / partition in about four minutes, restores it in less than ten.  Use any backup method of your choice to regularly back up your /home partition.

Offline

#9 2011-07-28 21:51:24

mkkot
Member
From: Poland
Registered: 2009-12-20
Posts: 287

Re: Backup filesystem

No one uses dd? Really? ;]

dd if=/dev/sda of=/path/to/backup.bin

You can also wipe free space on the disk and use compression:

mount /dev/sda1 /mnt/partition_to_be_copied/
dd if=/dev/zero of=/mnt/partition_to_be_copied/zero.bin
rm /mnt/partition_to_be_copied/zero.bin
umount /dev/sda1
dd if=/dev/sda |gzip -1 > /path/to/backup.bin

MBR backup:
dd if=/dev/sda of=mbr.bin bs=512 count=1

Fast and reliable. The only drawback is that you have to use some live or remount read-only.

Last edited by mkkot (2011-07-28 21:52:06)

Offline

#10 2011-07-28 22:20:38

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: Backup filesystem

mkkot wrote:

No one uses dd? Really? ;]

dd if=/dev/sda of=/path/to/backup.bin

It takes significantly longer than an incremental rsync backup, doesn't it? tongue

Last edited by bernarcher (2011-07-28 22:21:23)


To know or not to know ...
... the questions remain forever.

Offline

#11 2011-07-28 22:27:30

mkkot
Member
From: Poland
Registered: 2009-12-20
Posts: 287

Re: Backup filesystem

Umm not really. Backing up 12GB / partition takes about 6 minutes when no compression is used.

Offline

#12 2011-07-28 22:48:21

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: Backup filesystem

mkkot wrote:

No one uses dd? Really? ;]

Really... +1 for too slow,  plus you could easily end up with an inconsistent backup if you're backing up a mounted partition and the disk isn't quiescent.....

mkkot wrote:

The only drawback is that you have to use some live or remount read-only.

.... which makes it fairly inconvenient for regular and/or unattended backups.

Last edited by fukawi2 (2011-07-28 22:49:36)

Offline

#13 2011-07-29 02:03:20

pecan
Member
Registered: 2007-04-06
Posts: 93

Re: Backup filesystem

Thanks for all the suggestions guys, will try these and pick one that suits me.

Offline

#14 2011-07-29 04:23:59

pseudonomous
Member
Registered: 2008-04-23
Posts: 349

Re: Backup filesystem

dump/restore unless you're using ext4.

Offline

#15 2011-07-29 07:45:14

lukaszan
Member
Registered: 2011-05-05
Posts: 117

Re: Backup filesystem

OK

Good ole' 'tar' for me. Especialy if you actually need to restore anything once every few years...

Offline

#16 2011-07-30 11:29:11

rwd
Member
Registered: 2009-02-08
Posts: 664

Re: Backup filesystem

+1 for search the forum. This question has been answered hundreds of times.

Offline

Board footer

Powered by FluxBB