Link to home
Start Free TrialLog in
Avatar of rawandnet
rawandnet

asked on

backup and restore entire Filesystem?

What is the best tool to backup all Linux filesystem which can be restored if Linux system crashes and not doesn't start.

I used dump to copy and restore the entire filesystem. But after restoring I can't even login to fedora anymore. The command i used to restore was:

restore rf /dev/sda4

while restoring I get message, can not overwrite file exits.

I dump is the write tool to restore the entire system encase of disaster recovery?

thanks
ASKER CERTIFIED SOLUTION
Avatar of arnold
arnold
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rawandnet
rawandnet

ASKER

I disabled selinux.

backup command i used:
dump 0uf /dev/sda4 /dev/sda1

I have restored the system from the CD,

but after restart it doesn't show any thin. could you tell me the command and steps you used?
When booted from the CD, did you wipe the partition /dev/sda1 clean first?
mke2fs?
the directive for -r requires that the filesystem to which the restore is to be done must be pristine.
http://linux.die.net/man/8/restore
 
I didn't wipe the partition, i just wanted to overwrite.
then format first

mkfs -t ext3 /dev/sda1

then

restore -rf /dev/sda4

is it correct?
Yes.
mkfs -t ext3 /dev/sda1
mount /dev/sda1 /mnt
cd /mnt
restore -rf /dev/sda4

The above is included in the link detailing the man page for restore
Hopefully you did not backup any other partitions to /dev/sda4 with dump -0uf /dev/sda4 /dev/sdax
I have tried the following:

mount /dev/sda1 /mnt
cd /mnt

in mnt directory, i can't even use ls command, or restore command, it say command not available?


I have solve that by creating a new folder and mount /dev/sda onto that folder rather than mounting to mnt. this will work.

the problem now i have is. after restoring and restarting the system I get the following error:

"error mounting dev root on sysroot as ext3 no such file or directory"

any idea?
The command you run has nothing to do with where you are.  The issue might be that the command is not in the path.
Presumably you booted with a Live CD.
before changing anything, can you run ls, restore --help, etc.?

restore is likely in /usr/bin/restore.
/bin/ls

See if the following link is helpful:
http://forums.fedoraforum.org/showthread.php?t=206071
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
the Filesystem is under /dev/sda1, I backuped the system under /dev/sda4 using following command:

dump 0uf /dev/sda4 /dev/sda1.

create folder under mnt (mysystem) and mount
mount mount /dev/sda1 /mnt/mysystem

I have tried to restore the system while login to Fedora and through CD rescue mode.  
restore -rf /dev/sda4

but still I get the following error after restoring and restarting the system"mounting dev root on sysroot as ext3 no such file or directory"

/mnt is the folder for mount overlay.

after the restore, if you navgate to /mnt/mysystem/etc/fstab what do you have there?
Prior to running dump, what does /dev/sda4 have?  Is it a mounted partition? or is it a raw partition that you use for the purposes of backup?
I will do the steps again and come backup to you.  thanks
hi arnold,

access Rescue mode from CD, and skipped mounting, to prevend the device from mounting:
dump 0uf /dev/destination /dev/source
format: mke2fs /dev/destiantion drive
mount /dev/destination /mnt/mysystem
restore rf /dev/destination

later I browsed to etc, there was only 38 file and folders. and there wasn't fstab file.  many file hasn't been backup, what is the reason?

Thanks

did you cd into /mnt/mysystem before restoring?

did you look in /mnt/mysystem/etc???

only asking...
It's either a typo or you formatted the partition where you stored your backup:
/dev/destination is the location to which you backed up /dev/source.

I think the default will make it ext2.  converting to ext3 is not a big deal.
You should run mke2fs -T ext3 /dev/source prior to mounting/restoring from /dev/destination.


answer for jool:
I did CD to the directory and looked at the restored directory.

answer for arnold.
I formatted the filesystem (sda1) partition were Linux was installed. then restored the backed up file from /dev/sda4 to sda1.

you suggesting to format filesystem partition sda1 using (mke2fs -T ext3 /dev/sda1) then mounting and restore to from sda4 to sda1. I will do that tomorrow morning and come back with result.

thanks
This time after restore, computer pass BIOS and just stops, doesnt even get to grub.conf file.

Just to remind you that I installed the entire filesystem on one partition sda1.

Steps:

Create folder under /mnt/mysystem
    mount /dev/sda1 /mnt/mysystem
    cd /mnt/mysystem
    restore rf /dev/sda3             "backup location"


White restoring it show following error:

Resync restotre, skipped 1 blocks
Error in EA block1
Magic = 0

This keept showing 9 times.

This time more file was restored and fstab setting is as follow:
UUID = (long number)       ext3 default
Ts      1 1
Tmpfs      /dev/shm      tmpfs      defaults       00
Devpts      /dev/pts      devpts      gid=5,mode=620        00
Sysfs      /sys      sysfs      defaults      00
Proc      /proc      proc      defaults      00
UUID= (long number) swap
Ts       00

if you have quesions ask me please.
thanks
run fsck.ext3 on the /dev/sda1 partition do not mount the partition.

fsck.ext3 /dev/sda1

Which linux are you using?
Usually, /boot is one partition and then /.
I am using Fedora. I too think it might be something to do with boot partition.  I installed the entire filesystem into / (sda1), but do you think that boot will be installed on another one? how can I backup and restore boot, and on which partition?

Thanks
You can create a small 100-200MB /dev/sda1
in fstab you would use /dev/sda1 as the /boot mount point.
You can then use the -x  to extract just the /boot data.

But before trying that see whether you have a restoresymtable file in the /mnt/myssytem directory after the restore is complete.  Delete this file and see whether you have the same error.

If you go with the reconstruction of the file system i.e. /boot /.
Your fstab references the device based on UUID.
Is the number in the fstab matches the UUID of the SDA1 partition?
 
Hi guys,

thanks for your help especially arnold.  the problem was boot loader file.  because MBR is instal on sda drive, it have to either backup the entire drive using dd command. or backup up a partition and backup boot loader separately.  I think dd is the best tool for that purpose.


thank you again
Hi guys,

thanks for your help especially arnold.  the problem was boot loader file.  because MBR is instal on sda drive, it have to either backup the entire drive using dd command. or backup up a partition and backup boot loader separately.  I think dd is the best tool for that purpose.


thank you again