Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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.
at present i have a windows box in my cluches. at a certain time i would like the box to re-boot into a linux mode let it run some diag stuff and then re-boot into windows all automatically.
i can get the windows thing to re-boot when ever i want, however i am unsure how to get the box to jump into linux.
so i thought this may be a good idea:
1. the time comes for a re-boot
2. the current windows Bootloader is copied out into a backup file on to a dedicated partition.
3. the linux bootloader ( probably lilo ) is copied from the dedicated partition to the MBR of the disk.
4. the machine re-boots into linux and does its stuff
and then when done re-does the above ( but points 2 and 3 are swapped around and changed respectivly )
now if possible all this needs to happen without user intervention.
can the boot sector/MBR be copied using just the dd command? if so, any ideas?
It might be easier to use grub as your bootloader. Grub is easier to use than lilo because you have to rewrite the MBR whenever you change lilo.conf but you don't have to rewrite the MBR when you change grub.conf.
Then how would you automatically boot back to linux? Windows can't modify the grub.conf unless its on a FAT32 partition.
You would need a console windows app of some kind to write a file to the MBR.
dd if=/dev/hda of=mbr.bin bs=512 count=1
If your booting from hda.
What version of windows? With Windows 98 you can create a boot floppy disk with a config.sys menu and use loadlin for linux. Then either OS could modify the floppy disk. However, this method will not work for XP or W2K.
"Then how would you automatically boot back to linux? Windows can't modify the grub.conf unless its on a FAT32 partition. "
You could try making grub.conf a symbolic link to a file on a FAT32 partition. I don't know if grub is smart enough to handle a symbolic link or not. You could experiment and see.
-R command line
This option sets the default command for the boot loader the next time it executes. The boot loader will then erase this line: this is a once-only command. It is typically used in reboot scripts, just before calling `shutdown -r'. Used without any arguments, it will cancel a lock-ed or fallback command line.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.