Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello, I had to switch a Debian Linux installation, where the harddrive was previously working as primery master (hda), to work as secondary master. There is LILO (GRUB did not want to install for some reason) installed on the MBR on the harddrive. I can boot the drive, but end up with a busybox and complanations, that nothing can found. I have a Linux live CD and I tried to modify the /etc/lilo.conf with a success. But I can not write the changed lilo.conf back to LILO on the MBR. Running lilo from the live cd ends with complains that it can not write to /boot/<some place>.
The /dev/hda may not be changed.
How is it possible to get the system back working? Or is reinstalling the whole system the only solution?
Last edited by TTL_2; 10-13-2007 at 02:32 AM.
Reason: Typo
The easy option would be to boot of a install CD with a rescue
option, tell it which partition to boot of, and then edit your
lilo.conf and run lilo, installing it in the MBR of the new
primary HDD ...
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195
Rep:
Quote:
Originally Posted by TTL_2
How is it possible to get the system back working? Or is reinstalling the whole system the only solution?
That is the Windoze solution if you have an MBR problem!
Why couldn't you write to the /boot directory? Were you root? Did you properly indicate where the MBR should have been written to? Are sure you edited lilo.conf on your /dev/hdc and not on /etc while you were running the live CD?
This is a but mind boggling, but when editing lilo.conf, you have to mount the /dev/hdc1 partition. It mounts most likely in /mnt/hdc1. Then edit lilo.conf in /etc/hdc1/etc/lilo.conf.
This done, run lilo with these parameters (not tested!)
lilo -b /dev/hdc -C /mnt/hdc1/etc/lilo.conf
Do also not forget to edit lilo.conf so it contains the correct boot device.
Another option might be to use the '-r" option to chroot into /mnt/hdc1 and use lilo like if you already had booted from /dev/hdc.
Googling for "install lilo" will come up with a number of hits on step-by-step instructions. The most likely error that you migh make is to forget to properly point to /dev/hdc at some point in the installation.
That is the Windoze solution if you have an MBR problem!
Why couldn't you write to the /boot directory? Were you root? Did you properly indicate where the MBR should have been written to? Are sure you edited lilo.conf on your /dev/hdc and not on /etc while you were running the live CD?
This is a but mind boggling, but when editing lilo.conf, you have to mount the /dev/hdc1 partition. It mounts most likely in /mnt/hdc1. Then edit lilo.conf in /etc/hdc1/etc/lilo.conf.
This done, run lilo with these parameters (not tested!)
lilo -b /dev/hdc -C /mnt/hdc1/etc/lilo.conf
Do also not forget to edit lilo.conf so it contains the correct boot device.
jlinkels
/mnt/hdc1/etc/lilo.conf was properly edited.
If I run the command you mentionend from the live CD, I get:
#lilo -b /dev/hdc -C /mnt/etc/lilo.conf
Ignoring entry 'boot'
Fatal: creat /boot/boot.0.300: Read only file system
There are zero matches for '/boot/boot.0.300:' at Google.
Then I tried the installation CD of Debian, but found only a rescue mode which let me mount /dev/hdc1 as /. I ran the same command there once again
The result was (while sitting in /etc):
#lilo -M /dev/hdc -C lilo.conf
/boot.1600 exsists -no /dev/hdc backup
The master boot record of /dev/hdc has been updated
After rebooting, the BIOS did not detect /dev/hdc as bootable device anylonger :-(
I discovered that I accidentally replaced -C by -M, rebooted into the installer CD again and ran
#lilo -b /dev/hdc -C /mnt/etc/lilo.conf
the good news, now the system is starting again.
(Until it crashes now while starting the X Server, I did set the driver to vesa before).
Thank you.
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195
Rep:
Good!
However I can recommend to migrate to Grub one day. If you can get it to work, it is really easier and more powerful than Lilo. To my surprise I have noticed that on some systems I upgraded Lilo is back. (Now I almost never boot my systems so it usaully remain unnoticed or unfixed) Grub is easier to change (you don't have to run Lilo after making a change) and you are able to change settings during the boot processes.
I don't know why you installation failed, and mine often does as well, but after some trying I usually succeed.
And lilo has a feature that grub is lacking: you can choose
which kernel/OS to boot on the next boot as a one off before
shutting the current session down. Now that's cool.
There is LILO (GRUB did not want to install for some reason)
I get this all the time when installing grub to the partition, it will fail. So I go through the motions again choosing the same spot (partition), and it installs the second time around.
It should not be difficult. Basically, put your disk as hdc, from here, boot from your rescue CD. Edit your lilo.conf and fstab so that they now reference to hdc instead of hda. After this is done, chroot to your root directory (if you mount your root in /mnt then cd into /mnt), run lilo. It should update all your boot information and mount the correct partition after it boots.
However, you may need another OS loader if your hdc is not the first boot disk.
If I, for instance, happen to work with a 2.6.21.5 kernel and
then compile a 2.6.23.1 myself ... I add that one to lilo.conf,
run lilo, and then e.g. invoke lilo -R 2.6.23 ... now, the next
time the box boots lilo will load that kernel. It's very handy
if you don't display the lilo menu (which I don't) by default.
The grub thing only allows for a "cascading fallback". Different
kettle of fish.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.