Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Oct 2002 14:10:18 -0500 (EST)
From:      Jerry McAllister <jerrymc@clunix.cl.msu.edu>
To:        grant@thenetnow.com
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: SCSI -RAID 5 again
Message-ID:  <200210301910.g9UJAJx27171@clunix.cl.msu.edu>
In-Reply-To: <00bc01c28039$ebab2bb0$6401a8c0@grant> from "Grant Peel" at Oct 30, 2002 12:29:32 PM

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> Sorry all, the previous mail was sent prematurely...
> 
> Hi all,
> 
> ...
>
> In effect, I want to create a mirror, will this work, and would the command
> lines (in cron) look like:
> 
> dump -0u -h0 -f /dev/ad0s1 /
> dump -0u -h0 -f /dev/ad0s1/var /var
> dump -0u -h0 -f /dev/ad0s1/usr /usr
> dump -0u -h0 -f /dev/ad0s1/home /home

These dumps wil make files not file systems, so you probably want
to name a file, not a partition or directory for where to write them.
Then you will have to do a restore(8) on that file to get it on
the other partition in a usable manner.  You could pipe the output
of dump to the input of restore and put it there that way.  But, for
anything big, that makes me nervous.   I prefer making a file and
separating the steps.

I don't think the -h0 makes sense for a full dump, but maybe.
You will want to also use the 'a' flag on the dump, so
example,  dump root to some scratch space.  Then restore it to
your /dev/ados1a which you have mounted as '/altroot'

  dump 0uaf /scratch/root.dump /
  cd /altroot
  restore -rf /scratch/root.dump

Continue for the other partitions/filesystems.

Alternatively you could try

  cd /altroot
  dump 0uaf - / | restore -rf -

Restore can be weird about overwriting files of the same path/name
so I would make sure the partition was empty before doing this.

> 
> An the last question is, if I want to make the second drive bootable (in the
> event the raid system dies), do I need to load (from scratch) the OS
> (FreeBSD 4.4) on the new drive first, or, just partition and disklabel it
> creating the needed filesystems?

If you have done something like the above examples on a properly 
fdisked, disklabeled and newfsed disk, then you can just plug that 
disk in the right place and boot.   I have don't it lots of times.

If you are doing this after a disk dies and you have enough of a system 
running so you can get to your media where the backup is kept and can run 
a restore, you don't need to load a complete system.  You will need to have 
a disk fdisked and with a Master Boot sector and partitioned as you want 
and with boot1 and boot2.  Then newfs(8) the partition[s].  Then all you 
have to do is the restores and move the disk to the correct slot (or tinker 
boot sequence in BIOS) and boot up the replacement disk.  You might also 
have to tinker with /etc/fstab in single user mode if the new variation 
has different partitions or mount points, etc.

Anyway, those dumps contain the whole OS that you need - not counting
the slicing, partitioning and boot sectors and newfs-ing - to run.

////jerry

> 
> TIA,
> 
> -Grant
> 

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210301910.g9UJAJx27171>