1377b
![]() |
|
|
|
|
|||||||
| General General questions about the FreeBSD operating system. Ask here if your question does not fit elsewhere. |
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Im reading few things a about dump and i have few unclear points..
if i want to backup my entire system i tough i had to use: dump -0 -f /mnt/externaldrive/backuplfs.dump / This ony copies my partition: ad4s1a then i typed: dump -0 -f /mnt/externaldrive/backuplfs.dump /usr which copied the partition: ad4s1f so my question is: since i ran the command 2 times using the same file: backuplfs.dump will this file include partitions: ad4s1a and ad4s1f?? or only the last one?? Also is there a way to backup my full file system??? with out listing the folders individually ?? like i want to back up ad4s1a (/),ad4s1d (/var),ad4s1e(/tmp) and ad4s1f(/usr) if not the command to backup everything would be:dump -0 -f /mnt/externaldrive/backuplfs.dump / /var /tmp /usr And if i run that command, when i run it again will it try to backup using incremental backups or it will copy everything again? Thanks |
|
#2
|
|||
|
|||
|
I've no time to re-read you post, but it might be easier
to find an fstab on the web which is simlar to yours and include then the dump command (in the web search) (or vice versa). Someone may have written a guide you can use that would be more reliable and already have a restore write-up in it; the restore is probably more critical than the backup. Unless there is a guide here already in the HowTo section. |
|
#3
|
||||
|
||||
|
you need to dump each partition to separate file.
http://forums.freebsd.org/showthread.php?t=185 Code:
#!/bin/sh DEFAULT_BAK_FS='root var home usr' if [ "$USER" = 'root' ]; then if [ -c /dev/ufs/backup ]; then if [ "$1" = '--backup' ]; then echo '*** starting backup ***' echo mkdir "/tmp/$(basename $0).$$" echo '*** saving kernel configuration ***' cat /usr/src/sys/i386/conf/killabsd | bzip2 > "/tmp/$(basename $0).$$/killabsd.bz2" if [ "$2" = 'all' ]; then for i in $DEFAULT_BAK_FS; do echo "*** dumping $i ***" dump -h 0 -0Laf - "/dev/ufs/$i" | gzip > "/tmp/$(basename $0).$$/$i.dump.gz" shift done else while [ $2 ]; do echo "*** dumping $2 ***" dump -h 0 -0Laf - "/dev/ufs/$2" | gzip > "/tmp/$(basename $0).$$/$2.dump.gz" shift done fi bakDate="$(date '+%Y-%m-%d')" echo '*** Mounting ks86backup ***' mount -o noatime /dev/ufs/backup /mnt echo '*** Saving Backups ***' if [ ! -d '/mnt/bak' ]; then mkdir '/mnt/bak'; fi if [ ! -d "/mnt/bak/$bakDate" ]; then rm -Rf "/mnt/bak/$bakDate"; fi mkdir "/mnt/bak/$bakDate" cp "/tmp/$(basename $0).$$/"* "/mnt/bak/$bakDate/" umount /mnt echo '*** ks86backup unmounted ***' echo '*** cleaning tmp ***' rm -Rf "/tmp/$(basename $0).$$" echo "*** backup $bakDate compleate ***" exit 0 elif [ "$1" = '--restore' ]; then echo 'not implemented yet' exit 1 else echo 'Err: unknown command' exit 1 fi else echo "Err: backup drive ain't plugged" exit 1 fi else echo "Err: you're not root" exit 1 fi echo "Err: you shouldn't naturally see this. A bug is somwhere." exit 1 I used this to dump important to me FS to /tmp/backup... and then to copy to my 16GB flash It depends on UFS labels to use this script make sure you have ufs labels in /dev/ufs/ and edit the red line Last edited by graudeejs; June 20th, 2009 at 13:22. |
|
#4
|
||||
|
||||
|
Your are overwriting file. Use -L option to dump live file system
day0 (full backup (Sunday)): Code:
dump -0uLf /mnt/externaldrive/week0/fsroot0.dump / Code:
dump -1uLf /mnt/externaldrive/week0/fsroot1.dump / Code:
dump -1uLf /mnt/externaldrive/week0/fsroot2.dump / day6 (level 6 Sat): Code:
dump -6uLf /mnt/externaldrive/week0/fsroot6.dump / Code:
0 3 2 5 4 7 6 9 8 Code:
0 2 4 6 8
__________________
Neither in this world nor elsewhere is there any happiness in store for him who always doubts. If you enjoyed my answer please consider donating some money to FreeBSD foundation @ http://www.freebsdfoundation.org/ |
|
#5
|
||||
|
||||
|
I'd suggest to use fs name in dump file name.
That way if you change setup it's much easier to restore from dumps |
|
#6
|
|||
|
|||
|
and using dump is a better solution than using rsync.. correct?
|
|
#7
|
||||
|
||||
|
I've never tried rsync
|
|
#8
|
|||
|
|||
|
The only problem with this method is doing mysql backups (not recommended).
|
|
#9
|
||||
|
||||
|
Well, you can create ufs snapshot, and then dump it
![]() I believe it solves the problem Last edited by graudeejs; June 29th, 2009 at 09:31. |
|
#10
|
||||
|
||||
|
UFS snapshot makes *SQL online backup pretty easy without putting any load on server.
__________________
Neither in this world nor elsewhere is there any happiness in store for him who always doubts. If you enjoyed my answer please consider donating some money to FreeBSD foundation @ http://www.freebsdfoundation.org/ |
|
#11
|
|||
|
|||
|
This is giving me a head ache.
I need another beer... |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| UFS Backup | graudeejs | Howtos & FAQs | 95 | October 9th, 2012 00:20 |
| ZFS and Dump | bluetick | General | 15 | June 3rd, 2012 19:37 |
| How can I make the entire disk partition completely empty in a very short time? | T010 | Installing & Upgrading | 22 | June 5th, 2009 17:52 |
| backup and dvds | bluetick | Off-Topic | 2 | April 5th, 2009 23:47 |
| Backup of desktops | guybor | General | 2 | January 17th, 2009 02:01 |