How can I get my HDD from my dead computer installed on a different computer

Asked by tom brock

i have been using Ubuntu on a P4 compaq presario tower for about 2 years. The mother board on the Presario finally gave out after 7 years of continious use.

I would like to install the HDD containing all of my setup and configuration in a Dell Optiplex gx260.

When I attempt to boot on the Dell I get a GRUB error 2.

I have attempted a clean install on the original Dell HDD and I am able to read all ofthe data on the HDD from the Compaq.

Is there a way to get the Dell to boot from the HDD that was originaly in the Compaq?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu grub2 Edit question
Assignee:
No assignee Edit question
Solved by:
delance
Solved:
Last query:
Last reply:
Revision history for this message
tom brock (tbstage68) said :
#1

In an attempt to be a bit more clear...

The HDD that I want to continue to use is from the Compaq Pressario has a working version of Ubuntu 10.04 and it is 300GB
I will call it HDD 00

The HDD from the Dell Optiplex gx260 has a clean install of Ubuntu 10.04 and is 20GB.
I will call it HDD 01

The GRUB error states that there isno disk present, but only when HDD 00 is connected as the primary drive.

When both drives are present Ubuntu boots from HDD 01 with no issues and I can successfully access the data on HDD 00

Revision history for this message
tom brock (tbstage68) said :
#2

All system cards from the Compaq have been installed on the Dell
they include:
ATI Radeon 3636 AGP
Creative soundblaster Xfi: extreme music ( this was really hard to configure properly)

All devices are in the same family otherwise.

Revision history for this message
tom brock (tbstage68) said :
#3

I can provide any additional information required.

please let me know what need to help me get this issue resolved.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#4

If you have both connected, you can boot to live cd, chroot to the installed system and reinstall grub, it should thn make things ok. You may just simply have to edit the bios to boot the other driv. Make sure both are detected in bios before continuing.

Revision history for this message
tom brock (tbstage68) said :
#5

Thank you actionparsnip. I appriciate the advice. While the concept seems simple enough, my experience with 'chroot' is exactly none. I have read up on it, but I am not totally comfortable with executing it without some guidance. My technical skill is exceptional with windows, but I've still got alot to learn when it comes to Linux/Ubuntu.

I have updated the BIOS on the optiplex gx260 to version A09, and all discs are recognized. I am able to read all data on drive 00 when using live CD and when booting from drive 01. I am not able to boot from drive 00 with out receiving GRUB error 2 'drive not present'

So I am assuming there is something wrong with the boot sector of drive 00. Where I become confused with 'chroot' is; how do I use it to repair the boot sector?

Please forgive my noobness. I am actually very interested in learning how to fix this.

Thank you for any assistance.

Revision history for this message
tom brock (tbstage68) said :
#6

Ok i followed these instructions to the letter... but am still unable to boot from Dte drive I want to boot from?????

METHOD 3 - CHROOT
This method of installation uses the chroot command to gain access to the broken system's files. Once the chroot command is issued, the LiveCD treats the broken system's / as its own. Commands run in a chroot environment will affect the broken systems filesystems and not those of the LiveCD.
1.Boot to the LiveCD Desktop (Ubuntu 9.10 or later). Please note that the Live CD must be the same as the system you are fixing - either 32-bit or 64-bit (if not then the chroot will fail).
2.Open a terminal - Applications, Accessories, Terminal.
3.Determine your normal system partition - (the switch is a lowercase "L") sudo fdisk -l
◦If you aren't sure, run df -Th. Look for the correct disk size and ext3 or ext4 format.
4.Mount your normal system partition: ◦Substitute the correct partition: sda1, sdb5, etc. sudo mount /dev/sdXX /mnt # Example: sudo mount /dev/sda1 /mnt
5.Only if you have a separate boot partition:
◦sdYY is the /boot partition designation (for example sdb3) ◦sudo mount /dev/sdYY /mnt/boot
6.Mount the critical virtual filesystems: sudo mount --bind /dev /mnt/dev
sudo mount --bind /dev/pts /mnt/dev/pts
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
7.Chroot into your normal system device: sudo chroot /mnt
8.If there is no /boot/grub/grub.cfg or it's not correct, create one using update-grub
9.Reinstall GRUB 2: ◦Substitute the correct device - sda, sdb, etc. Do not specify a partition number.
grub-install /dev/sdX
10.Verify the install (use the correct device, for example sda. Do not specify a partition): sudo grub-install --recheck /dev/sdX
11.Exit chroot: CTRL-D on keyboard
12.Unmount virtual filesystems: sudo umount /mnt/dev/pts
sudo umount /mnt/dev
sudo umount /mnt/proc
sudo umount /mnt/sys
◦If you mounted a separate /boot partition: sudo umount /mnt/boot
13.Unmount the LiveCD's /usr directory: sudo umount /mnt/usr
14.Unmount last device: sudo umount /mnt
15.Reboot. sudo reboot

On reboot I get GRUB error 2

Revision history for this message
Best delance (olivier-delance) said :
#7

Can you boot on Ubuntu Live CD, and post result of command
    parted -l
where "-l" is lower case "-L".

Revision history for this message
tom brock (tbstage68) said :
#8

Thank you for your response.

I have given up on the old HDD. I backed it up to an external drive, and just copied my data to a fresh install of 10.04.

after I got my data off. I found out that there was physical damage to the boot sector of the drive itself.

So this thread can be closed.