Compiling an Ubuntu Kernel?

ddrueding

Fixture
Joined
Feb 4, 2002
Messages
19,728
Location
Horsens, Denmark
Quoting from another thread:

Umm, Linux has supported GPT and Dynamic Disks for a while now? (GPT was added in when the Linux Kernel started to support Itanium based systems, and Dynamic Disks has been in for at least 3-4 years).

You may just need to recompile your kernel to support those options. (It's under the filesystems area in the kernel configuration, look for GPT under Partition types, and the Dynamic Disks support is called LDM, and NTFS support is funny enough called NTFS).

If however you want to install Linux onto the same array, then you may have problems due to GRUB/lilo not handling GPT correctly. (But if it's just a data array and you're install Linux onto a different array, then no problems).

So, I just took my first stab and managed a kernel panic! Yay! Good to know I haven't lost my touch.

What I have learned is that I don't know nearly enough about this subject, but Googling hasn't returned much. Where would I look to see if these features are already in the default kernel? Where would I find the bits (modules?) I need to make it so?

Thanks in advance.
 

ddrueding

Fixture
Joined
Feb 4, 2002
Messages
19,728
Location
Horsens, Denmark
I think I found a start:

063 Compiling LDM Support
064 ---------------------
065
066 To enable LDM, choose the following two options:
067
068 "Advanced partition selection" CONFIG_PARTITION_ADVANCED
069 "Windows Logical Disk Manager (Dynamic Disk) support" CONFIG_LDM_PARTITION
070
071 If you believe the driver isn't working as it should, you can enable the extra
072 debugging code. This will produce a LOT of output. The option is:
073
074 "Windows LDM extra logging" CONFIG_LDM_DEBUG
075
076 N.B. The partition code cannot be compiled as a module.
077
078 As with all the partition code, if the driver doesn't see signs of its type of
079 partition, it will pass control to another driver, so there is no harm in
080 enabling it.
081
082 If you have Dynamic Disks but don't enable the driver, then all you will see
083 is a dummy MSDOS partition filling the whole disk. You won't be able to mount
084 any of the volumes on the disk.

That describes what I'm seeing now and what I need to enable. I still don't know how to go about doing it, so that is next.
 

ddrueding

Fixture
Joined
Feb 4, 2002
Messages
19,728
Location
Horsens, Denmark
I've verified that the Ubuntu 8.04 x64 kernel has GPT support, but not LDM. Is there a GUI for choosing options in a kernel compilation? There are at least a hundred options in the command line, and no way I know of to go back to one you just missed.
 

Gilbo

Storage is cool
Joined
Aug 19, 2004
Messages
742
Location
Ottawa, ON
I'll give that one a shot next time I get a chance, thanks!

This may not work on a Ubuntu distribution. You need to install the sources first for this, and it's possible that the configuration in there might be different the kernel configuration of the default binary kernel installed originally.

Code:
cat /proc/config > /new/kernel/config_file
The above will readout the configuration of the kernel currently in memory. It won't do anything if the kernel is not configured to support this, but it should be enabled in all modern distros. You can then grep the resulting file for the options you need or use menuconfig on it.

When you compile a new kernel you should use the results of the above as the starting point. Otherwise terrible things could happen ;).

Incidentally, a good policy is to keep multiple copies of the source for each version of the kernel you're playing with, eg:
Code:
/usr/src/linux-2.6.26-ubuntu
/usr/src/linux-2.6.26-mybutcheredconfig
Then create a soft symlink from /usr/src/linux to the current default you want to use so you don't confuse yourself.

Lastly, ddrueding, the Gentoo Wiki has tons of information on compiling kernels and fiddling with them, since Gentoo users have to do this all the time...
 

ddrueding

Fixture
Joined
Feb 4, 2002
Messages
19,728
Location
Horsens, Denmark
make xconfig (once I had QT3 installed) seems to be the GUI I was after.

Let's see if I can compile a bootable kernel this time...
 

ddrueding

Fixture
Joined
Feb 4, 2002
Messages
19,728
Location
Horsens, Denmark
Well, that didn't work. I must have failed to include some bits for my hardware:

Code:
Kernel Panic - not synching: VFS: Unable to mount root fs on unknown-block(0,0)

The OSes are on a RAID-0 array on a 3Ware RAID controller. Is there some way to say "make the kernel exactly the same as the current one, except add LDM"?
 

ddrueding

Fixture
Joined
Feb 4, 2002
Messages
19,728
Location
Horsens, Denmark
Still no love, though the error was now preceded by a number:

Code:
[22.513299] Kernel Panic - not synching: VFS: Unable to mount root fs on unknown-block(0,0)
Back to the drawing board ;)
 

ddrueding

Fixture
Joined
Feb 4, 2002
Messages
19,728
Location
Horsens, Denmark
I'm still chewing on this and starting to make a mess. What is the best way to go about getting rid of all these kernels that aren't working?

I can go into /usr/src and delete the files there, but there are still a mess in /boot

Can I just delete those as root? Is there anything else I should clean up?
 

ddrueding

Fixture
Joined
Feb 4, 2002
Messages
19,728
Location
Horsens, Denmark
I'm fairly confused at the moment.

The OS is currently running on 2.6.24-19-generic. I took the source for 2.6.24 and compiled it using the exact config file from the working installation, and copied the entry from menu.lst only changing the name. And it still refuses to boot (same error as above). What other things should I be looking at? The array is on a 3Ware Escalade 9650SE-16ML Raid Controller, is there specific support that won't come over with the config?

Help please?
 
Top