The FreeBSD Diary |
![]() |
(TM) | Providing practical examples since 1998 |
|
drive to drive backup
8 May 2000
|
|
|
|
|
|
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:
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".... | |