backup home

hi

i search a way to backup my home to external hd (want to reformat my hd), format to ext4, restore backup

what do you suggest me?

thanks

If /home is on it’s own partition you could use ‘dd’ to clone it from one to another

In alternative in this thread I did explain an other method to do it (always if /home is on a separate partition. However one can rewrite this to /home on the same partition, let me know in case).

On 2012-02-17 21:56, collinm wrote:

> i search a way to backup my home to external hd (want to reformat my
> hd), format to ext4, restore backup
>
> what do you suggest me?

One of may ways:


rsync  --archive --acls --xattrs --hard-links --del --stats
--human-readable --exclude=/lost+found   \
/home /newhome


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

When I needed to do that, I logged out, then logged in as root at a virtual terminal (use CTRL-ALT-F1 for that).


cd /
tar zcf /path/to/external/homestuff.tgz home

where “/path/to/external” would usually be something like “/media/12345678/unix”. Here, the drive is automounted to somewhere under “/media”, and I create a “unix” directory for unix backups.

To restore, mount the external disk in the same way.
Make sure that “/home” is formatted as needed, and mounted. Then:


tar zxpf /path/to/external/homestuff.tgz

I most recently did this when I switched to encrypting “/home”.

Hi, this is quite interesting. How much does the compression save in ratio compared to a “cp -ax” cloning? Does this completely preserve everything of /home? How much does this raise the time for a complete “backup” compared to non compressing? Compression can be a valid solution if the backupmedium is smaller than the /home. This is actually often the case with me, since I am “recycling” former HDD of notebooks as 2.5 external backup disks. Thank you for sharing this.

@Carlos: rsync: does rsync support compression? For what I know, it doesn’t. But you seem to know a lot more about rsync than me. :slight_smile:
I usually avoid rsync because as you have seen the parameters are many and therefore I feel this procedure be prone to error by omission. I am using on a regular basis “lucky backup” however, which is nothing else than a GUI for rsync.

On 2012-02-18 09:36, stakanov wrote:

> Hi, this is quite interesting. How much does the compression save in
> ratio compared to a “cp -ax” cloning?

Depends on what you have at home. Photos, videos, openoffice files:
nothing, they are already compressed. Plain text files, can be 50%.

> Does this completely preserve
> everything of /home?

There was a howto at the LDP that discussed this subject a lot.

Hard-Disk-Upgrade, Hard Disk Upgrade Mini HOWTO
<http://tldp.org/HOWTO/Hard-Disk-Upgrade/index.html>

> How much does this raise the time for a complete
> “backup” compared to non compressing?

Again, depends on what you compress and the ratio you request. With -9 and
video files, pretty slow.

> @Carlos: rsync: does rsync support compression? For what I know, it
> doesn’t. But you seem to know a lot more about rsync than me. :slight_smile:

No, it doesn’t. I would love it did.

I would also love having a compressed R/W filesystem in Linux, but we don’t
have it. The feature was prepared for ext3, but was not developed. many
devs think it is not needed, disk space is cheap (or was, the factoriess
were flooded and prices have soared) - but then, NTFS (windows) has it.

> I usually avoid rsync because as you have seen the parameters are many
> and therefore I feel this procedure be prone to error by omission.

Ha! Do you think I know all those parameters from memory? I have a cheat
sheet :wink:
Or I do my own backup scripts.

> I am
> using on a regular basis “lucky backup” however, which is nothing else
> than a GUI for rsync.

I haven’t tried that one, but there are several. One feature they have is
that you can have several backup directories, dated. If a file doesn’t
change, the new directory contains a hardlink to the previous copy, so that
it saves a lot of space.

I have a list of backup programs:

amanda
dar
rdiff-backup current copy is a mirror, old one is rdif.
rsnapshot current copy is a mirror, old ones hardlinks and
new files. Or the other way round.
gadmin-rsync?
http://www.dirvish.org/
pdumpfs (http://0xcc.net/pdumpfs)
duplicity
duply
Back-In-Time (http://backintime.le-web.org/)
LuckyBackup


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

I use tar, because I am backing up to an NTFS disk. Using tar preserves stuff that NTFS can’t handle.

As for the compression - I haven’t timed it, but my guess is that there is no serious time cost. The compression reduces the amount of data that has to be sent over the USB link, which is probably slower than internal disk speeds. Most of the time cost of compression should be recovered in the time saved for data transmission.

On ‘rsync’ - if you are doing that over ssh, then you can turn on compression of the ssh link.

On 2012-02-18 15:16, nrickert wrote:
>
> stakanov;2441211 Wrote:
>> Hi, this is quite interesting. How much does the compression save in
>> ratio compared to a “cp -ax” cloning?
>
> I use tar, because I am backing up to an NTFS disk. Using tar
> preserves stuff that NTFS can’t handle.

I forgot to say, that a single error in the tarred gzip, and you loose the
entire archive. Unrecoverable.

> On ‘rsync’ - if you are doing that over ssh, then you can turn on
> compression of the ssh link.

The transmission, yes, can be compressed. The stored files on destination
are not.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

True, though it has never happened to me.

I always have other slightly older backups that I can use in case of such a disaster.

nrickert wrote:

>
> robin_listas;2441278 Wrote:
>> I forgot to say, that a single error in the tarred gzip, and you loose
>> the
>> entire archive. Unrecoverable.
>
> True, though it has never happened to me.
>
> I always have other slightly older backups that I can use in case of
> such a disaster.
>

I recommend dar instead tar gzip.


Viljo

Interesting. Thanks. I might give that a try.

Thanks, I never heard of it. Bookmarked the page.