Jump to content
When you buy through links on our site, we may earn an affiliate commission.
  • Current Donation Goals

How to create a bootable backup of BSD?


freddy333

Recommended Posts

Is there a software app (similar to Norton Ghost) that can create a bootable copy of a BSD Unix system onto a new/larger hard drive?

I know that Ghost & similar utilities can do this with Windows systems & they can also image a BSD file system over to a new/larger hard drive, but, the last time I checked (several years ago), an imaged BSD drive is not bootable.

I have an old web server running BSD 4.3 & Apache 1.3 composed of a pair of 80gig Western Digital IDE hard drives (installed via a SIL680 RAID card) configured as RAID1 via atacontrol. The hardware is several years old & currently running fine, but I want to migrate everything over to new, larger hard drives before a drive fails. Optionally, I would like to relocate to an entire new PC & use the motherboard's built-in RAID software to configure the RAID so I can eliminate the SIL680 card, which is handling the RAID now. However, the last time I migrated to new drives, you had to install BSD from scratch & then migrate the old data over to the drives. Unfortunately, at that time, there were no utilities that were able to make a bootable copy of a BSD filesystem & I am hoping that that has changed.

Link to comment
Share on other sites

dd if=/dev/sda of=/dev/sdb bs=4096 conv=notrunc,noerror

This will clone the entire drive, including MBR (and therefore bootloader), all partitions and data.

notrunc or 'do not truncate' maintains data integrity by instructing dd not to truncate any data.

noerror instructs dd to continue operation, ignoring all input errors. Default behavior for dd is to halt at any error.

bs=4096 sets the block size to 4k, an optimal size for hard disk read/write efficiency and therefore, cloning speed.

Best approach is to boot from a bootable CD/USB and Mount both the original and new drive, and execute "dd" from there.

You CAN dd from the live primary, but beware open files or writes going on during the clone.

Finally, "dd" will be make the exact copy including the original partition size. You will then need to expand the file system. If you are using UFS than man "growfs", or play with gpart.

To recap, dd, gpart/growfs should do the trick.

Link to comment
Share on other sites

I will give that a try, but I have a few questions (I really used to know this stuff, but it has been years since I have worked in *nix) -

1. Does the fact that I am using atacontrol to form a RAID with the 2 hard drives change content of the command-line you posted above? Or, do I need to unmount the individual drives 1st, & just clone the primary drive?

2. What is the command to find the listing of drive names? I do not recognize /dev/sda or /dev/sdb?? Is it da?

3. What is the command to mount both the source & destination drives? And is if= the source & bs= the destination or vice-versa?

Thank you.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...
Please Sign In or Sign Up