Re: How to install bootmanager on backup disk?



On Tue, 15 Jul 2008 09:24:17 -0700, n33ed wrote:

Hello freebsd gurus ... I have what I think is probably an easy question
for you: how can I make a backup disk that has /, /usr, / tmp, /var etc.
partitions so that it is bootable?

Here's the situation: I come for a Linux background but inherited admin
of a FreeBSD system (still 6.1). This system has /, /tmp, /var on one
disk, and /usr on another disk. There was no backup system.

You mean you don't have it running Linux yet? :)


My first move was to institute some sort of backup, and I chose to use
one that I find convenient on Linux: have a backup disk that is rsync'd
periodically with the main disks, and make it bootable so that if
anything happens to the main disks, I can just swap cables and boot off
the backup. IOW, I would reconnect the backup disk as the primary master
and boot from it, using it as the main disk at least temporarily.

The first part is done: I installed one disk big enough for all the
partitions, created one slice and four partitions,

I use hot swap removable drives for backup, so after slicing and
partitioning the drive like you've done above, I run a fairly elaborate
interactive shell script to ensure that I don't screw up.

Since its easier for me to show an example than try to explain it,
I've extracted only the essential commands from a script having many lines
of code to parse, validate, and eliminate human input error into a script
presented below. Use at your own risk:

#!/bin/sh
# Target drive must be sliced and partitioned before running this script
MOUNT_POINT="/mnt"
EDITOR="vi"

# Destination must include a fully qualified device name
DEST="<target_partition>" # Example: /dev/ad6s1f

# File system to back up
SOURCE="<source_FS>" # Example: /usr

newfs $DEST
mount $DEST $MOUNT_POINT
cd $MOUNT_POINT

# Clean out old contents, if any
chflags -R noschg *
rm -rf *

# Dump in new contents
dump 0afL - $SOURCE | restore xf -

cd /
if [ "$SOURCE" = "/" ]
then
# /etc/fstab must be edited to make drive bootable
$EDITOR $MOUNT_POINT/etc/fstab
fi

cd /
umount $MOUNT_POINT
# End of Script

Note 1: For a complete backup, you have to edit the DEST and SOURCE lines
and run the script for each File System you have: /, /tmp, /var, /usr, etc.

Caution: If you make a typo error when editing the DEST and SOURCE lines
in the above script, you have the potential of wiping out your entire
system. The onus is on you to add whatever other commands you feel
necessary that will parse and validate your settings for DEST and SOURCE
and prevent the script from running if the values are incorrect. How you
go about it is for you to figure out.

Note 2: I run a system with all drives bootable and use the system BIOS to
select which drive gets booted from. As a consequence, when I do a backup
of a root partition, I need to edit /etc/fstab so that the entries therein
point to the drive containing the backup rather than to the source drive
that was backed up. The script ensures that I don't forget to do so by
calling up the editor with /etc/fstab loaded for editing, when I backup
the root partition. You may want to comment out or remove the code for
this if it is not applicable to your situation.

Note 3: After slicing/partitioning the drive and doing a complete backup,
to keep the backup data refreshed, you have the option of either
re-running the above script periodically, or running some other script
that updates only selected files using some other method.

Personally, I've found dump/restore to be the most reliable for doing
backups and tend to favor it over other methods. Other backup methods,
depending on which one is used, either ignore or do not always properly
restore file links, file ownerships, file permissions, etc., which results
in a lot of pain, should you actually have to use what you backed up.


and rsync'd it. But
how do I make it bootable, ie how do I install a bootmanager on it? On
Linux, I can boot off either a floppy (remember those?) or a live CD and
install lilo or grub.

Since I'm new to FreeBSD, it is with trepidation that I use fdisk,
boot0cfg, disklabel, etc. - I definitely don't want to endanger the
bootability of the main system.

Use -

Command: sysinstall
Option: Custom installation

to slice and partition your backup drive, then run script presented above.


Once I have some sort of backup, I want to take the next step: use a USB
backup disk so that it can be physically removed. That's what I do on
Linux: I use automount to sense the backup drive, the rsync to it. I
know FreeBSD has atd and so it has some similar capability, right? But
first I want to be able to boot off my PATA backup drive.

Thanks for any hints or advice!

Jim

.



Relevant Pages

  • Re: OT-True Image Backup
    ... Make sure the USB drives file system is NTFS and not FAT32.. ... Jaymon is correct in that the disk image you create and save to the D: ... partition of your USB external HDD will have no effect on the other ... Step-by-Step Instructions for Using the Acronis True Image Program to Backup ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: OT-True Image Backup
    ... Make sure the USB drives file system is NTFS and not FAT32.. ... Jaymon is correct in that the disk image you create and save to the D: ... partition of your USB external HDD will have no effect on the other ... Since the disk images you will be creating (at least the initial backup ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Replacing Notebook Hard Drive
    ... both the disk cloning & disk imaging capabilities of the ATI program. ... Step-by-Step Instructions for Using the Acronis True Image Program to Backup ... can take to back up the entire contents of one's day-to-day working HDD, ... With both hard drives connected, ...
    (microsoft.public.windowsxp.hardware)
  • Re: Acronis and new disk
    ... with using the disk copying/disk cloning programs such as the MaxBlast ... contents of your 40 GB HDD to your new 120 GB HDD rather than creating a ... Step-by-Step Instructions for Using the Acronis True Image Program to Backup ... With both hard drives connected, ...
    (microsoft.public.windowsxp.hardware)
  • Re: Need help backing up my C: drive
    ... I tried using Windows' backup and restore which works for important data ... consider a disk imaging program such as ... Acronis True Image to clone the contents of your day-to-day working HDD onto ... With both hard drives connected, ...
    (microsoft.public.windowsxp.general)