copied Debian install from dead hdd to new hdd.now system fails to boot :S
DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
{SOLVED}copied Debian install from dead hdd to new hdd.now system fails to boot :S
my old sata hdd went kaput.I had my Debian Sid running on that hdd.
I mirror copied whole Debian Sid to a new partition(ext3) in the new hdd.I edited /etc/fstab to correct the device paths.I chrooted and did a dpkg-reconfigure linux-image-`uname -r`.
Still,Debian fails to boot.grub shows some error code saying fails to read data etc.
Please Help !
Last edited by deepclutch; 02-14-2008 at 01:11 AM.
Reason: added solved tag
^no the (old) drive haven't completely failed.it got stuck sometimes.thats all.
the error,I get is grub error:17 cannot be read etc.
while I browsed in grub to point to the correct /boot/vmlinuz&initrd paths and root device is also set correctly.apparently I cant find any reason :-|
I am cent percent sure,I copied whole Debian Sid to this new ext3 partition :S
when I try from grub to manually search for Debian vmlinuz and initrd,I am getting Ubuntu's /boot only :S
For eg:
edited the grub entry by pressing "C" and did:
root (hd0,9)
kernel /boot//
^here it shows Ubuntu's /boot what went wrong?while ubuntu is in (hd0,10).I have checked Debian's /boot to make sure it contains my compiled 2.6.24 kernel.it is all intact there.
wth?
One thing more,debian was installed on my (hd1) hdd while now it is copied into (hd0) :?:
Can you post the output of fdisk -l and also menu.lst of the grub you want to install and the debian and ubuntu partitions in /dev/hdx or /dev/sdx format?
my old sata hdd went kaput.I had my Debian Sid running on that hdd.
I mirror copied whole Debian Sid to a new partition(ext3) in the new hdd.I edited /etc/fstab to correct the device paths
Ok is the drive a sata or ide? If it's a sata it would show as sdx not hdx as you have listed here. So what drive is the mirror on now sata or ide?
Run fdisk -l to see how it's listed, also take a look at this help file it should give you all the info you need to get this up and running.
my old sata hdd went kaput.I had my Debian Sid running on that hdd.
I mirror copied whole Debian Sid to a new partition(ext3) in the new hdd.I edited /etc/fstab to correct the device paths.I chrooted and did a dpkg-reconfigure linux-image-`uname -r`.
Still,Debian fails to boot.grub shows some error code saying fails to read data etc.
Please Help !
If you have the old drive available and you can still copy data from it then I suggest that you start all over again. This time forget that you ever heard of the dd command. Either from the old drive or a live CD:
partition the new drive using fdisk
format the partitions on the new drive using mkfs and mkswap
copy your old partitions to the new drive using the cp command
change /etc/fstab
change /boot/grub/menu.lst
chroot to the new Debian and run grub-install
^I first copied using dd and removed. later did a cp /mnt/*.* to the ext3 partition I made in /dev/sda10(current hdd)
I did below things earlier itself:
1.edited /etc/fstab
2.removed(purged) grub,linux-image-`uname -r` and reinstalled via chroot from my ubuntu hdd install
3.did a fsck.ext3 -fvy /dev/sda10 on the partition when NOT mounted.
4.changed /boot/grub/device.map to contain only (hd0) via chroot.
Now,Is there any way to let Debian know(already reconfigured,reinstalled kernel) that it is now on /dev/sda10 instead of /dev/sdb10(old hdd) :S
and yes,both hdds are sata.
One more thing is the old hdd was detected as (hd1) and /dev/sdb .
debian was installed on it.
now,it is on /dev/sda10.
Code:
root@myworld:~# fdisk -lu
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x0d620d62
Device Boot Start End Blocks Id System
/dev/sda1 * 63 312576704 156288321 5 Extended
/dev/sda5 126 63488879 31744377 83 Linux
/dev/sda6 63488943 126977759 31744408+ 83 Linux
/dev/sda7 126977823 190466639 31744408+ 83 Linux
/dev/sda8 190466703 233263799 21398548+ 83 Linux
/dev/sda9 233263863 234034919 385528+ 82 Linux swap / Solaris
/dev/sda10 234034983 277153379 21559198+ 83 Linux
/dev/sda11 277153443 290182094 6514326 83 Linux
/dev/sda12 290182158 312576704 11197273+ 83 Linux
well,I am into full linuxing
and BTW,my old sata is already given for RMA; it was a seagate one. thanks guys pour more ideas
Last edited by deepclutch; 02-12-2008 at 09:09 PM.
OK.Finally solved the mess but cant say 100%.you can help other things.
Posting from My Debian Sid
I mounted Debian in Ubuntu as root(sudo su -) :
Code:
mount /dev/sda10 /mnt
then,
Code:
mount -t proc proc /mnt/proc
Code:
mount --bind /dev /mnt/dev
Code:
chroot /mnt /bin/bash
then,
I reinstalled grub as:
Code:
grub>root (hd0,9)
setup (hd0)
then,
Code:
grub-install /dev/sda
that's it.
when rebooted,grub menu is shown.I can boot into Debian and login with my local username.
wait!but from here the menace starts :evil:
I CANNOT login via terminal or any virtual terminal as root!
wtf?
So,In panic,I tried resetting password via grub option to kernel(I use upstart in Debian in place of sysVinit) "rw init=/bin/bash"
changed password.
in that root terminal.I modprobed all needed modules manually(pppoe etc)
connected to my adsl pppoe connxn,"apt-get install --reinstall linux-image-`uname -r` grub dpkg bash "
also,I did a :
Code:
source /etc/profile
as mkinitrd is complaining LANG etc env variables were missing
anyways,now I am back in Debian.
Will you all folks help me what should I do to login as root in virtual terminal or terminal via su ?
Thank you All.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.