?
Solved

Backup/restore linux

Posted on 2009-02-12
22
Medium Priority
?
499 Views
Last Modified: 2013-12-01
Hi, which free backup and restore software can i use to backup my linux system and restore it to another pc.
0
Comment
Question by:zeraxis_ee
  • 12
  • 10
22 Comments
 
LVL 35

Expert Comment

by:torimar
ID: 23625002
Apart from using the 'dd' command to make a raw copy of your file system, people might say there is "partimage" (http://www.partimage.org/Main_Page) and "clonezilla" (http://clonezilla.org).
But Clonezilla has no own algorithm; it uses either partimage or 'dd'. So you might just as well stick with Partimage from the beginning. I recommend to use the "Parted Magic" boot CD:  http://partedmagic.com - this will give you Partimage plus GParted plus all sorts of interesting tools in a fast Live environment.

There is one thing you need to know about Partimage:
- it does *not* restore an image to a partition smaller than the source partition was, even if the used space would fit in multiple times. So make sure the partition/drive you wish to restore to is at least as big as the source partition/drive of the image.
0
 

Author Comment

by:zeraxis_ee
ID: 23631042
I tried both, but the problem is that when I am restored, the system doesn't boot properly... it is looking for a disk id ... so I can't really boot it up again
0
 
LVL 35

Expert Comment

by:torimar
ID: 23631333
Let me see if I get you right here:

- You are trying to boot the system from the new HD to which you backed up your system?
- You are receiving this error message from Grub, the boot loader?

(You can make sure it is Grub that gives you the error when either:
- you see the original boot menu, with Suse, Suse Failsafe, Floppy etc, and the error occurs after selecting some entry here
- after receiving the error you are dumped onto a Grub prompt: " GRUB >       ")

And a last question:
Are there any other Linux distros installed on the system?
0
Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

 
LVL 35

Expert Comment

by:torimar
ID: 23631387
ps:
Just rereading your initial question. So you are not backíng up and restoring from another PC - as would be the usual way to go?
You want to actually run your Linux system on a different PC, is that right?
You are aware, though, that this will only work if both PCs are nearly identically built?



0
 
LVL 35

Expert Comment

by:torimar
ID: 23631497
Yes, I must have misread your question, reading "restore *from* another PC" instead of "restore *to* another PC".
Sorry for this; but what you are trying to do here is indeed very unusual.

So we have one out of two situations here:

1. The source and target system are built with identical motherboard and hardware
In this case, we only have to teach GRUB to get along with this new different hard drive - which should be easy to do.

2. The source and target system are dissimilar in hardware
In this case the startup error by GRUB will only be the first in a probably neverending series of errors which will render the system unbootable - it simply wasn't configured to run on this kind of hardware.
What you are doing here is not a backup, but a *transfer* of your system; there are no easy ways to do that, and certainly no free ones.  "Acronis True Image Echo" with an additional "Universal Restore" (http://www.acronis.com/enterprise/products/ATICW/universal-restore.html) is the only technique I know of for performing such transfers. It is pretty expensive (700$ + 30$), and I have heard it isn't even guaranteed to work.
0
 

Author Comment

by:zeraxis_ee
ID: 23631516
U are very correct.
- you see the original boot menu, with Suse, Suse Failsafe, Floppy etc, and the error occurs after selecting some entry here
- after receiving the error you are dumped onto a Grub prompt: " GRUB >   
thats exactly what happend, and the two pcs are identical. no other linux distribution insatlled
thanks
0
 

Author Comment

by:zeraxis_ee
ID: 23631632
1. The source and target system are built with identical motherboard and hardware
In this case, we only have to teach GRUB to get along with this new different hard drive - which should be easy to do.
 how do we do this...
0
 
LVL 35

Expert Comment

by:torimar
ID: 23631727
Ok, in this case it looks like a minor issue to me.

1. Boot off your Suse Install DVD
2. Select "Rescue System"
3. When it's finished loading, type "root" on the login prompt
4. Type "grub" [ENTER] to get the GRUB prompt (Grub > )
5. Type "find /boot/grub/stage1" [ENTER]
6. You will be given something like "(hd0,0)" or "(hd0,1)" or similar
7. Use this output to type: "root (hd0,1)" - or whatever you got in step #6
8. Hit [ENTER]
9. Type "setup (hd0)" [ENTER]

A new version of Grub will now be written to the MBR of your hard drive (first harddrive, if you have more than one)

10. Type "quit" [ENTER]
11. Type "reboot" [ENTER]

It should work now - thumbs crossed.


ps:
Make sure to issue commands exactly as given above, omitting the "", of course.
If anything fishy or unexpected should occur, do not proceed, but post back here.

Good luck.
0
 

Author Comment

by:zeraxis_ee
ID: 23631915
ok thanks, will give it a try nd get back to u
0
 

Author Comment

by:zeraxis_ee
ID: 23632119
just tried it out,
got to
4. Type "grub" [ENTER] to get the GRUB prompt (Grub > )
5. Type "find /boot/grub/stage1" [ENTER]
but on typing
find /boot/grub/stage1" [ENTER]
 i get unrecognized command
what could be wrong
0
 
LVL 35

Expert Comment

by:torimar
ID: 23632385
> find /boot/grub/stage1" [ENTER]

Is the '"' in your above quote just a typo, or did you really type it? It should be omitted.

Also, between "find" and "/boot/grub/stage1", did you leave a blank space? And only one blank space, no more?

You may issue the "help" command on the Grub prompt to see which commands are supported, and you will see that the "find" command is. So the error must be some kind of mis-typing.
0
 

Author Comment

by:zeraxis_ee
ID: 23632899
i actually missed the space after find..
exceute steps 1 - 11 successfully now, nd it exceuted succesfully but the error ion rebooting is still the same.
....waiting for device  device/disk/by-id/........ cannot be found.
Is there somthing missing.
0
 
LVL 35

Expert Comment

by:torimar
ID: 23633904
Strange thing.
One should expect Grub to recalculate the HD IDs when being re-installed - and I'm sure that's what it normally does.

Anyway, from what it looks like to me, there is no reason to be nervous: your system most likely is fine, it's only the bootloader that behaves in a stubborn way. From here, there are a few possible strategies to follow; I'll need a bit of time though to sort out which one is the safest and easiest to suggest to you.

I shall post back in a couple of hours.
0
 

Author Comment

by:zeraxis_ee
ID: 23635342
thanks. will be waiting.
0
 
LVL 35

Expert Comment

by:torimar
ID: 23640222
Sorry for not posting back last night. I had been out with the boys, and when I returned home I was no longer in the mental position to deal responsibly with somebody else's boot problems. But now I'm fit again and ready to go.

Whatever strategy we choose, there will be some advanced command line editing involved.
In order for my instructions to not look more complicated than necessary, I'd like to have some preliminary information.

Reboot off your Suse DVD and start the rescue system.

1. Run the command "fdisk -l" (that's a lowercase "L"), and copy the contents of the first column ("device") here for me, adding the asterisk (*) from the next column appropriately.

2. Reenter the Grub prompt and run steps #4 to #6 from my post above once more. Tell me what output you get.

3. While still on the grub prompt, use the output received above to type the following:
cat (hd0,1)/boot/grub/menu.lst
(replace 'hd0,1' by your output)

Checking the title lines of the list you get displayed, select the entry you normally boot by default in your boot menu (usually it's the first one). Carefully copy down on paper the contents of all of the lines that pertain to this menu entry (especially the "kernel" line which should contain the disk ID that gives you the boot error).
Please make absolutely sure to copy letter by letter, sign by sign exactly as they are given. Then paste this line here.

Thank you.

0
 
LVL 35

Expert Comment

by:torimar
ID: 23640232
Last sentence should read: "Then paste those lines here"

Lines will most likely be:
- a "root" or "rootnoverify" line
- a "kernel" line
- a "initrd" line
- possibly an optional "module" line
0
 

Author Comment

by:zeraxis_ee
ID: 23661155
Hi Torimar,
was working on another time critical project,
in any case i have carried out the guide u gave nd encountered the follwoing error:
File not found, this occured on executing cat (hd0,1)/boot/grub/menu.list

1. Run the command "fdisk -l" (that's a lowercase "L"), and copy the contents of the first column ("device") here for me, adding the asterisk (*) from the next column appropriately.
gives:
disk/dev/sda: 80.0GB, 80026361856Bytes
55heads, 63 Sectors/track, 9729 Cylinders
units = Cylinder of 16065 * 512 = 8225280
disk identifier : 0xaf2eaf2e


Device  Boot Start End   Blocks            Id     System
dev/sda1         1     261  2096451        82     Linux swap/Solaris
dev/sda2   *     262  2872  20972857   83      Linux
dev/sda2       2873  9729  55078852   83     LInux


step2 was fine, it is on running step3 that the above erro came up
 
0
 
LVL 35

Expert Comment

by:torimar
ID: 23661604
There could be two reasons for the error:
1. You misspelled: it's "menu.lst", not "menu.list" as you just typed in your post above.

2. You typed it on the normal prompt, not inside the GRUB prompt.
You must type "grub [Enter]" first, then:
Grub > cat (hd0,1)/boot/grub/menu.lst

Since we shall need to know the exact litteral contents of that file, please try again.
0
 

Author Comment

by:zeraxis_ee
ID: 23661985
ok thanks
did it again now:
the lines u requested are:

title OpenSUSE 11.0-2.6.25.5-1.1
root(hd0,1)
kernel /boot/vmlinuz-2.6.25-1.1-pae root=/dev/disk/by-id/scsi-SATA_ST3808154AS_9RW178X3-part2
resume=/dev/sda1 splash=silent showopts vga=0x31a
initrd /boot/initrd-2.6.25.5-1.1-pae

thanks once more
0
 
LVL 35

Expert Comment

by:torimar
ID: 23662445
Ok, fine. Now boot back to the root prompt and make sure to start the "Grub >" again. Inside the Grub prompt, type:

root (hd0,1)

kernel /boot/vmlinuz-2.6.25.5-1.1-pae root=/dev/sda2 resume=/dev/sda1 splash=silent showopts vga=0x31a

initrd /boot/initrd-2.6.25.5-1.1-pae

boot



Hit [Enter] after each line.

!!Please note:
- there must be a blank space between "root" and "(" in line 1; you omitted this.
- line 2 does not contain any line breaks; the line break before "resume" shouldn't be there
- you got the numbering wrong in line 2; it should be "2.6.25.5-1.1"; you omitted the last "5"
- all I did was replace the "root={DISK_ID}" with "root=/dev/sda2" - all the rest must be left exactly as Linux put it
- these lines *must not* contain any mistake; if you feel uncertain, type the
cat (hd0,1)/boot/grub/menu.lst
command first: you will now have a model to copy letter by letter from. But don't forget to change the "root=" entry!

Did it boot? - I hope it did!

Log in as root user, in a terminal type:
cp /boot/grub/menu.lst /boot/grub/menu.lst.mybackup

Then open /boot/grub/menu.lst with a text editor and make the exact replacement in the "root=" entry as before on the Grub prompt; it must now read:
root=/dev/sda2
make sure to leave everything else untouched. Then the machine should boot up fine the next time you try.

Good luck.
0
 

Author Comment

by:zeraxis_ee
ID: 23679711
Thanks Torimar

was off yesterday. right, tried it out now nd enountered
error 16 inconsistent file system on executing:
initrd /boot/initrd-2.6.25.5-1.1-pae

exscuting
boot
takes me out grub and does nothing more.

It is really stubborn i will say
0
 
LVL 35

Accepted Solution

by:
torimar earned 2000 total points
ID: 23684437
Yes, it is stubborn. And the problem is that we have to deal with GRUB; Grub is not Linux, it is the programme that loads Linux. Hence it cannot rely on Linux to get information on your system: it has to query that info itself from the BIOS and the MBR. And you can never be quite sure that what Grub sees is the same as what Linux sees.
That is why so many Linux guys hate Grub.

I put the commands in a numbered list to make sure I understand exactly what is going on:

1): root (hd0,1)
2): kernel /boot/vmlinuz-2.6.25.5-1.1-pae root=/dev/sda2 resume=/dev/sda1 splash=silent showopts vga=0x31a
3): initrd /boot/initrd-2.6.25.5-1.1-pae
4): boot

The "error 16" message comes after command #2, correct? And you have checked twice that the command was typed without any error, or blank space missing, or one blank too many etc?

Please scroll up to the post where you gave the results of the "fdisk -l" command.
You said they looked like this:
Device  Boot Start End   Blocks            Id     System
dev/sda1         1     261  2096451        82     Linux swap/Solaris
dev/sda2   *     262  2872  20972857   83      Linux
dev/sda2       2873  9729  55078852   83     LInux

Are you sure there were two(!) devices called "dev/sda2"??
I took it for a typo when I saw it. But if it confirms to be true, then we have a real problem. You will have to run the 'Repair Installation' option of the SuSE DVD.
I am usually reluctant to recommend this, because it completely takes over, cannot be controlled nor aborted, but if the issue is as grave, then you must let it do what it wants to do.

If, however, the second "sda2" was a typo, then we can try to fix the filesystem manually.
Boot into the Rescue System, root prompt (not GRUB!). Type:

fsck /dev/sda2

(should there be an error telling you to specify a filesystem type:
fsck -t ext3 /dev/sda2
)

Then let it check and repair, afterwards reboot into the root prompt, get into grub, and on the grub prompt type steps #1 - #4 again.
0

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Is your phone running out of space to hold pictures?  This article will show you quick tips on how to solve this problem.
A look at what happened in the Verizon cloud breach.
This video teaches viewers how to encrypt an external drive that requires a password to read and edit the drive. All tasks are done in Disk Utility. Plug in the external drive you wish to encrypt: Make sure all previous data on the drive has been …
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question