Cannot boot Slackware Linux after installation

Sometimes it happens. Here is a tip on how to boot into your Linux and fix the problem. Normally, this problem always happen because of wrong Lilo configuration. For example, you choose to store Lilo in / directory instead of mbr during Lilo setup when installing Slackware. Anyway, whatever the reason is, you need to configure Lilo again.

If you create a boot disk or usb boot disk during installation setup, you just need to boot from it. If not, then you can boot from Slackware installation cd or dvd. For this particular example, we use Slackware dvd. See steps below:

1) Boot from Slackware installation CD/DVD.

2) At boot prompt, enter: root=/dev/sda1 rdinit= ro

Note: Choose this option if you install LILO in root (/) partition. Replace sda1 with your root partition. Press Enter to boot. If you got an error such as 'There is no Linux image in this partition' or you don't remember what your Linux partition is, continue to step 3 below.

3) Press Enter to use default kernel. Login as 'root'.

The above steps are exactly the same as the steps when you install Slackware. See Slackware 14.1 installation guide if you are not sure. It is a step by step instructions with pictures. When you are done, you'll have a shell prompt. If your problem is that you choose to store Lilo in / partition, then try setting boot flag to the / partition. This can be done with typing 'fdisk /dev/sda' at the command prompt. Please replace /sda with your hard disk name. The next step is to set boot flag which is shown below. The steps are in the fdisk tool's prompt.

1) Press 'p' to print the partition table. Please identify your root partition.

[email protected]:~# fdisk /dev/sda

Command (m for help): p

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x43934f6e

Device Boot Start End Blocks Id System
/dev/sda1 2048 2048 0 82 Linux swap
/dev/sda2 2048 104859647 52428800 83 Linux
/dev/sda3 104859648 209717247 52428800 83 Linux
/dev/sda4 209717248 976773167 383527960 83 Linux

Command (m for help):

2) Press 'a' to set a bootable disk partition. Enter number of the partition you wish to set a boot flag.

Command (m for help): a
Partition number (1-4): 2

Command (m for help): p

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x43934f6e

Device Boot Start End Blocks Id System
/dev/sda1 2048 2048 0 82 Linux swap
/dev/sda2 * 2048 104859647 52428800 83 Linux
/dev/sda3 104859648 209717247 52428800 83 Linux
/dev/sda4 209717248 976773167 383527960 83 Linux

Command (m for help):

Note:The example above shows /dev/sda2 is set as a bootable disk partition.

3) Press 'w' to write the changes and exit.

Try reboot your Linux computer and see if it solve the problem. If not, then we need to reconfigure Lilo. Here are the steps:

1) Boot from Slackware installation CD/DVD.

2) At boot prompt, press Enter to use default kernel.

3) Login as 'root'.

4) At the command prompt, type:

[email protected]:~# mount /dev/sda2 /mnt
[email protected]:~#

To begin reconfigure Lilo, we need chroot environment. Issue the command below:

[email protected]:~# chroot /mnt

Configure Lilo again using the command 'liloconfig' as example below:

[email protected]:~# liloconfig

Install Lilo - Choose 'Expert'.

Install Lilo image

Expert Lilo installation - Choose 'Begin'

Expert Lilo installation image

Optional Lilo append - Just press Enter.

Optional Lilo append image

Use UTF-8 text console - Choose 'No'.

Use UTF-8 text console image

Configure Lilo to use frame buffer console - Choose 'Standard' or anything else if you know what you are doing.

Configure Lilo to use frame buffer console image

Select Lilo target location - Choose 'MBR'.

Select Lilo target location image

Confirm location to install Lilo - Enter your hard disk name.

Confirm location to install Lilo image

Choose Lilo timeout - '5 seconds' is a good idea.

Choose Lilo timeout image

Optional Slackware logo boot screen - Yes or No is alright.

Optional Slackware logo boot screen image

Next is to 'Add a Linux partition to the Lilo Config'. Press OK.

Image

Select Linux partition - Select using arrow key and press Enter to choose.

Select Linux partition image

Select partition name for the hard disk - Name it 'Slackware' or anything you want. This is the menu appeared in the boot manager.

Select partition name for the hard disk image

Expert Lilo installation - Finally, install Lilo.

Expert Lilo installation - install lilo image

That's it. Type 'exit' to exit chroot environment. Now you can reboot and see if your Linux boot this time. It should!

Note:If you have problem or got error running 'liloconfig' tool, you can still edit lilo.conf file manually. This should be done before you exit chroot environtment. You can mount your linux partition again and chroot into the mounted directory as steps above.

1. Type vim /etc/lilo.conf. Check which hard disk partition lilo choose to boot:

# LILO configuration file
# generated by 'liloconfig'
#
# Start LILO global section
boot =

Note: If it's blank, enter hard disk name where you install Linux. For example, if you install Linux in the first hard disk in your computer: boot = /dev/sda.

2. Check 'Linux bootable partition config' at the bottom of lilo.conf file. See the example below:

# Linux bootable partition config begins
image = /boot/vmlinuz
root = /dev/sda1
label = Slacker
read-only # Partitions should be mounted read-only for checking
# Linux bootable partition config ends

Note:Make sure you have them. You can save and exit vim using :wq command.

3. Run: lilo to overwrite the changes.

4. Type: exit to exit chroot environment and reboot your Linux system.

That's all.

Add new comment