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 30th January 2009
paul-lkw's Avatar
paul-lkw paul-lkw is offline
Real Name: Paul.LKW
Port Guard
 
Join Date: May 2008
Location: Hong Kong
Posts: 18
Thanked 0 Times in 0 Posts
Default dd and split usage problem

Hi all:
As "dd" can be used to backup and "split" can be used to split large file then how can it be combined to backup a partition and split it into slice say 100MB files each ?

Ths.
Reply With Quote
  #2   (View Single Post)  
Old 30th January 2009
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,435
Thanked 214 Times in 189 Posts
Default

The dd(1) program can use a device node as the input file, to copy an "image" of a partition, sector-by-sector. It would need to be restored in the same fashion. Splitting the output for backup onto smaller media is possible, but the splits would need to be concatenated and dd used during restore. Was that what you meant? If so:
# dd if=/dev/r<partition> | split -b 100m -
Or were you thinking of "slicing" for performance, perhaps in RAID 0? If so, you would create a RAID device which has the underlying slices, then copy your filesystem to it. You could use ccd(4) to create a logical device, and perhaps use dd, though I would recommend dump(8)/restore(8), pax(1), or tar(1). You could also use a zfs(1M) filesystem, where dd would not be usable at all.

If you explain what you actually want to accomplish, that might be helpful.

Last edited by jggimi; 30th January 2009 at 02:56 PM.
Reply With Quote
  #3   (View Single Post)  
Old 31st January 2009
paul-lkw's Avatar
paul-lkw paul-lkw is offline
Real Name: Paul.LKW
Port Guard
 
Join Date: May 2008
Location: Hong Kong
Posts: 18
Thanked 0 Times in 0 Posts
Default

Hi jggimi:
I just want to take backup split into smaller files as whole partition will be too large to store, so ;# dd if=/dev/r<partition> | split -b 100m -
would be helpfull.

Ths and let me try.
Reply With Quote
  #4   (View Single Post)  
Old 31st January 2009
phoenix's Avatar
phoenix phoenix is offline
Risen from the ashes
 
Join Date: May 2008
Posts: 699
Thanked 90 Times in 81 Posts
Default

If your partition is less than 90% full, don't use dd to back it up. dd works at the bit-level, below the filesystem, and will create a file that is the same size of the partition. For example, if you have a 100 MB partition with 1 MB of data on it, then dd will create a file that 100 MB in size ... every time.

Use dar, tar, rsync, or even dump to create the backups, as that will only backup the data, and not the empty space in the partition.
__________________
Freddie

Help for FreeBSD: Handbook, FAQ, man pages, mailing lists.
Reply With Quote
  #5   (View Single Post)  
Old 31st January 2009
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,118
Thanked 182 Times in 149 Posts
Default

And you even can tell dump to output to different 100MB sized files
__________________
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
Forum usage: How to thank? Greg_Morgan Off-Topic 2 9th October 2009 12:49 AM
Script to mail me resources usage? bigb89 Programming 5 20th July 2008 06:58 AM
FreeBSD and bandwidth usage per subnett/IP espenfjo FreeBSD General 2 4th July 2008 08:05 AM
pagedaemon 100% cpu usage fenrisW0lf NetBSD General 14 5th June 2008 12:31 PM


All times are GMT. The time now is 12:54 AM.


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