drive to drive backup
Right after I finished finishing adding a new
drive, I had to copy the contents of an existing drive to that new drive. This
was pretty easy. The more I learn about tar, the more I like it.
tar is your friend
First, I mounted the destination drive as /backup:
# mount /dev/wd1c /backup
I wanted to backup all of wd0. This consists of
xymix (someone on IRC) told me about these two methods:
cd /SRC;dump 0f - . | (cd /DST; restor -rf - )
cd /SRC;tar -cf - . | (cd /DST; tar xpf - )
So here’s what I did for the three slices I wanted to backup:
(cd / ; tar -cvlf - .) | (cd /backup/ ; tar xpf -) (cd /var ; tar -cvlf - .) | (cd /backup/var ; tar xpf -) (cd /usr ; tar -cvlf - .) | (cd /backup/usr ; tar xpf -)
So why did you use tar?
The reason I used tar is I like it. I could have used dump,
but didn’t. I also think cp -Rp is an option here. As is dd.
You might also want to read Swapping boot drives around.
But with as something as important as backup, I’d prefer to stick to things like tar,
or dump which were made for backups. I’m sure the other tools would work
just fine, but I’m not as familiar with them. I wouldn’t want to find out later that
"oooh so *that’s* why I shouldn’t use cp"….