|
FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|||
Backup to USB flash drive
What is easiest way to backup every day my server to USB flash drive (16GB)?
I like to backup full system, not only "/home", so I can easely replase my HD and restore all from flash drive if something goes wrong. Code:
$ df -h Filesystem Size Used Avail Capacity Mounted on /dev/ad0s1a 989M 268M 642M 29% / devfs 1.0K 1.0K 0B 100% /dev /dev/ad0s1g 19G 4.3G 14G 24% /home /dev/ad0s1f 989M 570K 910M 0% /tmp /dev/ad0s1d 9.7G 4.6G 4.3G 52% /usr /dev/ad0s1e 989M 482M 428M 53% /var devfs 1.0K 1.0K 0B 100% /var/named/dev |
|
|||
The smallest atom dump can backup is a filesystem, so in your case
Code:
/dev/ad0s1a (/) /dev/ad0s1g (/home) /dev/ad0s1f (/tmp) /dev/ad0s1d (/usr) /dev/ad0s1e (/var) You have to watch out that you don't backup the filesystem you backup device is mounted on. E.g if you are dumping /dev/ad0s1g, your /home directory, don't mount your drive on a subdirectory of /home. If you backup drive is mounted on "/mnt", then it is ok to dump any other filesystem, except /dev/ad0s1a (/) of course If you are the only user, you could mount your disk on a directory in /tmp, which you probably don't want to backup anyway. Assuming your backup drive has been mounted on /tmp/mount you could do something like this Code:
# dump -0auf /tmp/mnt/myhome_dump0 /dev/ad0s1g Code:
0 : level of backup a : auto-size to bypass tape length stuff u : update dump statistics in /etc/dumpdates f /tmp/mnt/myhome_dump0 : destination file /dev/ad0s1g : the filesystem to be 'dump'ed Code:
# dump -0auf - /dev/ad0s1g | gzip >/tmp/mnt/myhome_dump0.gz This means standard output, which is piped into gzip for compression. All this works similar in FreeBSD and OpenBSD. Most system administrators will either go into single user mode, or stop daemons/programs which could generate file output during the dumping process. With FreeBSD, you don't have to do this, if you the -L option which takes a snapshot of the filesystem and dumps the snapshot. But I am conservative, I just go into single user mode
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump |
|
|||
Using tar is also a common alternative. It has the advantage, that you can restore single files if something bad happened to them. The disadvantage is, that a bare metal restore needs a bit more steps done by hand.
|
|
|||
Elon, you can restore individual files from a dump backup using restore -i
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
System freeze when connecting USB flash drive (4.4 & 4.5 but worked in 4.3) | GardenGnome | OpenBSD Installation and Upgrading | 11 | 7th May 2009 02:32 PM |
HOWTO: reformat a USB flash drive in NetBSD | JMJ_coder | Guides | 0 | 6th February 2009 03:52 AM |
which Flash Drive I must buy for FreeBSD and OpenBSD | mfaridi | General Hardware | 18 | 22nd October 2008 07:43 PM |
backup drive to image file | milo974 | OpenBSD General | 8 | 14th August 2008 02:01 PM |
USB flash drive | criglerj | NetBSD General | 1 | 26th July 2008 01:25 AM |