LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Write to MBR while in the command line? (https://www.linuxquestions.org/questions/linux-newbie-8/write-to-mbr-while-in-the-command-line-179592/)

EThitop 05-09-2004 09:21 AM

Write to MBR while in the command line?
 
Hey all,

I have installed Slackware and if you want to see where I'm at you can view the following posts:

------------------------

http://www.linuxquestions.org/questi...hreadid=179481

and

http://www.linuxquestions.org/questi...hreadid=179416

------------------------

Anyway, apparently I have the lilo.conf file in the wrong place, b/c if I boot my system up without any CD's or bootdisks and it will boot straight into Windows XP. I need a way (from the command line interface) to move the lilo.conf (which is in /dev/hdf4) to the MBR (/dev/hde i think...) how can I do that? I am relatively new with the different commands but I can usually figure them out pretty fast when told which ones to use.

Thanks!
Erik

quatsch 05-09-2004 10:27 AM

your lilo.conf needs to be in /etc/ not the MBR. You then need to run the command
lilo -v
to actually install the bootloader. If it did not get written to the MBR, there's something wrong with your /etc/lilo.conf. Just post its contents and someone will be able to tell you how to fix it.

EThitop 05-09-2004 10:42 AM

Hey, I have recently tried:

below information from - http://www.linuxquestions.org/questi...hreadid=179481
Quote:

Ok, well I "kinda" figured it out...
I did what you said in order to create that bootsect.lnx file and then I used this command "# mcopy /bootsect.lnx a:" to copy it to a floppy disk. Then I booted into Windows XP and told it to show hidden folders and system files, I opened up c:\boot.ini with notepad (and turned of word wrap) and then I pasted "c:\bootsect.lnx="Slackware Linux" as the last line. I rebooted the system and I was given the menu that asks you to select your OS and I selected "Slackware Linux" and pressed enter. Then all I got was a screen that said "L" and that's all it said, nothing else happens after that.... What did I do wrong?
So, now I am gonna give what you said a try instead. I'll post what the lilo.conf file contains in just a few minutes if I can figure that out.

Thanks,
Erik

EThitop 05-09-2004 10:50 AM

My lilo.conf file is set up like so:

Quote:

# LILO configuration file
# generated by 'liloconfig'
#
# Start LILO global section
boot = /dev/hdf4
message = /boot/boot_message.txt
prompt
timeout = 1200
# Override dangerous defaults that rewrite the partition table:
change-rules
reset
# VESA framebuffer console @ 1024x768x256
vga = 773
# Normal VGA console
# vga = normal
# VESA framebuffer console @ 1024x768x64k
# vga=791
# VESA framebuffer console @ 1024x768x32k
# vga=790
# VESA framebuffer console @ 1024x768x256
# vga=773
# VESA framebuffer console @ 800x600x64k
# vga=788
# VESA framebuffer console @ 800x600x32k
# vga=787
# VESA framebuffer console @ 800x600x256
# vga=771
# VESA framebuffer console @ 640x480x64k
# vga=785
# VESA framebuffer console @ 640x480x32k
# vga=784
# VESA framebuffer console @ 640x480x256
# vga=769
# End LILO global section
# Linux bootable partition config begins
image = /boot/vmlinuz
root = /dev/hdf4
label = Slackware Linux
read-only
image = /windows
root = /dev/hde
label = Windows XP
read-only
# Linux bootable partition config ends
To me everything looks to be in there correctly as my Windows XP is installed on /dev/hde and Slackware Linux is installed on /dev/hdf4

I just need to put the lilo.conf file on the MBR (master boot record) on /dev/hde

That is what I need to figure out how to do, I am gonna look at the instructions you recently provided.

BRB :)

EThitop 05-09-2004 10:53 AM

Well my Windows image location may be incorrect, b/c I added that in the past.. and I don't know if I have it setup where it will choose automatically (fast detect) or if it will give me like 30 seconds or so to choose the option I want.

quatsch 05-10-2004 11:48 AM

change the line
boot=/dev/hdf4
to
boot=/dev/hde
without partiton number - /dev/hdf4 writes the bootloader to partition 4 of hdf.
Then run
lilo -v

Make sure you have a working boot-floppy in case things go wrong.

quatsch 05-10-2004 11:49 AM

Forgot to mention that your lines for windows look wrong. Should be something like:
other=/dev/hda1
label="windows"
table=/dev/hde

EThitop 05-10-2004 10:04 PM

Ok I will fix that but I tried the "lilo -v" command and it said:

Quote:

Warning: LBA32 addressing assumed
Reading boot sector from /dev/hde
Fatal: geo_query_dev HDIO_GETGEO (dev 0x2100): Inappropriate ioctl for device
Any ideas on what that means? LBA32 is something to do with my hdd right? How can I fix this?

Thanks,
Erik

EThitop 05-10-2004 10:08 PM

By the way, my /dev/hde (80GB hdd with Windows installed on it) does work, b/c Windows will still boot from it. Lately I have been getting into Linux by using the bootdisk (floppy) that it created, but of course I don't want to continue doing it this way. ;)

quatsch 05-11-2004 10:43 AM

hmm. that's beyond my abilities. it has problems with the geometry of the hd or something like that.

You might try grub instead of lilo - I don't know much about grub b/c I've never used it but I'm sure there are tons of threads here dealing with installing grub.

EThitop 05-11-2004 11:04 PM

Well, I may have found the answer to this! Though I have not tried it yet, I will soon. While in KDE, I took a look at Control Center --> System Administration --> Linux Kernel. Linux Kernel has plenty of settings you can easily enable/disable, etc... Then I went to ATA/IDE/MFM/RLL support --> IDE, ATA and Atapi Block devices --> Auto Geometry Resizing support. This sections info says the following:

Quote:

CONFIG_IDEDISK_STROKE

Should you have a system w/ an AWARD Bios and your drives are larger than 32GB and it will not boot, one is required to perform a few OEM operations first. The option is called "STROKE" because it allows one to "soft clip" the drive to work around a barrier limit. For Maxtor drives it is called "jumpon.exe". Please search Maxtor's web-site for "JUMPON.EXE". IBM has a similar tool at: <http://www.storage.ibm.com/hdd/support/download.htm>.
I have a Western Digital drive, I will read more into this but I think I am going to give it a try.


All times are GMT -5. The time now is 10:03 PM.