Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] Kernel panic after adding a new HD
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
ozric
n00b
n00b


Joined: 13 Oct 2006
Posts: 36
Location: Örebro, Sweden

PostPosted: Wed Sep 02, 2015 9:18 am    Post subject: [solved] Kernel panic after adding a new HD Reply with quote

Hi!

Please forgive me if this is a dumb question. Even after several years of experimenting with Gentoo, I still lack (a lot of) basic knowledge and once again need help from the community.

After adding another SATA drive to my box, I receive a kernel panic when booting. I first needed to reconfigure my bios and set my Gentoo disk (containing grub2 and system) as the first in the hard disk boot order, since the new drive had taken its place.
So kernel panic, removed the new disk, made sure the Gentoo disk was 1st in priority and it boots correctly again.

Here's where I am guessing I should share my dmesg output - but the one in my system is the one generated after my second, successful boot.

4.0.5-gentoo with grub2.

Additional info required will be provided at the speed of light. Thank you kindly!


Last edited by ozric on Wed Sep 02, 2015 4:52 pm; edited 1 time in total
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7552
Location: Goose Creek SC

PostPosted: Wed Sep 02, 2015 11:16 am    Post subject: Reply with quote

did you run grub2-mkconfig -o /boot/grub/grub.cfg after the disk swap?
_________________
Defund the FCC.
Back to top
View user's profile Send private message
ozric
n00b
n00b


Joined: 13 Oct 2006
Posts: 36
Location: Örebro, Sweden

PostPosted: Wed Sep 02, 2015 12:46 pm    Post subject: Reply with quote

I never swapped disks. I simply added a new disk to an available SATA connector in my PC for additional data storage. The disk containing my OS and Grub boot loader is left precisely as before I added it. After installing the new disk on my computer, the bios wanted to boot from the new drive so I changed the boot order to recognize the disk containing the OS first (the way it was before installing the new drive).

When doing so, the boot process is halted with a kernel panic message.

I then removed the new drive, once again made sure my Gentoo system disk was 1st in order to boot in the bios, and then it works.

So I need to figure out why I am getting a kernel panic when the new disk is installed.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7552
Location: Goose Creek SC

PostPosted: Wed Sep 02, 2015 1:16 pm    Post subject: Reply with quote

did you run grub2-mkconfig -o /boot/grub/grub.cfg after the disk addition?
_________________
Defund the FCC.
Back to top
View user's profile Send private message
ozric
n00b
n00b


Joined: 13 Oct 2006
Posts: 36
Location: Örebro, Sweden

PostPosted: Wed Sep 02, 2015 1:39 pm    Post subject: Reply with quote

Thanks for the answer, I should have mentioned that more clearly, but after the disk installation I cannot boot the system at all (kernel hangs already early in the boot process), so I can't run grub2-mkconfig or anything else for that matter :)
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 3076
Location: Illinois, USA

PostPosted: Wed Sep 02, 2015 1:47 pm    Post subject: Reply with quote

As a guess, your first drive is not attached to the first controller and your second drive was attached to a lower numeric controller causing it to be /dev/sda when both drives were in the system. Now for the system I'm currently on:
Code:
X3 tony # ls -l /sys/block/sda
lrwxrwxrwx 1 root root 0 Sep  1 17:00 /sys/block/sda -> ../devices/pci0000:00/0000:00:11.0/ata1/host0/target0:0:0/0:0:0:0/block/sda
X3 tony # ls -l /sys/block/sdb
lrwxrwxrwx 1 root root 0 Sep  1 17:00 /sys/block/sdb -> ../devices/pci0000:00/0000:00:11.0/ata3/host2/target2:0:0/2:0:0:0/block/sdb
X3 tony # ls -l /sys/block/sdc
lrwxrwxrwx 1 root root 0 Sep  2 08:24 /sys/block/sdc -> ../devices/pci0000:00/0000:00:13.2/usb2/2-2/2-2:1.0/host8/target8:0:0/8:0:0:0/block/sdc
X3 tony # ls -l /sys/block/sdd
ls: cannot access /sys/block/sdd: No such file or directory


My sda is attached to the first controller (of six) but my second drive is attached to the third controller. If i were to add another drive and plugged it into the slot for controller 2, it would become sdb and the current sdb would become sdc. Since the ATA controller is scanned first, the USB drive would move up no matter which port the SATA drive was plugged into.

Motherboard manuals can be really confusing as to which port is which.

On my portage server:
Quote:

gentoo ~ # ls -l /sys/block/sd*
lrwxrwxrwx 1 root root 0 Sep 2 08:35 /sys/block/sda -> ../devices/pci0000:00/0000:00:08.0/ata1/host0/target0:0:0/0:0:0:0/block/sda
lrwxrwxrwx 1 root root 0 Sep 2 08:35 /sys/block/sdb -> ../devices/pci0000:00/0000:00:08.0/ata2/host1/target1:0:0/1:0:0:0/block/sdb


On my oldest system that is IDE with no SATA
Quote:
biostar ~ # ls -l /sys/block/sd*
ls: cannot access /sys/block/sd*: No such file or directory
biostar ~ # ls -l /sys/block/hd*
lrwxrwxrwx 1 root root 0 Sep 2 08:37 /sys/block/hda -> ../devices/pci0000:00/0000:00:0d.0/ide0/0.0/block/hda
lrwxrwxrwx 1 root root 0 Sep 2 08:37 /sys/block/hdd -> ../devices/pci0000:00/0000:00:0d.0/ide1/1.1/block/hdd
biostar ~ #


If you would, please post your results for "ls -l /sys/block/sd*"
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7552
Location: Goose Creek SC

PostPosted: Wed Sep 02, 2015 1:59 pm    Post subject: Reply with quote

what tony said.
might be well to make disk attachments sane.
your motherboard and its manual should identify sata controllers and connections, suggest put the gentoo drive on sata1 and the new drive on sata 3.
boot install cd/usb, mount the gentoo partitions, enter chroot to do work with new disk installed
grub2-mkconfig -o /boot/grub/grub.cfg
reboot to gentoo
_________________
Defund the FCC.
Back to top
View user's profile Send private message
ozric
n00b
n00b


Joined: 13 Oct 2006
Posts: 36
Location: Örebro, Sweden

PostPosted: Wed Sep 02, 2015 2:10 pm    Post subject: Reply with quote

Thanks kindly for your replies. This is the output from /sys/block/sd* and my system disk resides on sda. This is without the new disk installed.
Code:

ls -l /sys/block/sd*
lrwxrwxrwx 1 root root 0 Sep  2 14:32 /sys/block/sda -> ../devices/pci0000:00/0000:00:11.0/ata4/host3/target3:0:0/3:0:0:0/block/sda
lrwxrwxrwx 1 root root 0 Sep  2 14:32 /sys/block/sdb -> ../devices/pci0000:00/0000:00:11.0/ata5/host4/target4:0:0/4:0:0:0/block/sdb
lrwxrwxrwx 1 root root 0 Sep  2 14:32 /sys/block/sdc -> ../devices/pci0000:00/0000:00:11.0/ata6/host5/target5:0:0/5:0:0:0/block/sdc
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7552
Location: Goose Creek SC

PostPosted: Wed Sep 02, 2015 2:30 pm    Post subject: Reply with quote

Quote:
This is without the new disk installed.
No surprise.
add the new disk boot install media run /sys/block/sd* or parted -l or fdisk -l
at boot the kernel probes for hard drives, the first one found is enumerated as sda
_________________
Defund the FCC.
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 3076
Location: Illinois, USA

PostPosted: Wed Sep 02, 2015 3:10 pm    Post subject: Reply with quote

ozric wrote:
Thanks kindly for your replies. This is the output from /sys/block/sd* and my system disk resides on sda. This is without the new disk installed.
Code:

ls -l /sys/block/sd*
lrwxrwxrwx 1 root root 0 Sep  2 14:32 /sys/block/sda -> ../devices/pci0000:00/0000:00:11.0/ata4/host3/target3:0:0/3:0:0:0/block/sda
lrwxrwxrwx 1 root root 0 Sep  2 14:32 /sys/block/sdb -> ../devices/pci0000:00/0000:00:11.0/ata5/host4/target4:0:0/4:0:0:0/block/sdb
lrwxrwxrwx 1 root root 0 Sep  2 14:32 /sys/block/sdc -> ../devices/pci0000:00/0000:00:11.0/ata6/host5/target5:0:0/5:0:0:0/block/sdc


You have them on the last three controllers instead of the first three. Seems simplest to move the SATA connecters. Unplug them, then plug the boot drive until it shoes up ata1. Then do the same with the other two. A lot of booting & shutting down, but safer than messing with the installation.

lrwxrwxrwx 1 root root 0 Sep 2 14:32 /sys/block/sda -> ../devices/pci0000:00/0000:00:11.0/ata4/host3/target3:0:0/3:0:0:0/block/sda
lrwxrwxrwx 1 root root 0 Sep 2 14:32 /sys/block/sdb -> ../devices/pci0000:00/0000:00:11.0/ata5/host4/target4:0:0/4:0:0:0/block/sdb
lrwxrwxrwx 1 root root 0 Sep 2 14:32 /sys/block/sdc -> ../devices/pci0000:00/0000:00:11.0/ata6/[/b]host5/target5:0:0/5:0:0:0/block/sdc
Back to top
View user's profile Send private message
Buffoon
Veteran
Veteran


Joined: 17 Jun 2015
Posts: 1074
Location: EU or US

PostPosted: Wed Sep 02, 2015 3:14 pm    Post subject: Reply with quote

Looking at the motherboard and the manual will reveal how ports are numbered.
Back to top
View user's profile Send private message
ozric
n00b
n00b


Joined: 13 Oct 2006
Posts: 36
Location: Örebro, Sweden

PostPosted: Wed Sep 02, 2015 4:52 pm    Post subject: Reply with quote

Thanks again for your replies. Correct that the disks were connected to the mobo in the wrong order (they were even neatly numbered).

My mistake was assuming the bios would pass the appropriate information to the kernel (ie. moving my system drive to the first position would solve the problem) - but the system is actually depending on the physical SATA ports (makes sense).
Solved by re-connecting the drives to the SATA ports on the mobo in the right order (system drive at port 0).

Thanks for your help!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum