Bare Metal Recovery

While the install of IPCOP is a simple and quick process, many users customize IPCOP with addons which may take time to reinstall. To simplify the process of restoring IPCOP after a hardware failure (such as the hard drive), many people look to BMR (Bare Metal Recovery).

In this tutorial, details directions will take you through creating a backup of IPCOP and restoring IPCOP from the backup. No assumptions about prior Linux or recovery experience are made.

Requirements for BMR

  1. IPCOP (configured the way you want)
  2. A Network Share where we will backup IPCOP to (this could be a Windows share or a Linux box running Samba, in this example we will use FreeNAS)
  3. Knoppix Linux

Hardware used in this example

  1. IPCOP
    • IPCOP Version 1.4.16
    • 1 GHz processor
    • 128 MB RAM
    • 300 MB HDD
    • CD-ROM Drive
    • Red- 10/100 NIC (DHCP)
    • Green- 10/100 NIC (192.168.1.1/24)
  2. Network Share
    • FreeNAS Version 0.686b2
    • 1 GHz processor
    • 128 MB RAM
    • 100 MB HDD (OS)
    • 1 GB HDD (Raid1-1)
    • 1 GB HDD (Raid1-2)
    • CD-ROM Drive
    • 10/100 NIC (192.168.1.2/24)
    • Folder shared with username/password protection
  3. Desktop Computer
    • Windows XP Home
    • 1.5 GHz processor
    • 512 MB RAM
    • 20 GB HDD
    • DVD/CD-RW Drive
    • 10/100 NIC (192.168.1.3/24)

Preparing your network share

Your network share may be either a Windows Share or a Linux box running Samba. If you use a Windows Share, make sure you specify a username and password with access to the share.

In this example, the network share will be FreeNAS with CIFS (Samba) running. FreeNAS is designed to run on a dedicated box (similar to IPCOP) and supports Software RAID.

Steps to get FreeNAS installed and working:

  1. Insert the FreeNAS 0.686b2 (latest as of this writing) into your CD-ROM drive of the computer you want to install FreeNAS on
  2. Boot your computer from the CD
    Wait for FreeNAS to completely reboot. At the splash screen, press enter to see the console. Once you see Console Setup, continue to the next step.
  3. At the Console, select ’Set LAN IP address’ {2}
  4. Enter the DHCP option {n}
  5. Enter the IP address you want the FreeNAS to use {192.168.1.2}
  6. Enter the subnet mask {24}
  7. Enter the default gateway {192.168.1.1}
  8. Enter the DNS address {enter}
  9. Enter the IPv6 option {y}
  10. Press {enter} to continue
  11. Select ’Install/Upgrade to an hard drive…’ {9}
  12. Select ’Install full release on hard drive…’ {3}
  13. Enter the name of the CD-ROM drive {acd0}
  14. Enter the name of the HDD to install the OS to (the 100 MB one used) {ad0}
  15. Enter the size of the OS partition {64}
  16. Press {enter} to continue
  17. Select ’Return to main menu’ {7}
  18. Select ’Reboot system’ {7}
  19. Confirm reboot {y}
    Wait for FreeNAS to completely reboot. At the splash screen, press enter to see the console.
  20. From the desktop, connect to FreeNAS through the web interface (url 192.168.1.2)
    • Username = admin
    • Password = freenas
  21. Add the Disks
    • Goto Disks – Management
    • Click the Plus sign to add each disk
      We will only be adding the 1 GB drives
    • Select the disks from the disks dropdown menu (ad1, ad2, or ad3)
      Do not select ad0 as this is where we installed the OS
    • Under Preformatted FS, select Software RAID
    • Click ’Save’
    • Click ’Apply Changes’ to have the changes saved
    • Repeat until ALL drives have been added
  22. Add the RAID
    • Goto Disks – Software RAID
    • Select the RAID type at the top {RAID1}
    • Select the Plus sign to add the RAID
    • Give the RAID a name {RAID1}
    • Select all drives
    • Click ’Add’
    • Click ’Apply Changes’
  23. Format the RAID
    • Goto Disks – Format
    • Under Disk, select the RAID {RAID1}
    • Under Volume Label, enter a name {RAID1Vol}
    • Click ’Format disk’
  24. Add the Mount Point
    • Goto Disks – Mount Point
    • Select the Plus sign to add a mount point
    • Under Disk, select the RAID {RAID1}
    • Under Name, enter a name {IPCOP_Backup}
    • Under Description, enter a description {IPCOP Backup Folder}
    • Click ’Add’
    • Click ’Apply changes’
  25. Add Local Users
    • Goto Access – Users and Groups
    • Select Groups
    • Click the Plus sign to add a new group
    • Under Name, enter a name {IPCOPGroup}
    • Under Description, enter a description {IPCOP Group}
    • Click ’Add’
    • Click ’Apply Changes’
    • Click ’Users’
    • Click the Plus sign to add a new user
    • Under Login, enter the userID {IPCOPbk}
    • Under Full Name, enter the full name {IPCOP Backup Acct}
    • Under Password, enter the password {G0ODpwd}
    • Under confirmation, reenter the password {G0ODpwd}
    • Click ’Add’
    • Click ’Apply Changes’
  26. Enable CIFS/SMB
    • Goto Services – CIFS/SMB
    • Click Enable
    • Under Authentication, select ’Local User’
    • Click ’Save and Restart’
    • Click ’Shares’
    • Click the Plus sign to add a new Share
    • Under Name, enter a name {Bk}
    • Under Comment, enter a comment {Backup Folder}
    • Under Path, click the ’…’
    • In the pop-up window, select your folder {IPCOP_Backup}
    • Click ’OK’ (path should be /mnt/IPCOP_Backup/)
    • Click ’Add’
    • Click ’Apply Changes’

Creating a backup of IPCOP

Steps to create a backup of IPCOP:

  1. Shutdown IPCOP
  2. Disconnect the WAN cable from the Red NIC
  3. Boot from the Knoppix CD
  4. Press {enter} to boot Knoppix
  5. Once Knoppix has loaded, open a shell window
  6. Enter root mode {su -}
  7. Assign an IP address {ifconfig eth0 192.168.1.1 up}
  8. Create a temporary folder to backup IPCOP to {mkdir /IPCOPbk}
  9. Mount the network share with the following command:
    	mount -t smbfs -o username=[username],password=[password] //server.IP.Address/ShareName /[MountLocation]
    	
    	mount -t smbs -o username=IPCOPbk,password=G0ODpwd //192.168.1.2/Bk /IPCOPbk
    	
  10. Backup IPCOP with the following command
    	dd if=/dev/hda |gzip -c > /IPCOPbk/IPCOPbk.dd.gz
    	
  11. Shutdown the computer {shutdown -h now}
  12. Remove the Knoppix CD
    You have now successfully created a backup of IPCOP
  13. Reconnect the WAN cable to the Red NIC

Restoring IPCOP from a backup

Steps to restore IPCOP from a backup:

  1. Disconnect the WAN cable from the Red NIC
  2. Boot from the Knoppix CD
  3. Press {enter} to boot Knoppix
  4. Once Knoppix has loaded, open a shell window
  5. Enter root mode {su -}
  6. Assign an IP address {ifconfig eth0 192.168.1.1 up}
  7. Create a temporary folder to backup IPCOP to {mkdir /IPCOPbk}
  8. Mount the network share with the following commnad :
    	mount -t smbfs -o username=[username],password=[password] //server.IP.Address/ShareName /[MountLocation]
    	
    	mount -t smbs -o username=IPCOPbk,password=G0ODpwd //192.168.1.2/Bk /IPCOPbk
    	
  9. Backup IPCOP with the following command
    	gzip -dc /IPCOPbk/IPCOPbk.dd.gz dev/hda |dd of=/dev/hda
    	
  10. Shutdown the computer {shutdown -h now}
  11. Remove the Knoppix CD
    You have now successfully restored IPCOP from a backup
  12. Reconnect the WAN cable to the Red NIC
  13. Reboot IPCOP