How to backup root filesystem the correct way....

Daniel B. Thurman dant at cdkkt.com
Fri Dec 16 05:45:26 UTC 2005


>From: fedora-list-bounces at redhat.com
>[mailto:fedora-list-bounces at redhat.com]On Behalf Of Daniel B. Thurman
>Sent: Thursday, December 15, 2005 9:32 PM
>To: ringwas at acm.org; For users of Fedora Core releases
>Subject: RE: How to backup root filesystem the correct way....
>
>
>>From: fedora-list-bounces at redhat.com
>>[mailto:fedora-list-bounces at redhat.com]On Behalf Of Steve Ringwald
>>Sent: Thursday, December 15, 2005 5:39 PM
>>To: For users of Fedora Core releases
>>Subject: Re: How to backup root filesystem the correct way....
>>
>>
>>
>>
>>Daniel B. Thurman wrote:
>>> I am familiar with the unix dump and restore programs from 
>my hey-dey
>>> and system admin used these for backing up individual 
>>filesystems to tape
>>> using these programs. But apparently, someone here told me 
>that using
>>> dump/restore is not the preferred way and said that Torvald quoted
>>> that tar is better than D/R because it is not maintained nor 
>>current and
>>> may be fraught with failures.... and recommended that TAR be used.
>>>
>>> Geez....
>>>
>>> Well since I have a /boot problem, i.e. I blithely used a 
>>partition of /, including
>>> /boot and a seperate partition for swap (i.e. two 
>>partitions) of which my BIOS
>>> may eventually fail to see /boot, so I need to correct this 
>>mistake. But before I do,
>>> I need to backup my main boot drive by copying its contents 
>>to my 2nd drive
>>> so that I can recover if all hell breaks loose.
>>>
>>> So... 
>>>
>>> When I used /tar this way:
>>>
>>> tar zcvf root.tgz -C /<second-disk> /
>>>
>>> It appears that everything gets tarred up but there are many errors
>>> put out (such as sockets and such) but eventually after a long time,
>>> the final error at the end (whereever that may be) reports:
>>>
>>> tar: Error exit delayed from previous errors
>>>
>>> Hmm... cryptic as heck. But the bottom line is that there is no
>>> guarantee that all the files are being properly backed up.  Seems
>>> that this is very unreliable.
>>>
>>> Perhaps I should just use dump | restore to backup the filesystem
>>> to another filesystem (disk) would be better?  What is the 
>>reccommended
>>> way to backup the root disk to my second backup disk?
>>>   
>>Daniel,
>>
>>Well, what I would do is boot off the rescue image on the install cd.
>>
>>Partition the destination disk (I would use fdisk and 
>>mkfs.ext3/mkswap) 
>>then mount those partitions as /destination, /destination/boot, etc. 
>>Mount your src partitions in a src directory (or whatever) /src, 
>>/src/boot, etc.
>>
>>Then go to the source directory and type:
>>
>>find . | cpio -pmd /destination (or you could use rsync, or tar -cvp)
>>
>>Then all you need to do is install grub on the destination 
>>drive, update 
>>your /destination/fstab, and delete /destination/{mtab,blkid}*.
>>
>>Unmount the partitions, powerdown, pop out the source drive, and the 
>>destination should be good to go.
>>
>>Hope that this helps!
>>Steve
>>
>
>OK, my major issue right now is getting GRUB to work and
>I am not able to get GRUB to see my /boot partition I am
>assuming since it cannot find the configuration files nor
>can it boot.
>
>I have:
>
>/dev/hda1 /boot
>/dev/hda2 /
>/dev/hda3 swap
>
>Documentation says to install grub as follows:
>
>1) Boot off rescue CD
>2) chroot /mnt/sysimage
>3) grub-install /dev/hda
>
>But therein lies my problem I think.  Is it supposed to be:
>
>3) grub-install /dev/hda1   OR
>3) grub-install --root-directory=/ /dev/hda?
>3) grub-install --root-directory=/boot /dev/hda?
>
>Do I have to somehow install the MBR on /dev/hda or
>is this part of GRUB's job?
>
>Thanks!
>Dan
>

Yup - It was /var that was a problem - tar crapped out there
in mulituser mode.  But when I tried:

dump -0 -f - /dev/hda1 | (cd /mnt/disk2; restore -rf - )

It worked like a charm and is actually very fast compared
tar.  Tar took several hours and the dump/restore took
something like 30 minutes.

Also, I tried the other way too: to boot in rescue linux
and then to mount the src and dst filesystem and use the

cd /mnt/src; find . | cpio -pmd /dst per Steve's suggestion

Fast also.

I have backed up the src filesystem to the dst filesystem,
repartitioned the src partition to:

/dev/hda1 /boot  40MB
/dev/hda2 /      12GB
/dev/hda3 swap    2GB

and tried: grub-install /dev/hda
and grub fails to boot on the first try.

I tried: grub-install /dev/hda1
and grub went into interactive mode.  I noted that
doing this actually created /boot/boot/(grub-installed-files)
which is not what I want - I think....  Anyway it failed
bad.

I tried: grub-install /dev/hda1 : Failed
I tried: grub-install --root-directory=/     /dev/hda (also /dev/hda1) : Failed
I tried: grub-install --root-directory=/boot /dev/hda (also /dev/hda1) : Failed

So - I am at loss why grub is not working right for me....

HELP!!!! :-)

Dan

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.13.13/200 - Release Date: 12/14/2005
 




More information about the fedora-list mailing list