[Discuss] How do you backup "/" with rsync?

Alan W. Irwin irwin at beluga.phys.uvic.ca
Mon Dec 10 14:08:35 PST 2007


On 2007-12-10 00:02-0800 Alan W. Irwin wrote:

[...]
> 2) reinitialize lvm taking account of the volume group on the external drive
>
> /etc/init.d/lvm2 start
>
> This is equivalent to
> 
> /sbin/vgscan --ignorelockingfailure --mknodes || true
> /sbin/vgchange -a y --ignorelockingfailure
> 
[...]
> 6) Put a stanza in /boot/grub/menu.lst corresponding to the external disk.
>
> In my case, that stanza was a copy of the usual stanza I use to boot, but
> with some changes from (hd0,0) (corresponding to /dev/sda1) to (hd1,0)
> (corresponding to /dev/sdb1) and from volume group raven to raven_backup
>
> 7) edit /external_backup_root to swap raven for raven_backup everywhere
> and also swap sda for sdb everywhere.
>
> 8) Use grub to update the MBR of the external drive.  (I haven't done that
> yet because I am still figuring out the necessary grub command-line syntax.)
>
[...]
> The result of this cookbook is I am able to boot off of the external drive
> by picking the appropriate stanza from the grub menu (currently obtained
> from /boot/grub/menu.lst pointed to by the MBR of /dev/sda, see point 8
> above). Once I have the MBR stuff straightened out, this external drive
> should provide an ideal way to continue work for the case when the internal
> drive fails and there is some delay in getting a replacement.

Steps 6 and 7 are required if you are using the MBR of the _internal_ drive
to lead you to the grub menu on the _internal_ drive which then has an added
stanza which boots off the second disk, which is currently the_external_
drive.

However, I now believe steps 6 and 7 should not be taken for the case when
you change the BIOS to use the MBR of the external disk.  In that case, I
assume the external disk will be considered as the first disk (/dev/sda)
and the internal disk as the second disk (/dev/sdb).  I have never changed
the BIOS this way so could somebody comment on whether my assumption
is correct?

If that assumption is correct, step 8 should fill the MBR of the _external_
drive with the location of the grub menu on the _external_ drive which then
boots from the first (i.e., external for this BIOS case) drive. Thus, for
this special BIOS case, I believe all should be well and there would be no
need to have a special stanza in the grub menu or swap sda/sdb and
raven/raven_backup in /etc/fstab on the external drive.

Another question on my mind for this special case is the effect
of the above vgscan and vgchange commands.  The external disk physical
partitions are almost the same but rounded slightly differently than the
physical partitions for the internal drive.  The above argument assumes
vgscan takes that into account so the resulting raven volume group not only
uses the physical partitions from the external drive, but takes account of
their slightly different size.

Can someone here with more lvm experience than me comment on this assumption?

I would prefer not to find out the hard way if my assumption about
vgscan is incorrect.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the Discuss mailing list