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

John Blomfield jabfield at shaw.ca
Tue Dec 11 09:53:18 PST 2007


Alan W. Irwin wrote:
> On 2007-12-10 15:58-0800 John Blomfield wrote:
>
>> I am not sure if this is what your looking for but I mentioned this 
>> before when talking about recovering a damaged MBR.  I am assuming 
>> here that you have backed up your /boot directory containing grub 
>> onto your external HD along with everything else.  Then you need to 
>> recreate the MBR on the external HD, so boot the system with a 
>> "Rescue CD" containing the usual Linux utilities, which will find 
>> your two Linux installations, one on your internal HD and one on your 
>> external HD. Then:
>>
>> # chroot /mnt/sysimage   - this gives you access to your installation 
>> image, this name could be different with different distributions.( 
>> Fedora in this case, the Fedora rescue disc works with any distribution)
>>
>> Then do the following:
>>  # login
>>   login: root
>>  passwd: ******
>>  # cd /boot
>>  /boot# grub
>>  grub > find /boot/grub/stage1
>>  "response will be something like " (hd0, 0) (hd1, 0)
>>  -what this tells you is that stage1 of grub has been found in two 
>> partitions, one of which is the partition (hd0, 0) or sda1 your 
>> internal HD, and the other partition (hd1, 0) or sdb1 your external 
>> HD.  Now type, ( note the > is the Grub prompt)
>>   > root (hd1, 0)
>>  > setup (hd1)
>>  > quit
>>
>> This will make your external HD bootable with a grub menu, as well as 
>> your internal HD.  Now all you have to do is to change the BIOS to 
>> choose which one you want to boot from.
>
> Thanks, John, for that suggestion for setting the MBR of the external 
> drive.
>
> I have never used the grub command directly so I have two follow up
> questions. Is it really necessary to be in rescue mode to set the MBR 
> of the
> external drive?  For example, can't you just invoke grub from the 
> ordinary
> command line as the root user?
>
Yes, I think that may work although I have never tried it. Just make 
sure perhaps that the /boot directory and grub you invoke is the one in 
the external drive not the internal drive.  I've always used the rescue 
disk route because when I've needed this the MBR is broken.

John
> 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