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
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: 7,975
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
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: 696
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: 4,125
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 07:31 AM.


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