PDA

View Full Version : Boot from HD Partition without Lilo after hd-Install



andig
03-24-2004, 09:34 AM
I've installed Knoppix 3.4 to /dev/hda5, but didn't install Lilo into the MBR. I'd now like to run the installation from the HD partition.
I've tried booting from the CD and run knoppix root=/dev/hda5, but the CD version is started. What do I need to do run boot the /dev/hda5 partition (which in turn allows me to run lilo)?

Or am I totally confused?

Thanks,
Andi

Markus
03-24-2004, 10:26 AM
I don't think the CD can do this. What I can think of is either using the windows bootloader to boot lilo (if you have windows), or alternatively making a boot floppy.
Your install isn't lost though, you can boot the CD and chroot to hda5 to do one or the other.

andig
03-24-2004, 11:11 AM
I see. I assume I'd need to:

-boot cd
-chroot /dev/hda5

then I'd like to:
-run lilo
-dd if=/dev/hda5... to get the boot sector
-copy to ntfs partition
-edit boot.ini

does that make sense?

Thanks,
Andreas

andig
03-24-2004, 11:25 AM
Doesn't work:

after chroot I can't run lilo:

sudo lilo
Fatal: open /dev/hda5: Permission denied

How can I run lilo to get the boot sector into /dev/hda5???

Thanks,
Andi

andig
03-24-2004, 12:19 PM
OK, found the answer in a posting by tx:

mount -o dev /dev/hda5 /mnt/hda5; chroot /mnt/hda5

seems to do the trick- not sure what the difference is?

However, WinXP boot loader still doesn't work, even now that I have the new boot sector, the XP Boot loader hangs, I assume my lilo.conf settings must be wrong.

Yuck- long way...

Thanks,
Andi

Markus
03-24-2004, 02:09 PM
For the XP bootloader you need to copy the bootsector file to C:\ after having run lilo and you only need to run lilo when you've made some changes to /etc/lilo.conf.
The syntax, if I remeber it correctly, was:
dd if=/dev/hda5 of=/bootsect.lnx bs=512 count=1
My C:\boot.ini has a line at the end: C:\bootsect.lnx="Knoppix"
The procedure is explained at lenght in: http://www.knoppix.net/forum/viewtopic.php?t=4174

andig
03-24-2004, 02:24 PM
I understand that and have actually done so- only the new BS doesn't boot. It's certainly written by Lilo (as the old BS contained only zeros), but doesn't boot- machine hangs.

Any ideas?

Thanks,
Andi

Markus
03-24-2004, 02:31 PM
Hmm, worked for me. Can you post your lilo.conf and boot.ini?
Other than that, don't know :?:

andig
03-24-2004, 03:59 PM
OK, stripped out all comments:

# /etc/lilo.conf - See: 'lilo(8)' and 'lilo.conf(5)',
lba32

# Specifies the boot device. This is where Lilo installs its boot
boot=/dev/hda5

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

bitmap=/usr/share/lilo/contrib/debian.bmp
bmp-colors=1,,0,2,,0
bmp-table=120p,173p,1,15,17
bmp-timer=254p,432p,1,0,0

install=bmp

delay=20

prompt
timeout=50

map=/boot/map

vga=791

default="Linux(2.6)-2"

image=/boot/vmlinuz-2.4.25
label="Linux(2.4)-1"
initrd=/boot/initrd-2.4.25.gz
append="ramdisk_size=100000 init=/etc/init lang=de apm=power-off nomce"
read-only

image=/boot/vmlinuz-2.6.3
label="Linux(2.6)-2"
initrd=/boot/initrd-2.6.3.gz
append="ramdisk_size=100000 init=/etc/init lang=de apm=power-off nomce"
read-only


other=/dev/hda1
label="Win XP/2K"

andig
03-24-2004, 04:00 PM
[boot loader]
timeout=1
default=multi(0)disk(0)rdisk(0)partition(1)\WINNT
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows XP Professional" /fastdetect /noirqscan
C:\BOOTSECT.DEB="Debian Linux"


WinXP is hda1, Debian is hda5

Markus
03-24-2004, 04:26 PM
Err, nope, sorry, can't find the fault there! Hopefully someone else can.

andig
03-24-2004, 05:43 PM
Forgive me- the boot sector file was still the old, forgot to copy ontop of it, sorry.

To summarize:

to get Debian booting, the trick is to use correct mount syntax (see above), before running lilo.

Cheers and thanks a lot,
Andi

Markus
03-24-2004, 06:13 PM
No problemo, glad it worked.

chwdgr
03-30-2004, 01:38 PM
Hi,
Install Knoppix using the CD on the HD. (You did this already)
(Eventually reboot using the bootfloppy)

Press Ctrl/Alt/F1, you are in the big black commandline screen.
(To get back later to colored display: press Ctrl/Alt/6or7or8..)

Login as root including password.

Then type dd if=/dev/hda3 of=/bootsect.lnx bs=512 count =1
(hda3: the '3' points to the linux partition, could be 2,3 or 4 or 6 depending
on the other Dos/Windows partitions installed)

Put a blank formatted diskette in the drive.
type in: mcopy /bootsect.lnx a:

Now you have a valid bootsector for Linux on the floppy!

Now get out Linux, back to Windows.

Copy the file bootsect.lnx from a: to c:

Add the next line to boot.ini:
C:\Bootsect.lnx="Linux"
Save, reboot, select Linux when selecting the OS and there you go!

Remember: if you ever change lilo.conf, don't forget to run lilo AND
repeat the above procedure!!!!! Otherwise you wil get a screenful of 99's!

Btw the procedure described above is not my invention: it is based on a nice article written by Bruce P. Blackshaw named:
"Dual booting Linux and Windows 2000 on large hard disks"

(This trick works with XP and W2Kl! BUT..... you will have a problem getting your networkcard working: some Windows security updates kill some settings in it.....so that only Windows works fine, not Linux....)
See interesting stories at
http://www.knoppix.net/forum/viewtopic.php?t=2164

Good luck!

Niels