Anything specific to keep in mind restoring from rsync ?

Mikhail Goriachev mikhailg at webanoide.org
Fri Aug 25 03:03:36 UTC 2017


On 24/08/2017 21:37, Warren Block wrote:
> On Fri, 25 Aug 2017, Manish Jain wrote:
> 
>> On 08/24/17 21:58, Warren Block wrote:
>>> Don't use rsync for this.  If you do, be sure to add the half-dozen
>>> options that preserve hard links and keep the /rescue directory from
>>> growing unexpectedly.  The preferred methods are dump/restore for UFS
>>> (http://www.wonkity.com/~wblock/docs/html/backup.html) and
>>> zfs send | zfs recv for ZFS.
>>
>> Thanks Warren, but too late  : - )
>>
>>  I did an rsync (-aAXv --exclude-from ./excludes) to backup, and then a
>> reverse rsync (-aH) to restore. It worked very well for me - both for
>> Linux and FreeBSD.
>>
>> But there have been a few responses at freebsd-questions that
>> dump/restore should be the preferred solution for this (when / has to be
>> backed up, mainly owing to hard links). Next time I need a backup, I
>> will use dump+restore.
>>
>> But I am inclined to ask one question here : does FreeBSD actually have
>> any system-installed hard links (other than . and ..) ?
> 
> Yes:
> 
> % du -hd1 /rescue
> 9.6M	/rescue
> % rsync -a /rescue/ /tmp/rescue/
> % du -hd1 /tmp/rescue
> 1.3G	/tmp/rescue

Nice one!

I got into habit of the following, which "passes" that test:

# du -hd1 /rescue
7.7M    /rescue
# tar -cf - -C / rescue | tar -xf - -C /tmp
# du -hd1 /tmp/rescue
7.7M    /tmp/rescue


Cheers,
Mikhail.

-- 
Mikhail Goriachev
Webanoide


More information about the freebsd-questions mailing list