DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD Installation and Upgrading

FreeBSD Installation and Upgrading Installing and upgrading FreeBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 13th October 2008
peterg22 peterg22 is offline
New User
 
Join Date: Oct 2008
Posts: 3
Default Installation master "disk" using USB memory stick, dd?

Carpetsmoker - thanks for a truly useful site!

I've just completed a new server install of FreebSD 7.0-RELEASE and want to make a master backup for possible installation on a series of other boxes. What I'd like to do ideally is to use dd to copy my base install to a USB memory stick, then just dd it up to the new machine's hard drive. Like..

Code:
dd if=/dev/da0 of=/dev/da1 bs=1024
Would this work?

Thanks in advance..
Reply With Quote
  #2   (View Single Post)  
Old 13th October 2008
vermaden's Avatar
vermaden vermaden is offline
Administrator
 
Join Date: Apr 2008
Location: pl_PL.lodz
Posts: 1,056
Default

Yes, this would work mate.

To make it faster use bs=8MB
__________________
religions, worst damnation of mankind
"If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds

Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”.
vermaden's: links resources deviantart spreadbsd
Reply With Quote
  #3   (View Single Post)  
Old 13th October 2008
peterg22 peterg22 is offline
New User
 
Join Date: Oct 2008
Posts: 3
Default

Thanks! This is going to make life so much simpler
Reply With Quote
  #4   (View Single Post)  
Old 14th October 2008
graudeejs's Avatar
graudeejs graudeejs is offline
Real Name: Aldis Berjoza
ISO Quartermaster
 
Join Date: Jul 2008
Location: Riga, Latvia
Posts: 589
Default

you can dd it to output and compress it on the fly....
, however i prefer using dump and restore, they should be more way faster than dd, since they won't save unused space on hard drive....
also backup file will be smaller (and also can be compressed on the fly)
+ backup can be made for running filesystem, the only thing is it works only on UFS

to backup and compress
Code:
$ dump -0Lauf - /dev/ad4s1d | bzip2 -9 > /path/to/ad4s1d.bak.bz2
to uncompress and restore restore
note for this you will need some /tmp space, if tmp is to small it will fail, so you might need to link /tmp to bigger filesystem
Code:
$ newfs -U /dev/ad4s1d
$ mount /dev/ad4s1d /mnt
$ cd /mnt
$ bzcat /path/to/ad4s1d.bak.bz2 | restore -xf -
I think, tha sould do the trick....


read
man dump
man restore


also you can use this method to resize partitions
or clone FreeBSD among other PC's (you will need to copy MBR to all of them with dd)

Last edited by graudeejs; 14th October 2008 at 06:40 AM.
Reply With Quote
  #5   (View Single Post)  
Old 14th October 2008
peterg22 peterg22 is offline
New User
 
Join Date: Oct 2008
Posts: 3
Default

Thanks! I set off my "dd" to the memory stick last night and it ran for hours - wish I'd read your reply before I started
Reply With Quote
  #6   (View Single Post)  
Old 14th October 2008
graudeejs's Avatar
graudeejs graudeejs is offline
Real Name: Aldis Berjoza
ISO Quartermaster
 
Join Date: Jul 2008
Location: Riga, Latvia
Posts: 589
Default

also if you dd data from disk that is smaller to disk that is greater, you will not be able to use unused space

for example
spource disk is 8GB
target disk is 160BG

if you dd then you will overwrite filesystem/partition table etc... and therefore won't be able to use rest of free space....
Reply With Quote
  #7   (View Single Post)  
Old 14th October 2008
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Banned
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Default

Not entirely true killasmurf86, but somewhat... directly using dd for such things isn't what I'd recommend, dump+restore and preparing the new disk is somewhat better.

A direct "dd" to a new disk will work in some situations... but he'll need to increase the size of the MBR partition and the disklabel.. then carefully use growfs.

Often there are many solutions to the same problem on Unix..
Reply With Quote
  #8   (View Single Post)  
Old 14th October 2008
graudeejs's Avatar
graudeejs graudeejs is offline
Real Name: Aldis Berjoza
ISO Quartermaster
 
Join Date: Jul 2008
Location: Riga, Latvia
Posts: 589
Default

Quote:
Originally Posted by BSDfan666 View Post
Not entirely true killasmurf86, but somewhat... directly using dd for such things isn't what I'd recommend, dump+restore and preparing the new disk is somewhat better.

A direct "dd" to a new disk will work in some situations... but he'll need to increase the size of the MBR partition and the disklabel.. then carefully use growfs.

Often there are many solutions to the same problem on Unix..
I know, that, i was just lazy to write....
anyway, in most cases, simple user will mess up with dd
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
Opera Port - conflicting pkgs in "make install" IronForge OpenBSD Packages and Ports 5 29th October 2009 05:10 AM
Fixed "xinit" after _7 _8, "how" here in case anyones' "X" breaks... using "nvidia" jb_daefo Guides 0 5th October 2009 09:31 PM
"Thanks" and "Edit Tags". diw Feedback and Suggestions 2 29th March 2009 12:06 AM
Scripted sysinstall fails with "Command 'system' failed" PeterSteele FreeBSD Installation and Upgrading 0 13th November 2008 11:31 PM
Newbie-friendly "printing in OpenBSD" guide wanted Shagbag OpenBSD Packages and Ports 5 7th July 2008 09:26 PM


All times are GMT. The time now is 10:01 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