HOWTO Troubleshoot Gentoo Install

From Gentoo Linux Wiki

Jump to: navigation, search

Contents

[edit] Problems with ALSA

[edit] Sound is muted every reboot

[edit] Part 1: Configure ALSA for save and restore

Make sure you set alsa configuration to be saved on shutdown and restore on start with either of:

rc-update add alsasound boot
rc-update add alsasound default

Generally, unless you must put it in boot, default is fine.

[edit] Part 2: Shutdown cleanly when you shutdown

When possible, to shutoff your computer use a command not the off switch:

  • poweroff
  • restart

[edit] Problems booting

Understand the boot process to make sure you made no mistakes.

The boot process:

[edit] Step 1: System reads master boot record off of disk

You must have written an MBR to the disk.

[edit] Beware of conflicts with your MBR

You must make sure nothing conflicts with the MBR: you must use a partition map.

  • If you did not use a partition map and installed a file system to the whole device, writing a MBR will corrupt your partition.
  • If you did not use a partition map and installed software RAID to the whole device, writing a MBR will corrupt your RAID.
  • Always use a partition map, it allows you to more easily identify and manage the content of devices.

[edit] Writing a master boot block

GRUB is preferred over lilo, as GRUB does not need an update program to be run when a change is made to configuration information.

You can either use grub-install or the grub shell to write your MBR. We suggest you use the grub shell as it a more raw interface which gives you more control and it is very easy to use.

Grub uses the BIOS to work with your drive and enumerates your drives and partitions starting with zero. So your first drive is (hd0). The first partition on your first drive is (hd0,0). More precisely, the first drive according to your BIOS. It is unlikely, but possible for your BIOS to play games with you and have a different enumeration at boot time. In this case, you will want to use the --device-map option when running the grub shell.

For Grub to be your first boot loader (there are alternatives), you want to have Grub write the MBR to the device, not the partition. So you will use something like (hd0), not (hd0,0).

  • Mount and enter your /boot:
mount /boot
cd /boot
  • Run the Grub shell:
grub
  • Inform Grub which partition at boot time it will be able to find your compiled kernel on:
root (hd0,0)
  • Instruct Grub to write the MBR on your boot device:
setup (hd0)
  • If you have a RAID1 system, setup your other drive(s) too.
  • Quit Grub
quit

[edit] Step 2: Grub reads its configuration info

Note: More to come

[edit] Step 3: Grub tries to load the kernel

In your grub config, the root line tells Grub on which partition your compiled kernel is.

Note: More to come

[edit] Problems with CDs

[edit] Issues reading or mounting the CD

[edit] CD doesn't support needed hardware

  • Boot with another distribution's Live CD.

[edit] Problems with clock

Unless you dual boot with windows, your clock should be set in UTC.

[edit] Part 1: Fix your clock setting

[edit] With network access

Get the time from NIST:

rdate -s time.nist.gov

After setting the clock, store the time so the time will be correct on boot:

hwclock -w

[edit] Without network access

On a machine with the correct time:

echo date -u `date -u +%m%d%H%M%Y`

This will give you a command to use to set the clock. (e.g. date -u 012103542008)

After setting the clock, store the time so the time will be correct on boot:

hwclock -w

[edit] Part 2: Fix your clock configuration

Edit /etc/conf.d/clock:

  • CLOCK should be UTC unless you dual boot Windows.
  • Set TIMEZONE as instructed.
  • Set CLOCK_SYSTOHC to yes to save the clock each time you shut down cleanly.

Make sure the clock will be recovered and stored on startup and shutdown:

rc-update add clock boot

[edit] Part 3: Fix your clock display

To fix the time shown by commands such as date and ls:

/etc/init.d/clock pause start

[edit] Part 4: Configure your clock to be regularly updated

See: NTP

[edit] Part 5: Shutdown cleanly when you shutdown

When possible, to shutoff your computer use a command not the off switch:

  • poweroff
  • restart

[edit] Part 6: Fixing times in the future

This will show you which files have modification times within the current minute and in the future:

find / -xdev -mmin '-0' -exec echo '{}' \;

To actually set the modification time to the current time, in the above command change echo to touch.

[edit] Problems with nVidia

[edit] Make sure you have selected nVidia's OpenGL implementation

To see your available and current OpenGL implementations:

eselect opengl list

Sample output:

Available OpenGL implementations:
  [1]   nvidia *
  [2]   xorg-x11

The asterisk indicates the current selection.

To set the current implementation:

eselect opengl set N

Where N is a number of the implementation you want.

[edit] Problems with Grub

[edit] Grub says file not found on boot

  • Your splashimage line may not be configured correctly.
    • Work around: It is unnecessary comment out the like beginning: splashimage=
  • If your /boot is on reiserfs, you must always mount it with -o notail

[edit] Fixing a reiserfs /boot which was mounted without notail

[edit] Part 1: Fix fstab for future boots

Edit /etc/fstab, add notail to the options for /boot.

Example:

/dev/md1  /boot    reiserfs   noauto,noatime,user_xattr,notail  1 1

[edit] Part 2: Remount /boot correctly

To remount /boot with notail:

mount -o remount,notail /boot

[edit] Part 3: Rewrite the files in /boot

mkdir /boot.bad
mv /boot/* /boot.bad/
cp -pvr /boot.bad/* /boot/

After successfully booting, you may remove /boot.bad.

[edit] Problems with nvidia-drivers

[edit] emerge reports Could not detect kernel version

You must have a symbol link in /usr/src called linux pointing to your current kernel.

To see your current settings:

cd /usr/src ; ls -l

Sample output:

lrwxrwxrwx  1 root   root     14 Dec 26 17:11 linux -> linux-2.6.18.5
drwxr-xr-x 19 root   root    712 Oct 13  2006 linux-2.6.18.5

To add the missing link:

cd /usr/src ; ln -s linux-YOUR_VERSION linux

[edit] Problems with software RAID

[edit] Elements are not automatically added to the RAID at boot

Make sure your partition types for automounting are: fd

To view all partitions:

fdisk -l

Sample output:

 Disk /dev/sda: 74.3 GB, 74355769344 bytes
255 heads, 63 sectors/track, 9039 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1           8       64228+  fd  Linux raid autodetect
/dev/sda2               9        9039    72541507+  fd  Linux raid autodetect

Disk /dev/sdb: 74.3 GB, 74355769344 bytes
255 heads, 63 sectors/track, 9039 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1           8       64228+  fd  Linux raid autodetect
/dev/sdb2               9        9039    72541507+  fd  Linux raid autodetect

[edit] RAID rebuilds every start up

  • Always shutdown cleanly with commands such as: poweroff or reboot
  • Turn on an internal intent bitmap to reduce rebuilding:
mdadm /dev/mdX -Gb internal

[edit] Problems with swap

Unless you are going to share a swap with another OS, there is little benefit to using a swap partition. Use a swap file. A swap file allows you to resize it at your convenience.

Personal tools