LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices



Reply
 
Search this Thread
Old 02-11-2008, 07:21 PM   #1
deepclutch
Member
 
Registered: Nov 2004
Distribution: Debian Testing+Sid
Posts: 707
Blog Entries: 1

Rep: Reputation: 32
Smile {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 02:11 AM. Reason: added solved tag
 
Old 02-11-2008, 07:58 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,652

Rep: Reputation: 536Reputation: 536Reputation: 536Reputation: 536Reputation: 536Reputation: 536
You need to tell us what the error is.

And define "went kaput." Are you sure the data is not corrupted?
 
Old 02-12-2008, 02:29 AM   #3
deepclutch
Member
 
Registered: Nov 2004
Distribution: Debian Testing+Sid
Posts: 707
Blog Entries: 1

Original Poster
Rep: Reputation: 32
^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

what went wrong?..
 
Old 02-12-2008, 03:03 AM   #4
BittaBrotha
Member
 
Registered: Jan 2002
Location: Third Stone from the Sun
Distribution: Debian Sid, SourceMage 0.9.5, & To be Continued on a TP
Posts: 800

Rep: Reputation: 31
Have you tried reinstalling Grub to the MBR?
 
Old 02-12-2008, 03:07 AM   #5
deepclutch
Member
 
Registered: Nov 2004
Distribution: Debian Testing+Sid
Posts: 707
Blog Entries: 1

Original Poster
Rep: Reputation: 32
OK.I forgot to say that I dual boot with ubuntu gutsy which is installed natively on new harddisk. what can be the reason :S
 
Old 02-12-2008, 06:11 AM   #6
BittaBrotha
Member
 
Registered: Jan 2002
Location: Third Stone from the Sun
Distribution: Debian Sid, SourceMage 0.9.5, & To be Continued on a TP
Posts: 800

Rep: Reputation: 31
Not quite ssure, could be a corrupt partition for debian. You did change everything in Ubuntu's grub list?
 
Old 02-12-2008, 09:36 AM   #7
deepclutch
Member
 
Registered: Nov 2004
Distribution: Debian Testing+Sid
Posts: 707
Blog Entries: 1

Original Poster
Rep: Reputation: 32
^ofcorz I am getting nergasms fighting for my Debian Sid back
 
Old 02-12-2008, 12:30 PM   #8
deepclutch
Member
 
Registered: Nov 2004
Distribution: Debian Testing+Sid
Posts: 707
Blog Entries: 1

Original Poster
Rep: Reputation: 32
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) :?:

waiting for a solution...waiting...
 
Old 02-12-2008, 01:33 PM   #9
makuyl
Senior Member
 
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107

Rep: Reputation: 53
Why not post fdisk -l, grubs device.map and menu.lst if someone would spot the fault.
 
Old 02-12-2008, 04:46 PM   #10
lycan
Member
 
Registered: Jul 2007
Location: Kolkata, INDIA
Distribution: Debian Lenny
Posts: 51

Rep: Reputation: 15
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?
 
Old 02-12-2008, 06:55 PM   #11
mrrangerman
Member
 
Registered: Oct 2007
Location: MI
Distribution: Debian Slackware
Posts: 528

Rep: Reputation: 50
Quote:
deepclutch

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.
 
Old 02-12-2008, 07:15 PM   #12
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,593

Rep: Reputation: 188Reputation: 188
Quote:
Originally Posted by deepclutch View Post
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

Remove the old drive and boot the new drive.

-------------------
Steve Stites
 
Old 02-12-2008, 10:07 PM   #13
deepclutch
Member
 
Registered: Nov 2004
Distribution: Debian Testing+Sid
Posts: 707
Blog Entries: 1

Original Poster
Rep: Reputation: 32
^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 10:09 PM.
 
Old 02-14-2008, 02:23 AM   #14
deepclutch
Member
 
Registered: Nov 2004
Distribution: Debian Testing+Sid
Posts: 707
Blog Entries: 1

Original Poster
Rep: Reputation: 32
Smile solved most:

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.
 
Old 02-14-2008, 02:40 AM   #15
deepclutch
Member
 
Registered: Nov 2004
Distribution: Debian Testing+Sid
Posts: 707
Blog Entries: 1

Original Poster
Rep: Reputation: 32
EDIT:
Currently doing a
Code:
 dpkg-reconfigure --all
in a root terminal and yes,debconf for my Debian is "medium" settings.
 
  


Reply

Tags
chroot, debiansid, grub, login, pam, su, suid


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing ATA/IDE HDD on SATA HDD System Drahcir Linux - Hardware 10 05-31-2006 03:32 AM
[RAID1, GRUB] Secondary HDD can't boot up when primary HDD fails Akhran Linux - Newbie 2 05-04-2006 05:17 AM
Knoppix 4.0.2 HDD fails to boot fogcat Debian 1 02-01-2006 12:42 PM
how to do a dual boot (Windows on portable HDD) linux on computer HDD izquierdista Linux - General 5 01-28-2006 10:50 AM
Dual boot XP(internal IDE HDD) Debian(external USB-IDE HDD) using boot.ini PolarDog Linux - Laptop and Netbook 2 07-01-2005 10:50 PM


All times are GMT -5. The time now is 10:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration