Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Kernel compilation questions
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Gonesolo
n00b
n00b


Joined: 23 Jun 2008
Posts: 8
Location: somewhere wet and cold

PostPosted: Sun Jun 29, 2008 1:07 pm    Post subject: Kernel compilation questions Reply with quote

Hi all,

I'm not a linux newbie (been using various forms at work and home for about 2 years now) but I am new to Gentoo and to compiling kernels, etc.

Any who. I've installed a Gentoo base system (using live cd) and compiled my own kernel. however having problems getting it to boot up.

So i've compiled my kernl (menu config or genkernel doesn't seem to matter)
I've added lines to Grub.conf for both the kernel and added a line for initramfs also.

I'm using the root=/dev/ram0 switch on the line that boots my kernel.

problem is about half way through I get an error message that could not find "root" and to type location of root.
So I thought I'd stop using initramfs and just set root=/location of / on my hard disks

However when I do this it appears the mappings for my hard disk change.
I have 2 sata hard disks I have a windows install on the first and I'm installing Gentoo on the second.

During install my disks are detected as SDE and SDF (which makes my / partition SDF2)
however I've found if I stop using initramfs then my hard disks are then detected as SDA and SDB (making my / partition SDB2)

This causes no end of confusion as I have to edit my fstab to reflect the new mappings.

Any way I can permanent mount them at the same points whethar I use initramfs or not.
Also how do I use root=/dev/ram0 as everytime I do boot complains it can't find /dev/ram0

Any help greatly appreciated, i really like the idea of Gentoo (choice from the very start) and I don't want to go back to using a "package" distro.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 27780
Location: 56N 3W

PostPosted: Sun Jun 29, 2008 3:01 pm    Post subject: Reply with quote

Gonesolo,

Welcome to Gentoo.

Both ways of booting work but they have different requirements on how the kernel is compiled.

When you use and initrd, your kernel needs initrd support and most other things can be modules.
This is the genkernel way and the binary distro way, as it allows a generic one size fits all kernel to be made.
When you do this, the root=/dev/ram0 points to the temporary root filesystem that the initrd file provides.
You also need a real_root=/dev/sd... to point to your hard drive root.

When you do not use an initrd, the kernel must have everything needed to mount root 'built in', not modules as the modules are saved on the root partition. Now you use root=/dev/sd... on the kernel line.

Choose one method, I recommend not using genkernel because you will quickly outgrow it and you really don't need/want a generic kernel, so you will be rolling your own kernel sometime.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Gonesolo
n00b
n00b


Joined: 23 Jun 2008
Posts: 8
Location: somewhere wet and cold

PostPosted: Sun Jun 29, 2008 9:06 pm    Post subject: Reply with quote

:? Thanks for the info. I'm still a little confused about why my disk change from sde/sdf to sda/sdb though. Is there a fdisk command or some other way to see what the disks are being picked up as?
Back to top
View user's profile Send private message
cyrillic
Watchman
Watchman


Joined: 19 Feb 2003
Posts: 7301
Location: Groton, Massachusetts USA

PostPosted: Sun Jun 29, 2008 9:37 pm    Post subject: Reply with quote

Gonesolo wrote:
Is there a fdisk command or some other way to see what the disks are being picked up as?

Yes, you can list all detected harddrives like this.
Code:
# fdisk -l

If you have a 4-slot USB flash memory reader, then the LiveCD is probably detecting this as /dev/sda-sdd and bumping your "real" harddrives to /dev/sde,sdf .
Back to top
View user's profile Send private message
smitty_one_each
Tux's lil' helper
Tux's lil' helper


Joined: 21 Mar 2004
Posts: 94
Location: Right coast, halfway up

PostPosted: Mon Jun 30, 2008 12:51 am    Post subject: A bit more on How Stuff Happens Reply with quote

Gonesolo wrote:
:? Thanks for the info. I'm still a little confused about why my disk change from sde/sdf to sda/sdb though. Is there a fdisk command or some other way to see what the disks are being picked up as?


Another useful thing to do is
ls -l /sys/block

You will see all of the block devices visible to the kernel.
hd* are IDE hard drives, sd* are scsi drives (for example, a large USB external hard disk shows up as scsi)

The actual letters hda, hdc, and so on are assigned by the udev system. For example
Quote:

localhost ~ # tree /etc/udev
/etc/udev
|-- rules.d
| |-- 05-udev-early.rules
| |-- 30-kernel-compat.rules
| |-- 40-alsa.rules
| |-- 40-gentoo.rules
| |-- 40-video.rules
| |-- 50-udev-default.rules
| |-- 60-cdrom_id.rules
| |-- 60-persistent-input.rules
| |-- 60-persistent-storage-tape.rules
| |-- 60-persistent-storage.rules
| |-- 61-persistent-storage-edd.rules
| |-- 64-device-mapper.rules
| |-- 65-permissions.rules
| |-- 70-hpmud.rules
| |-- 70-libgphoto2.rules
| |-- 70-libsane.rules
| |-- 70-persistent-cd.rules
| |-- 70-persistent-net.rules
| |-- 75-cd-aliases-generator.rules
| |-- 75-persistent-net-generator.rules
| |-- 80-drivers.rules
| |-- 90-hal.rules
| |-- 90-network.rules
| |-- 95-udev-late.rules
| `-- 99-fuse.rules
`-- udev.conf


This is a database of rules that describe how devices get named at boot time or when you plug in something new.
You can also check dmesg, particularly when things no worky-worky.
_________________
I'm just looking for clues at the scene of the crime.--Walsh
Back to top
View user's profile Send private message
Gonesolo
n00b
n00b


Joined: 23 Jun 2008
Posts: 8
Location: somewhere wet and cold

PostPosted: Wed Jul 02, 2008 10:44 am    Post subject: Reply with quote

ok this is starting to get to me.

So I decided to try again. d/l the amd64 minimal cd last night and started a new install.
All went well (couple of issues with the kernel and splash boot but got it sorted.)

Problem I have now though I just can't get past.

during the install I setup my disks as they were found by the installer.

sde1 - ntfs partition - windows install
sdf1 - boot parition
sdf2 - swap
sdf3 - / partition.

So I set up fstab as above. and my kernel line reads something like the following

.... /boot/kernel-genkernel-2.6.24-gentoo-r8 root=/dev/sdf3

However when I boot I get an error - unable to find device /dev/sdf3 block device (0,0) and then it kernel panics.

Odd thing is this seems to be about half way through the boot and the kernel has started to load so the system can obviously find /root and / so what have I done wrong?

Sorry I don't have the error verbatium but I'm on my work PC at the moment
Back to top
View user's profile Send private message
Gonesolo
n00b
n00b


Joined: 23 Jun 2008
Posts: 8
Location: somewhere wet and cold

PostPosted: Wed Jul 02, 2008 2:16 pm    Post subject: Reply with quote

OK my bad.

:oops: :oops: :oops:

when I compiled the kernel I put SATA support in as a module. (silly me)

anyway all sorted now.

thanks for all your help and advice.
Back to top
View user's profile Send private message
kimmie
Guru
Guru


Joined: 08 Sep 2004
Posts: 455
Location: Australia

PostPosted: Wed Jul 02, 2008 4:47 pm    Post subject: Reply with quote

There's another way to handle changing device letters, it's called "disk labels". The idea is that you assign a label to a filesystem, and then refer to it by the label rather than device name.

An excerpt of my /etc/fstab using labels reads:

Code:
# <fs>              <mountpoint>    <type>  <opts>                                          <dump/pass>
LABEL=root          /               xfs     noatime,nodiratime                              1 1
LABEL=boot          /boot           xfs     ro                                              1 2
LABEL=home          /home           xfs     nodev,relatime,nodiratime                       1 2


The mount command also supports using labels, just use mount LABEL=<label> /mntpoint instead of mount

Most filesystems support labels I know for a fact that ext2/3, xfs and swap does, and I'm pretty sure other popular filesystems do. The mke2fs, mkfs.xfs and mkswap commands all have a -L <label> option you can use at create time. To assign a label to an existing filesystem, you can use e2label or xfs_admin.

The blkid command will show you the labels of all block devices in your system, mounted or not:

Code:
/dev/hda2: LABEL="boot" UUID="a4ef90f1-6e03-4b26-a43d-f7c29cea0094" TYPE="xfs"
/dev/hda6: LABEL="root" UUID="775afc15-08ef-47ad-8914-b7f97601b855" TYPE="xfs"
/dev/hda7: LABEL="portage" UUID="8e28f142-867b-44ed-a4bd-d4c5c64eddef" TYPE="xfs"
/dev/md0: LABEL="var/tmp" UUID="fa214479-478d-4709-b534-44dc16392130" TYPE="xfs"
/dev/hda5: TYPE="swap" LABEL="swap0" UUID="04500cae-cc0e-40c7-af42-3f437613c8c8"
/dev/hdc5: TYPE="swap" LABEL="swap1" UUID="e44b4b57-ce5d-4ed5-ae6c-6533ac4cf30c"
/dev/md1: LABEL="vm" UUID="e482f359-9494-4252-8de8-f8b62ee49bdb" TYPE="xfs"
/dev/hdd1: LABEL="backup" UUID="4ed0ba78-a96a-4473-8149-e8dab9af7d06" TYPE="xfs"


I find using labels really handy... it means you can easily swap disks between interfaces/controllers, and it makes partitions sort of "self documenting"....
Back to top
View user's profile Send private message
smitty_one_each
Tux's lil' helper
Tux's lil' helper


Joined: 21 Mar 2004
Posts: 94
Location: Right coast, halfway up

PostPosted: Thu Jul 03, 2008 1:53 am    Post subject: Reply with quote

Gonesolo wrote:
OK my bad.

:oops: :oops: :oops:

when I compiled the kernel I put SATA support in as a module. (silly me)

anyway all sorted now.

thanks for all your help and advice.


It happens.
My challenge was that I had /dev/hda for a while <2.6.20, then it became /dev/sda for a while in the early 2.6.20's, and now it's back to /dev/hda.
The kernel, she's a fickle filly at times.
_________________
I'm just looking for clues at the scene of the crime.--Walsh
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo 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