[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: boot failure



On Mon, 15 Nov 2004, Kent West wrote:

My / is on hda5 and /boot is on hda3 (another ext2 partition). I still
can't get the boot partition to mount in such a way that lilo can
open/write stuff to it. So I've taken your option of pasting file contents
and the results of some commands. etc/lilo.conf is at the end.


root@ttyp1[knoppix]# cat /mnt/hda5/etc/fstab
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>               <dump>
<pass>
/dev/hda5       /               ext2    errors=remount-ro       0       1
/dev/hda6       none            swap    sw                      0       0
proc            /proc           proc    defaults                0       0
/dev/fd0        /floppy         auto    user,noauto             0       0
/dev/cdrom      /cdrom          iso9660 ro,user,noauto          0       0
/dev/hda3       /boot   ext2    defaults                        0       2


The star next to /dev/hda2 in the fdisk -l output below is something to do
with Windows right? This computer boots windows by default; to get into
lilo you have to press "a" then "3" at a particular millisecond.

root@ttyp1[knoppix]# fdisk -l

Disk /dev/hda: 20.0 GB, 20003880960 bytes
240 heads, 63 sectors/track, 2584 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1               2           7       45360   84  OS/2 hidden
C: drive
/dev/hda2   *           8        1907    14364000    7  HPFS/NTFS
/dev/hda3            1908        1910       22680   83  Linux
/dev/hda4            1911        2584     5095440    5  Extended
/dev/hda5            1911        2575     5027368+  83  Linux
/dev/hda6            2576        2584       68008+  82  Linux swap


> Before running the chroot command, you can type "mount" to see if the 

root@ttyp1[knoppix]# mount
/dev/root on / type ext2 (rw)
/dev/scd0 on /cdrom type iso9660 (ro)
/dev/cloop on /KNOPPIX type iso9660 (ro)
/ramdisk on /ramdisk type tmpfs (rw,size=186064k)
/proc/bus/usb on /proc/bus/usb type usbdevfs (rw,devmode=0666)
automount(pid394) on /mnt/auto type autofs (rw,fd=4,pgrp=394,m
/dev/hda5 on /mnt/hda5 type ext2 (rw,nosuid,nodev)
/dev/hda3 on /mnt/hda3 type ext2 (rw)
/dev/hda2 on /mnt/hda2 type ntfs (ro,nosuid,nodev,umask=000,ui

> Now, from within the chroot'd environment, just run "mount -a", and 

root@ttyp1[knoppix]# chroot /mnt/hda5/
Knoppix:/# mount -a
mount: block device /dev/hda3 is write-protected, mounting read-only
mount: cannot mount block device /dev/hda3 read-only

Outside the chroot'd environment

root@ttyp1[knoppix]# mount -t ext2 /dev/hda3 /mnt/hda5/boot/

doesn't complain but

root@ttyp1[knoppix]# mount
/dev/root on / type ext2 (rw)
/dev/scd0 on /cdrom type iso9660 (ro)
/dev/cloop on /KNOPPIX type iso9660 (ro)
/ramdisk on /ramdisk type tmpfs (rw,size=186064k)
automount(pid394) on /mnt/auto type autofs
(rw,fd=4,pgrp=394,minproto=2,maxproto=4)
/dev/hda5 on /mnt/hda5 type ext2 (rw,nosuid,nodev)

and then

root@ttyp1[knoppix]# chroot /mnt/hda5/
Knoppix:/# lilo
Fatal: open /dev/hda3: Permission denied


> Now just run "lilo", and it should repair your boot partition, assuming 
> everything else is correctly setup (such as the kernel being in the 
> right place, /vmlinuz pointing to the correct kernel, /etc/lilo.conf set 


Knoppix:/# ls -l vml*
lrwxrwxrwx    1 root     root           18 Nov 13 17:44 vmlinuz ->
boot/vmlinuz-2.6.8
lrwxrwxrwx    1 root     root           27 Nov 15 18:25 vmlinuz-2.2.20 ->
/boot/vmlinuz-2.2.20-idepci
lrwxrwxrwx    1 root     root           27 Nov 15 18:57 vmlinuz.old ->
/boot/vmlinuz-2.2.20-idepci

/boot is empty:

Knoppix:/# ls -l boot
total 0

> up properly, initrd setup properly if necessary (probably not necessary 
> as I believe you're trying to drop back down to a stock 2.2 kernel). 

correct 

> first. When you say "boot partition", do you mean your / partition, or 
> your /boot partition? Related, unless you have a separate partition for 
> /boot, it'll be on the / partition, which is assumed above to be on 
> /dev/hda5, not /dev/hda3.

Yeah, I think I do have a separate partition for /boot, so which bit of
the above rested on the assumption that it was on the same partition
(hda5) as /, and how to I modify your instructions?

Thanks a lot again.

Dan


Knoppix:/# cat etc/lilo.conf
# /etc/lilo.conf - See: `lilo(8)' and `lilo.conf(5)',
# ---------------       `install-mbr(8)',
`/usr/share/doc/lilo/',
#                       and `/usr/share/doc/mbr/'.

#

# Support LBA for large hard disks.
#
lba32

# Overrides the default mapping between harddisk names and the
BIOS'
# harddisk order. Use with caution.
#disk=/dev/hde
#    bios=0x81

#disk=/dev/sda
#    bios=0x80

# Specifies the boot device.  This is where Lilo installs its boot
# block.  It can be either a partition, or the raw device, in which
# case it installs in the MBR, and will overwrite the current MBR.
#
boot=/dev/hda3

# Specifies the device that should be mounted as root. (`/')
#
root=/dev/hda5

# Enable map compaction:
# Tries to merge read requests for adjacent sectors into a single
# read request. This drastically reduces load time and keeps the
# map smaller.  Using `compact' is especially recommended when
# booting from a floppy disk.  It is disabled here by default
# because it doesn't always work.
#
# compact

# Installs the specified file as the new boot sector
# You have the choice between: bmp, compat, menu and text
# Look in /boot/ and in lilo.conf(5) manpage for details
#
install=/boot/boot-menu.b

# Specifies the location of the map file
#
map=/boot/map

# You can set a password here, and uncomment the `restricted' lines
# in the image definitions below to make it so that a password must
# be typed to boot anything but a default configuration.  If a
# command line is given, other than one specified by an `append'
# statement in `lilo.conf', the password will be required, but a
# standard default boot will not require one.
#
# This will, for instance, prevent anyone with access to the
# console from booting with something like `Linux init=/bin/sh',
# and thus becoming `root' without proper authorization.
#
# Note that if you really need this type of security, you will
# likely also want to use `install-mbr' to reconfigure the MBR
# program, as well as set up your BIOS to disallow booting from
# removable disk or CD-ROM, then put a password on getting into the
# BIOS configuration as well.  Please RTFM `install-mbr(8)'.
#
# password=tatercounter2000

# Specifies the number of deciseconds (0.1 seconds) LILO should
# wait before booting the first image.
#
delay=20

# You can put a customized boot message up if you like.  If you use
# `prompt', and this computer may need to reboot unattended, you
# must specify a `timeout', or it will sit there forever waiting
# for a keypress.  `single-key' goes with the `alias' lines in the
# `image' configurations below.  eg: You can press `1' to boot
# `Linux', `2' to boot `LinuxOLD', if you uncomment the `alias'.
#
# message=/boot/bootmess.txt
prompt
timeout=150
#       prompt
#       single-key
#       delay=100
#       timeout=100

# Specifies the VGA text mode at boot time. (normal, extended,
ask, <mode>)
#
# vga=ask
# vga=9
#
vga=normal

# Kernel command line options that apply to all installed images go
# here.  See: The `boot-prompt-HOWO' and `kernel-parameters.txt' in
# the Linux kernel `Documentation' directory.
#
# append=""

# Boot up Linux by default.
#
default=linux_2.2.20

image=/vmlinuz            
        label=linux_2.6.8
        initrd=/initrd.img    ## DAN aded this 15 nov 04 evening in knoppix
        read-only
#       restricted
#       alias=1

image=/vmlinuz.old
        label=linux_2.2.20
        read-only
        optional
#       restricted
#       alias=2

# If you have another OS on this machine to boot, you can uncomment the
# following lines, changing the device name on the `other' line to
# where your other OS' partition is.
#
# other=/dev/hda4
#       label=HURD
#       restricted
#       alias=3

#other=/dev/hda1
#  label="Other(hda1)"

other=/dev/hda2
  label="WinNT(hda2)"




Reply to: