backing up and restoring the root partition

Paulo Cavalcanti promac at gmail.com
Sun Jun 1 10:30:22 UTC 2008


On Sat, May 31, 2008 at 7:42 PM, Gene Czarcinski <gene at czarc.net> wrote:

> In the past, I have always assumed that I would simply re-install if I lost
> my
> root partition and only did backups for data partitions and home.  My
> systems
> are configured to have a boot partition, a root ("/") partition, a /home
> partition, and other "my data" partitions.   While I use LVM for my data
> partitons, I have been using a regular disk partition for root.  In the
> past
> I have used partimage (and now partimage-ng) to backup disk partitions but
> these programs do not work with LVM logical volumes.
>
> Before I commit to putting my root partition on an LVM logical volume, I
> thought I would like to try backing it up ... I have tried using
> dump/restore
> and tar ... oh, backup/save seems to work just fine (no error message) but
> restore/tar -x is NOT working.
>
> Using restore, I get some selinux errors but not with tar -x.  However, in
> both cases, when I try to boot the system, I am getting errors such as not
> finding /dev/root, /proc, etc.
>
> Has anyone ever done a backup of the root partition?  What program did you
> use?  Have you tried to restore and did it work? [or did you just trust
> that
> it would?]
>
> I did my testing using vmware virtuals but that should not matter.  I
> installed a"default" F9 installation with /boot and swap on the first scsi
> virtual disk and "/" on a second scsi virtual disk in an LVM logical
> volume.
> This system boots and runs just fine.
>
> I first tried running from the built system by running dump against an LVM
> snapshot of the root partition.  In another virtual, bootup the F9 install
> in
> Rescue mode, restore the /boot and swap partitions to the first disk,
> create
> an LVM partition on the second disk and use pvcreate and vgcfgrestore to
> setup to system to match the original one.  Use restore (lots of selinux
> errors) and try booting ... fails as describe above.
>
> Next, I booted the F9 install cd in Rescue Mode and did the
> dump "standalone" ... the repeated as above with the same result.
>
> Next, use tar --xattrs -vpzcf to create my backup and try again .. save
> result
> but the tar restore has only a few warning ... but the system does not
> boot.
>
> Help!  I have not lost anything yet but it sure would be nice to know that
> a
> root partition can be backed up with something better that just using "dd"
> to
> create a bit-by-bit image.
>
> BTW, I am interested in an open source solution only ... I am not
> considering
> commercial products.
>
> <https://www.redhat.com/mailman/listinfo/fedora-list>



Once I successfully restored the / partition using tar.
But it was not mounted. I booted from a second disk.
If I remember well, the problem with the exclude clause in tar
is that it suppresses any path containing the string. For instance,
if one excludes tmp, /var/tmp will not be backed up also,
not only /tmp.

After restoring, I just created by hand the directories I excluded (proc and
mnt)
Again, without the partition being mounted.


tar cvpzf /home/temp/backup.tgz \
    --exclude=proc \
    --exclude=lost+found \
    --exclude=mnt \
    ./*



-- 
Paulo Roma Cavalcanti
LCG - UFRJ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.fedoraproject.org/pipermail/users/attachments/20080601/69f3f6ad/attachment-0001.html 


More information about the users mailing list