All, Does anyone have a good handle on how to replicate (read: image) a freebsd machine from one machine to an ostensibly similar machine? So far I've used countless variations and combinations of the following: dd (Slow, not usefull if the hardware isn't identical?) tar (Doesn't replicate MBR) rsync (No MBR support) Norton Ghost (Doesn't support UFS/UFS2?) G4U (little experience with this) Now whether my details are a bit off, that's fine, I don't want this to be diluted in to discussion of minute frivolous details (as these things are wont to do), but what I _am_ looking for is a tried, tested and true method of FreeBSD machine replication, specifically for the 5.3+ releases. Many thanks, -E-
On Thu, Jul 21, 2005 at 12:20:34PM -0700, Eli K. Breen wrote:> All, > > Does anyone have a good handle on how to replicate (read: image) a > freebsd machine from one machine to an ostensibly similar machine? > > So far I've used countless variations and combinations of the following: > > dd (Slow, not usefull if the hardware isn't identical?) > tar (Doesn't replicate MBR) > rsync (No MBR support) > Norton Ghost (Doesn't support UFS/UFS2?) > G4U (little experience with this) > > Now whether my details are a bit off, that's fine, I don't want this to > be diluted in to discussion of minute frivolous details (as these things > are wont to do), but what I _am_ looking for is a tried, tested and true > method of FreeBSD machine replication, specifically for the 5.3+ releases. > > Many thanks, > > -E-Define "similar". If the disk is compatable (target disk equal or larger in size than the source), you can use "gmirror" to image a machine, quiesce the machine, force-detach the hardware (even hot-unplug it if supported) and boot the resulting disk (if you set up the gmirror system properly in the first place) Not the fastest method, but it works and copies EVERYTHING. There are other options but you need to be more specific as to what you mean by "similar". -- -- Karl Denninger (karl@denninger.net) Internet Consultant & Kids Rights Activist http://www.denninger.net My home on the net - links to everything I do! http://scubaforum.org Your UNCENSORED place to talk about DIVING! http://homecuda.com Emerald Coast: Buy / sell homes, cars, boats! http://genesis3.blogspot.com Musings Of A Sentient Mind
On Thu, 21 Jul 2005, Eli K. Breen wrote:> All, > > Does anyone have a good handle on how to replicate (read: image) a > freebsd machine from one machine to an ostensibly similar machine? > > So far I've used countless variations and combinations of the following: > > dd (Slow, not usefull if the hardware isn't identical?) > tar (Doesn't replicate MBR) > rsync (No MBR support) > Norton Ghost (Doesn't support UFS/UFS2?) > G4U (little experience with this) >Try dump and restore. They seem to be fast and reliable (although not under Linux from all accounts). I usually use "tar" and "disklabel -B /dev/XXX" out of habit, but have found that tar doesn't honour the permissions on /tmp and /var/tmp. The sticky bit is set on these two dirs, but the permissions are not set to 777. This has me wondering what other (dir) perms are not correctly set. Gary
At 15:20 7/21/2005, Eli K. Breen wrote:>All, > >Does anyone have a good handle on how to replicate (read: image) a freebsd >machine from one machine to an ostensibly similar machine? > >So far I've used countless variations and combinations of the following: > >dd (Slow, not usefull if the hardware isn't identical?) >tar (Doesn't replicate MBR) >rsync (No MBR support) >Norton Ghost (Doesn't support UFS/UFS2?) >G4U (little experience with this)I've found a combination of dd + tar works great, as documented. Stick the new drive in the box to be duplicated, use dd on the first (forget how many) sectors to copy the mbr and partition tables over, then use a tar pipe to copy from one drive to the other, preserving all perms and so forth. Barring that, commercial single-disk duplicators aren't THAT expensive. Hell you could just use a cheap raid card to raid-1 mirror the drive, then yank it out and toss it in another box, which I've done on occasion when pressed.
At 03:20 PM 21/07/2005, Eli K. Breen wrote:>All, > >Does anyone have a good handle on how to replicate (read: image) a freebsd >machine from one machine to an ostensibly similar machine? > >So far I've used countless variations and combinations of the following: > >dd (Slow, not usefull if the hardware isn't identical?) >tar (Doesn't replicate MBR) >rsync (No MBR support) >Norton Ghost (Doesn't support UFS/UFS2?) >G4U (little experience with this)g4u is a REALLY nice front end to dd basically, but works very well and is reasonably fast. If you want fast, dump | restore as it will only copy data and ignore empty blocks. You then just need to install the MBR which is easy to do via sysinstall if you are not comfortable disklabel e.g. cd /;dump -C 20 -0f - / | (cd /mnt/root-disk; restore -rf - ) cd /;dump -C 20 -0f - /usr | (cd /mnt/usr-disk; restore -rf - ) and so on. ---Mike
On Thu, 21 Jul 2005, Eli K. Breen wrote:> All, > > Does anyone have a good handle on how to replicate (read: image) a freebsd > machine from one machine to an ostensibly similar machine? > > So far I've used countless variations and combinations of the following: > > dd (Slow, not usefull if the hardware isn't identical?) > tar (Doesn't replicate MBR) > rsync (No MBR support) > Norton Ghost (Doesn't support UFS/UFS2?) > G4U (little experience with this)<snip> Is there a jumpstart (solaris), kickstart (redhat linux), roboinst (irix), or ignite (hpux) like auto-installer for BSD? If there was, then I wouldn't image the disk at all, I'd instead setup up custom network images that I could blast to any system just by pxebooting it. I'm not sure if it is possible with FreeBSD though, anyone? Dan
>From: owner-freebsd-stable@freebsd.org >[mailto:owner-freebsd-stable@freebsd.org] On Behalf Of Eli K. Breen >Sent: Thursday, July 21, 2005 3:21 PM >To: freebsd-stable@freebsd.org >Subject: Machine Replication > >All, > >Does anyone have a good handle on how to replicate (read: image) a >freebsd machine from one machine to an ostensibly similar machine? > >So far I've used countless variations and combinations of the >following: > >dd (Slow, not usefull if the hardware isn't identical?) >tar (Doesn't replicate MBR) >rsync (No MBR support) >Norton Ghost (Doesn't support UFS/UFS2?) >G4U (little experience with this)If you need stuff replicated fast and you don't mind a bit of setup, there is emulab http://www.emulab.net/. I can push out new images to machines in less than 10 minutes including the time it takes to reboot twice (once into the imager and once back to the OS). You may need to use UFS1 for your filesystems though, I don't know if the imager can handle UFS2 yet. We use UFS1 here just to be safe.
On Thu, Jul 21, 2005 at 12:20:34PM -0700, Eli K. Breen wrote:> > Does anyone have a good handle on how to replicate (read: image) a > freebsd machine from one machine to an ostensibly similar machine?[...]> Now whether my details are a bit off, that's fine, I don't want this to > be diluted in to discussion of minute frivolous details (as these things > are wont to do), but what I _am_ looking for is a tried, tested and true > method of FreeBSD machine replication, specifically for the 5.3+ releases.I have found the following paper to be incredibly usefull : http://www.pix.net/software/pxeboot/archive/SANE.pdf I used some of the ideas in it to clone machines in the 5.1-5.2 era. -- Francois Tigeot, CEO, Zefyris http://www.zefyris.com/
I should point out, this is for replication in a running production environment. Machines cannot be taken down, and swapping hardware is not an option. I'm currently experimenting with a copy of the MBR, and the root partition on a CD, with enough tools to attach to the network to retrieve images of the rest of the partitions (which can be taken as current snapshots from various servers). This _should_ result in the following scenario: Boot new machine with CD partition drive(s) dump MBR dump root ssh foo@server 'dump -C 64 -0af - /sliceX'| (cd /usr; restore -rf -) [repeat above for all drives, could be automated] Seem reasonable? -E- Elliot Finley wrote:> ----- Original Message ----- > From: "Francois Tigeot" <ftigeot@wolfpond.org> > >>On Thu, Jul 21, 2005 at 12:20:34PM -0700, Eli K. Breen wrote: >> >>>Does anyone have a good handle on how to replicate (read: image) a >>>freebsd machine from one machine to an ostensibly similar machine? >> >>[...] >> >> >>>Now whether my details are a bit off, that's fine, I don't want this to >>>be diluted in to discussion of minute frivolous details (as these things >>>are wont to do), but what I _am_ looking for is a tried, tested and true >>>method of FreeBSD machine replication, specifically for the 5.3+ > > releases. > >>I have found the following paper to be incredibly usefull : >> >>http://www.pix.net/software/pxeboot/archive/SANE.pdf >> >>I used some of the ideas in it to clone machines in the 5.1-5.2 era. > > > You could also just mirror the drive with a Promise RAID 1 card. I've done > that a couple of times and it works really well. > > Elliot >
On Thu, Jul 21, 2005 at 12:20:34PM -0700, Eli K. Breen wrote:> dd (Slow, not usefull if the hardware isn't identical?)I use dd a lot for this type of thing and don't see how it could possibly be slower than any other method that duplicates the entire raw drive. Make sure to give it a "bs=1m" option as reading/writing the disk in 512 byte chunks is a lot slower than larger blocks. If your disks have a lot of free space, copying the filesystem using dump/restore can be faster, but it's not an *exact* bit-for-bit copy. The resulting filesystem is functionally equivalent though, so it's probably the best way for duplicating UFS(2) filesystems. You do have to partition manually, but you would probably want to do that if the new drive was a different size anyway. Craig
For what its worth I use Norton Ghost to regularly set up a classroom of machines with FreeBSD 5.3, mostly because other teachers put Windoze stuff on the same boxes so the Ghost setup makes sense. Ghost doesn't understand UFS but doesn't need to. It just takes a block by block copy of the whole partition. To keep the images a reasonable size I do a dd if=/dev/zero bs=1m of=/junk; rm /junk (repeat for every file system) before imaging and tell ghost to do high compression. Compressing lots of zeros is really efficient so the images come out a reasonable size. Using multicasting I can dump the image in parallel onto 15 machines and have the system installed in under 10 minutes. IP configuration is done with DHCP so thats all straightforward. I use a small dhcp client hook script to change the system name based on IP so I even get unique system names The fact that the hardware on all of the target machines is the same is obviously a huge benefit because I can use a single X configuration, but FreeBSD travels to new hardware a lot better than any of the other O/Ss do. The only real issue is that I have some variety of hard disk types but providing the original partition isn't bigger than my smallest target drive, Ghost looks after everything properly. I haven't found a decent freeware alternative that I could get the same results from but hope to some day. -----Original Message----- From: owner-freebsd-stable@freebsd.org [mailto:owner-freebsd-stable@freebsd.org] On Behalf Of Eli K. Breen Sent: Friday, 22 July 2005 5:21 AM To: freebsd-stable@freebsd.org Subject: Machine Replication All, Does anyone have a good handle on how to replicate (read: image) a freebsd machine from one machine to an ostensibly similar machine? So far I've used countless variations and combinations of the following: dd (Slow, not usefull if the hardware isn't identical?) tar (Doesn't replicate MBR) rsync (No MBR support) Norton Ghost (Doesn't support UFS/UFS2?) G4U (little experience with this) Now whether my details are a bit off, that's fine, I don't want this to be diluted in to discussion of minute frivolous details (as these things are wont to do), but what I _am_ looking for is a tried, tested and true method of FreeBSD machine replication, specifically for the 5.3+ releases. Many thanks, -E- _______________________________________________ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org" ********************************************************************** This message is intended for the addressee named and may contain privileged information or confidential information or both. If you are not the intended recipient please delete it and notify the sender. **********************************************************************
At 2005-07-21 19:20:34+0000, "Eli K. Breen" writes:> All, > > Does anyone have a good handle on how to replicate (read: image) a > freebsd machine from one machine to an ostensibly similar machine? > > So far I've used countless variations and combinations of the following: > > dd (Slow, not usefull if the hardware isn't identical?)I have used dd | gzip -9 on many occasions. I don't find it especially slow (it will run at full disk bandwidth, typically 50 MB/sec on current ATA desktop disks, i.e. 3G/minute), and if you want an actual bit-for-bit identical replication then it's the only way to go. It's also very handy for keeping multi-boot slice images around (e.g. images of Windows partitions in various states, for testing purposes). The compressed images often end up nice and small. The disadvantage you may have is that your slice table and/or partition table will be wrong if your target machine has a larger disk. This is pretty easy to fix after the fact with a script using disklabel and/or fdisk. You will get better compression if you dd /dev/zero to your source machine before the initial installation, so that empty sectors are all zeroes. One day I will write a program which zeroes empty blocks of an unmounted filesystem....> tar (Doesn't replicate MBR) > rsync (No MBR support)Replicating the MBR is exceptionally easy with dd: it's the first sector of the disk. Note that this first sector also includes the slice table. You could easily use dd in combination with tar and rsync.> Norton Ghost (Doesn't support UFS/UFS2?) > G4U (little experience with this)I notice that 'dump' is not in your list. Why is that? Nick Barnes Ravenbrook Limited