Duplicating file system

Christos Chatzaras chris at cretaforce.gr
Wed Feb 20 20:26:07 UTC 2019

> On 20 Feb 2019, at 22:13, Christos Chatzaras <chris at cretaforce.gr> wrote:
>> On 20 Feb 2019, at 21:52, Cerebus <kreme at kreme.com> wrote:
>> I have an 11.2 system with two identical SSD drives. Currently I am using rsnapshot to keep backups of the primary drive on the secondary drive, but I am interested in having the second drive have a duplicate copy of the entire file system in a bootable form, updated as the root drive is modified.
>> How would I do this?
>> I don’t really want a RAID0 because I want to also keep the periodic backups from rsnapshot as the drives are about 10x larger than my data.
>> -- 
>> This is my signature. There are many like it, but this one is mine.
> If both disks have the same size the easiest but not fastest way is to use dd:
> dd if=/dev/ada0 of=/dev/ada1 bs=64k

I read again your message and I see that you want to keep the snapshots in 2nd drive, so instead of using dd you can:

1) Use gpart/newfs to create new partitions/filesystems (smaller than the 1st disk to have an extra partition for the snapshots)

2) Use dump to make a backup of the filesystems

3) Use restore to restore the data to 2nd disk

4) Use these commands to make the 2nd disk bootable:

dd if=/dev/ada0 of=/dev/ada1 bs=512 count=40
gpart recover ada1

Then try to change the boot order for the disks from BIOS to see if everything works as expected.

More information about the freebsd-questions mailing list