LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Hard disk backup/copy.... (https://www.linuxquestions.org/questions/linux-general-1/hard-disk-backup-copy-183477/)

jailbait 05-23-2004 11:14 AM

"Overall though, it seems that using tar is a bit like creating a zip file in Windows.... would that be a reasonable analogy?"

Yes

"Tar allows me to take great chunks of files (and sub-directories?) and roll them into one super-file. I can then un-tar them wherever I want."

Yes, including sub-directories

"However tar cannot do the partitioning and MBR work I need. Jailbait: You mentioned this, but what did you mean by "file formatting"? Did you mean formatting the partition?"

Yes. See:
man mkfs
man fs

"When checking some of the directory contents (/boot for example) on the destination disk there were less files. Perhaps that's why the grub-install failed?"

That would cause grub-install to fail. The cause of the porblem might have been not having -pR in the cp command. See:
man cp

"Remove the original disk and carry out a fresh and minimal install from scratch on the new disk. Reconnect the old disk and boot from it, but keeping the new one connected. Tar the old file systems - hda5 and hda6 only I think (one of those is the swap.... is this needed?). Mount the file systems on the new disk. Overwrite the existing file systems with the un-tars created from the old file systems.

Would this work?"

Yes. There is a potential problem with unpacking the tarball. Optionally tar will overwrite or not overwrite existing files and you want to overwrite the minimal install. See:
man tar

However this method goes through the unnecessary work of creating a minimal install. You only need to do the partitioning and create teh file system. You can use:
fdisk -l /dev/hdb
to check to see if the existing partitioning scheme is correct. If it isn't then you can use fdisk to fix it. See:
man fdisk
You can do the file system formatting with mkfs. I already put in a plug for man mkfs.

___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites

Irf 05-24-2004 05:58 AM

Last night I only had a little while to play (exhausted by getting up at 4.30am for work!), so I had another go at jailbait's method.

I got a bit further - as far as carrying out the grub-install command (though I had to add the device name to the end).

This bit almost completed OK, but bombed out complaining about "system1/system2" problems. I was too sleepy to write down the full error message, but if needed I can have another stab tonight.

In addition, during the cp process (with the -pR) an error was encountered with trying to copy something called "console" from /sparrow/etc/sysconfig/ to /oriole/etc/sysconfig/console....... yes, that's right. The cp process seemed to be trying to make a dirctory of the source called console. In addition to which, this now console directory appeared to have two sub-directories. No idea why. In the end I manually copied across the thing called console to teh destination directory, before I hit the above obstacle.

If anyone knows why the system1/system2 problem occurred then please let me know.

I think I may be almost at the end of the road with this method, so I'll start to look at the suggestion of PGDubbin.

In addition I found this on the web: http://www.tldp.org/HOWTO/Hard-Disk-Upgrade/

Many thanks so far again...

Irf.

PGDubbin 05-24-2004 11:18 AM

Where are you running the cp command? Are you on your system or on a live CD.

When doing stuff like this, try and be entirely on the live CD this way nothing is running on your system, it removes quite a few variables that can cause random errors and stuff like this.

Irf 05-24-2004 11:23 AM

I'm running the cp command having booted into rescue mode from a cd (either Mandrake or Suse). Is that the same as using a live CD (Knoppix for example?).

Thanks,

Irf.

Irf 05-25-2004 01:48 AM

I'm most of the way through the PGDubbin solution at the moment. I had to change one or two things because possibly the instruction missed out some detail. The bit I'm stuck on now is the untar operation.

The line suggested is sudo tar -zxvpf, but this fails. After some scratching of head, I realised thet it probably needs the tarred filename. I added that and off it went, but it started extracting the system into a directory called "olddirectory" within the destination "newdirectory"!! That can't be right, can it?

Please help with this bit....!

Thanks,

Irf.

PGDubbin 05-25-2004 06:36 AM

No biggy

Let it do as it wishes, it's located in "newdirectory" which is key, because thats the new HDD, once it's done, just go into the olddirectory ON newdirectory do:

mv * ..

it'll move all the directories/files one step backwards then just erase old directory - I hope this makes sense

Irf 05-25-2004 07:00 AM

OK PGDubbin, I'll try that when I get home - it makes sense to me. I'm learning a lot doing this!

By the way, I imagine I'll need to prefix the mv with sudo?

Irf.

Irf 05-25-2004 05:53 PM

OK I've worked through all of your instructions. However I now her one instance of GRUB appearing at the startup screen, and the machine hangs.... could it be that I now need to reinstall GRUB?

Irf.

PGDubbin 05-25-2004 06:19 PM

running the live CD head over to the grub directory (typically /grub on the root system) - take a look around in the grub.conf and see if you spot anything "odd"

Worst case - copy paste grub.conf content here.

Did you chroot and everything properly before rebooting?

Irf 05-26-2004 02:31 AM

Yes I did exactly as your instructions.

Now could this problem be due to the Windows partition at the start of the disk? I did mention that this was a dual boot disk earlier didn't I? Does this mean that I need to grub-install to the hda1 file system (Windows) or the hda6 (Suse)?

Irf.

EDIT: I booted on the live CD and looked for the Grub directory. I found it here /boot/grub. The weird thing is that there is no grub.conf file there! I didn't have time to reconnect the old drive and boot from it to see if the grub.conf existed but was not copied. Will check tonight. So should I be looking at simply copying over the file, or should I carry out a grub-install?

Irf 05-26-2004 01:11 PM

I found grub.conf!!! It is in the /etc directory.

I had a look and it is a little confusing to someone who doesn't know much about it.

It goes like this:


root (hd0,5)
install --stage2=/boot/grub/stage2 /boot/grub/stage1 d (hd0) /boot/grub/stage2 0x8000 (hd0,5)/boot/grub/menu.lst
quit


Well, thats it. Can someone help me with this, or perhaps I should reinstall grub?

If it's a reinstall then should I use

grub-install /dev/hda1 (the first partition on the drive - windows)

or

grub-install /dev/hda6 (the Suse partition)

Many thaks,

Irf.

Irf 05-27-2004 05:26 PM

Hi to all, especially those who have help me. This is just a note to say that unfortunately I have not been able to get any further despite all your informed help. I think I am going to concede defeat, and carry out a full new install on the new drive.

Regards,

Irf.


All times are GMT -5. The time now is 06:23 PM.