DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 27th February 2011
unixjingleman unixjingleman is offline
Fdisk Soldier
 
Join Date: Jan 2011
Posts: 70
Thanked 0 Times in 0 Posts
Default Simple backup questions

Hi There
To backup a FreeBSD file system to an external usb hard-drive the command is:
Code:
#dump -OLuf /path/to/external/drive /dev/ad0sla
right?
The only thing is that i backed up my MacBook first, so i think it is formatted for HFS+. So do i need to re-format the drive in order to back up FreeBSD filesystems?. I also want to back-up my OpenBSD filesystems on the same drive. However the only system that i have with a windowing system, and GUI utilities is the MacBook, at the moment. So do i need to format this external drive or should i leave it un-formatted. if i need to format it what should i format it as?.
If I'm just using it for storage do i need to format it?. Can i just enter the above dump command to put it on the HFS+ formatted drive?.
I'm sorry to ask so many questions. I've just never backed up whole systems before.
Thank you for your time, and any replies you might send
regards unixjingleman
Reply With Quote
  #2   (View Single Post)  
Old 27th February 2011
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,116
Thanked 182 Times in 149 Posts
Default

You can check the filesystem type by using fdisk on the external drive, usually /dev/da0 under FreeBSD.

Code:
# fdisk /dev/da0
For an example see http://www.daemonforums.org/showthre...5708#post36922

Usually external drives are formatted with DOS/FAT32 or NTFS.
The problem with FAT32 is the maximum file size of 4 GB. NTFS cannot be written to reliably on most BSDs.

Re: command to dump a fileystem
You forgot the '-a' option. See http://www.daemonforums.org/showthre...5708#post36923

If your drive is HFS+ and FreeBSD does not support reading/writing HFS+, FreeBSD cannot write the dump file to it.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #3   (View Single Post)  
Old 27th February 2011
unixjingleman unixjingleman is offline
Fdisk Soldier
 
Join Date: Jan 2011
Posts: 70
Thanked 0 Times in 0 Posts
Default

Thank you very much for your fast reply. So what should i do to the drive(external usb) in order to back up my whole FreeBSD and OpenBSD systems?(i don't mind if i can't back up my MacBook on the same drive. My other BSD's are of more importance)
Reply With Quote
  #4   (View Single Post)  
Old 27th February 2011
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,116
Thanked 182 Times in 149 Posts
Default

Why don't you first check with fdisk which file sytem is on the drive?

You could format the disk with OpenBSD UFS, which FreeBSD also can read/write.
If the disk is big enough you could make one partition/slice for FreeBSD and another one for OpenBSD. Or even a third one with HFS+
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #5   (View Single Post)  
Old 27th February 2011
unixjingleman unixjingleman is offline
Fdisk Soldier
 
Join Date: Jan 2011
Posts: 70
Thanked 0 Times in 0 Posts
Default

When you put, say ads1a, on an external drive do you have to use disklabel on the external hard-drive, once you've used fdisk, to create the partitions first?. Or can you just allocate space and whack 'em on, once you've allocated space using fdisk?. Because when you're using dump aren't you copying the partitions anyway?
Reply With Quote
  #6   (View Single Post)  
Old 27th February 2011
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
Default

You can dump to files instead of partitions.
Reply With Quote
  #7   (View Single Post)  
Old 27th February 2011
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,116
Thanked 182 Times in 149 Posts
Default

In your case dump will write to file, so it needs a filesystem to place the file on it.

With both FreeBSD and OpenBSD you don't need to label the disk. FreeBSD will access the drive with it's slice numer, say /dev/da0s1.
OpenBSD will create a virtual or spoofed disklabel, which you can see with running the OpenBSD disklabel on the external USB disk.

If all computers are networked, then there another less complicated option. Just tell dump to send the dump over the network to the Apple box, having the external USB drive connected to it. I do this with my OpenBSD router/firewall.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #8   (View Single Post)  
Old 27th February 2011
unixjingleman unixjingleman is offline
Fdisk Soldier
 
Join Date: Jan 2011
Posts: 70
Thanked 0 Times in 0 Posts
Default

But otherwise you have to dump to partitions, not just slices?

Sorry that reply was to BSDfan666 not j65nko

Last edited by J65nko; 27th February 2011 at 08:58 PM.
Reply With Quote
  #9   (View Single Post)  
Old 27th February 2011
unixjingleman unixjingleman is offline
Fdisk Soldier
 
Join Date: Jan 2011
Posts: 70
Thanked 0 Times in 0 Posts
Default

So, for the non-networked way, all i need to do is use fdisk and not disklabel. Then run the dump command?.
Reply With Quote
Old 27th February 2011
unixjingleman unixjingleman is offline
Fdisk Soldier
 
Join Date: Jan 2011
Posts: 70
Thanked 0 Times in 0 Posts
Default

Oh sorry. So in order to not use disklabel you have to use fdisk, then dd?
Reply With Quote
Old 27th February 2011
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,116
Thanked 182 Times in 149 Posts
Default

Dumping files from OpenBSD box through the network to another box. In your case, Apple box

I will use two OpenBSD boxes.
parmenides is the one whose "/home' directory will be dumped through the network to host hercules.

On hercules start nc (netcat) to listen for data on port 4000 and redirect the output to file:

Code:
j65nko@hercules[~] nc -l 4000 >firewall.dump
So hercules will receive the dumpfile. In your case this will a file, on your Apple box, on your mounted HFS+ external USB disk.

Now I ssh in to parmenides, become root and run the dump
Code:
j65nko@parmenides[~] su - root
Password: xxxxxxxxxxxxxxx

root@parmenides[~] dump -0 -a -u -f - /home  | nc hercules.utp.xnet 4000
  DUMP: Ignoring u flag for subdir dump
  DUMP: Dumping sub files/directories from /
  DUMP: Dumping file/directory /home
  DUMP: Date of this level 0 dump: Sun Feb 27 07:08:46 2011
  DUMP: Date of last level 0 dump: the epoch
  DUMP: Dumping /dev/rwd0a (/) to standard output
  DUMP: mapping (Pass I) [regular files]
  DUMP: mapping (Pass II) [directories]
  DUMP: estimated 131807 tape blocks.
  DUMP: Volume 1 started at: Sun Feb 27 07:08:46 2011
  DUMP: dumping (Pass III) [directories]
  DUMP: dumping (Pass IV) [regular files]
  DUMP: 1.66% done, finished in 4:56
  DUMP: 3.32% done, finished in 4:52
On parmenides a check with file(1)
Code:
j65nko@hercules[~]file firewall.dump
                                        
firewall.dump: new-fs dump file (little endian), This dump Sun Feb
27 07:08:46 2011, Previous dump Thu Jan  1 01:00:00 1970, Volume
1, Level zero, type: tape header, Label none, Filesystem a subset
of /, Device /dev/wd0a, Host parmenides.utp.xnet, Flags 3
You will notice that the OpenBSD dump can do something what other dumps cannot: make a dump of a sub-directory, instead on a complete file system. With one limitation, a sub-directory dump only can be level 0. But it is a nice way to test your backup strategy
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
Old 27th February 2011
unixjingleman unixjingleman is offline
Fdisk Soldier
 
Join Date: Jan 2011
Posts: 70
Thanked 0 Times in 0 Posts
Default

Thanks a million dude.Why is that so much easier than just writing straight out to an external usb drive though?.

Last edited by unixjingleman; 27th February 2011 at 09:48 PM.
Reply With Quote
Old 27th February 2011
unixjingleman unixjingleman is offline
Fdisk Soldier
 
Join Date: Jan 2011
Posts: 70
Thanked 0 Times in 0 Posts
Default

What about:
Code:
dd if=/dev/ad0s1a conv=noerror, sync | ssh macbook "cat > root.dump"
?
That might be more secure also. Whada ya think?
Reply With Quote
Old 27th February 2011
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,116
Thanked 182 Times in 149 Posts
Default

While more secure, that will also copy the unused space of your disk, while dump only will backup the space actually used. Not so nice if you have 100GB free space

In my example, for security reasons, you can also use ssh instead of nc.

RE: filesystem on your USB disk
I am not sure about your Apple OS, but both FreeBSD and OpenBSD can write to the Linux ext2fs filesystem.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
Old 27th February 2011
unixjingleman unixjingleman is offline
Fdisk Soldier
 
Join Date: Jan 2011
Posts: 70
Thanked 0 Times in 0 Posts
Default

And read from it as well yeah?
Reply With Quote
Old 27th February 2011
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,116
Thanked 182 Times in 149 Posts
Default

Do a ls -l /sbin/mount* to find out.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple pf ruleset jhp FreeBSD General 2 30th March 2010 02:05 PM
backup freeBSD 7.0 using Backup Exec ccc FreeBSD General 2 25th April 2009 09:23 PM
A simple question Mr-Biscuit Off-Topic 1 16th April 2009 04:26 PM
Simple Firewall with PF jones FreeBSD General 3 7th November 2008 02:02 AM


All times are GMT. The time now is 11:33 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick