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.
3) Linux does some automated stuff (with the Windows partition).
4) Computer boots to windows.
5) User sees windows desktop. It's the first time the user can do anything with the computer.
This sequence must repeat each time the computer is rebooted.
So each time the compter is rebooted it first boots linux, which does some stuff and then boots to windows.
My first thought was to set the default boot option to linux in grub/lilo. Linux boots, does it's stuff, changes grub.conf so that WinXP would be default and reboots. That's easy, but the next time(s!) the computer is rebooted it would boot WinXP straight away.
I don't think it's possible to make grub change it's own config after the command to boot it's default option is performed. In other words: after it has chosen to boot from the windows partition grub would change the default option back to linux. I doubt that's possible tho :(.
I don't think WinXP could change this while/after booting either, or could it?
How would one create such a setup? It's all just theory right now, so all ideas are welcome.
Could you explain WHY you want to do this in the first place? Maybe if we knew why you wanted to do such a bizarre thing we'd be able to offer useful suggestions to achieve your goal.
Originally posted by acid_kewpie Could you explain WHY you want to do this in the first place? Maybe if we knew why you wanted to do such a bizarre thing we'd be able to offer useful suggestions to achieve your goal.
Linux would run scripts that would check what has been changed on the windows partition and restore files if need be from a server. Or update the installation of windows and other programs that are installed from the central server. This would be more convenient at a gaming/internet cafe instead of a "Kiosk mode" in windows.
The user could do almost anything, but a reboot would fix it all. A reboot could update windows itself, any programs or just desktop shortcuts.
One way would be to set up a small FAT partition on the HD and put install GRUB on it, and set you boot to load from the FAT partition. (Set it up like a floppy boot disk.) Then both Windows and Linux could access the grub.conf file and change it as needed.
Note: I haven't done this myself, but I think it should work. I do have a boot floppy, but it's configured as an e2fs disk. (Only 15% of the 1.4 Mb disk is used, so the partition can be quite small. Hum -- a thought: You could develop and test the concept using a FAT floppy as the GRUB boot disk, setting your system to boot from the floppy.)
Last edited by PTrenholme; 08-27-2005 at 09:28 AM.
My last post got me interested, so I built a FAT boot floppy, and it seemed to work well. At least both XP and FC4 could boot from the floppy, and read /boot/grub/grub.conf on the floppy
If you haven't done this, here's how:
Code:
1) Put a DOS formatted floppy in you drive.
$ mount /media/floppy (or wherever you mount your floppies)
$ mkdir /media/floppy/boot
$ mkdir /media/floppy/boot/grub
$ sudo cp /boot/grub/* /media/floppy/boot/grub/
Password:
$ sudo /sbin/grub
grub> root (fd0)
grub> setup (fd0)
grub> quit
$ umount /media/floppy
And that's it: Now just boot from the floppy and you should see the same GRUB menu you have on your HD, since all you did was copy your /boot/grub directory to the floppy.
My grub.conf file looks like this:
Code:
$ sudo cat /boot/grub/grub.conf
Password:
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd1,1)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=7
#splashimage=(hd1,1)/grub/splash.xpm.gz
#hiddenmenu
title Fedora Core 4 (2.6.12-1.1398)
root (hd1,1)
kernel /vmlinuz-2.6.12-1.1398_FC4smp ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.12-1.1398_FC4smp.img
title Fedora Core 4 Init 3, no rhgb
root (hd1,1)
kernel /vmlinuz-2.6.12-1.1398_FC4smp ro root=/dev/VolGroup00/LogVol00 3 quiet
initrd /initrd-2.6.12-1.1398_FC4smp.img
title Fedora Core 3 (2.6.12-1.1372)
root (hd5,0)
kernel /vmlinuz-2.6.12-1.1372_FC3smp ro root=LABEL=/ rhgb quiet
initrd /initrd-2.6.12-1.1372_FC3smp.img
title Windows
rootnoverify (hd0,0)
chainloader +1
so I can boot into either XP or FC4 (or FC3 for a backup) from the floppy or HD.
Good luck.
Last edited by PTrenholme; 08-27-2005 at 01:05 PM.
I don't know if it's possible to boot from a FAT partition on the HD but if it'd be possible it's easy to create a "file.bat" automaticaly executed at the XP start-up: once you've created it put it into Start->Programs->Startup.
This file should copy a version of the grup file with the Linux start-up.
Originally posted by sam.pedraglio <snip>I don't know if it's possible to boot from a FAT partition on the HD</snip>
I've never tried it, but, since you can (if you wished) install a Linux OS on a FAT partition, and since you can boot from a FAT floppy, I suspect it would work.
Oh, kilgor, to make GRUB use, say, the fifth partition on your second HD for boot, you'd do something like
No problem. I do recommend that you develop the system using the boot-from-floppy approach, where you just set your BIOS to boot first from the floppy. That way you'll still have a working system when you (if you're like me) make the inevitable "boo-boo."
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.