Dual boot WXP/openSUSE if USB stick is plugged on. Normal WXP boot if not.

I’m not sure if this is possible but…

First, I don’t want a Live USB, I want openSUSE to be installed in the HD’s partition in order to get the HD’s speed and size, not the USB’s ones.

What I want is to install openSUSE on the hard disk of a PC with Windows XP and being able to dual boot (so far the normal procedure that it’s clear for me) only if some USB stick (with all needed configuration) is plugged on. In case this USB stick is not plugged on, I would like the normal WXP boot to take place. In other words, I want a standard WXP boot, except if I plug my USB, in which case the GRUB menu would appear like in any normal dual boot installation.

Another way to explain the question is that I don’t want anybody to easily know that openSUSE is installed in the machine.

I hope I explained the question clearly, thanks in advance.

On 08/11/2013 07:26 PM, tonrev wrote:
> I hope I explained the question clearly

i think you explained it clearly, but unfortunately i don’t know how
to do what you are asking to do…and i’m not at all sure it can be
done…unless it is possible to install the system and /home to the
harddrive and put grub (at least and maybe /boot) on the USB stick…

and leave the windows booting stuff in the MBR of the hard drive and
leave it marked as bootable…

AND, mark the grub partition on the USB stick as bootable and THEN
instead of deciding which gets booted on the grub screen do that by
booting to the BIOS and selecting THERE whether to boot from the hard
drive or the USB!

done that way (maybe) the machine would boot windows every time and
IF someone selected to boot from USB, but didn’t have the right stick
they wouldn’t ever see openSUSE boot…and, as long as they were
working in windows i don’t think they could ‘see’ the Linux file
systems…they could of course if they booted (for example) any
Linux system, or something like parted-magic via usb…and, even in
windows they could see that the disk seems to be smaller than expected…

but none of that may work…wait for a real guru to chime in…


dd
http://tinyurl.com/DD-Caveat
http://tinyurl.com/DD-Complaints

I am just thinking aloud here. I have not tested what I am suggesting.

My suggestion: Install opensuse. In the partitioning section, set “/boot” to be on the USB, and the remainder of your opensuse install to be on the hard drive. Configure grub2 to be installed on either “/boot” or on the MBR of the USB.

In your BIOS settings for the box, set the boot order to be USB first.

The effect should be that, when the USB is plugged in, it will boot opensuse. Otherwise it will continue to boot as it currently is booting from the hard drive.

The only part of opensuse on the USB will be “/boot”. That mainly contains kernels and the boot stuff. It is rarely accessed, except when updating the kernel or rebuilding the “initrd”. So it should not noticeably slow down your opensuse system to have that on a USB.

The one downside – if you have a different USB plugged in, it will try to boot from that :stuck_out_tongue:

This was more or less the idea from what I have been googling but…

as you say I am not sure if it will work or how to (clearly) do it or even how to try it without destroying Windows MBR and messing everything up.

If you are careful not to put Grub on the hard disk MBR (Which the default will want to do) but put it on the stick then all is good. Note that if you have a Windows rescue disk you should be able to fix if you do some how mess up.

So use Window to shrink the partitions to give free space for the openSUSE install. In such a case the installer does not need to souch a Windows partition.

Follow the above idea.

Note any time you fool around with partitions you should be sure to have a good backup of any important data and a plan to recover if things go wrong.

A;so note that if you have a UEFI and not a BIOS then it may get more complicated

Thank you for the answers, I will try it one of this days.

Well, I got it, thank you for the ideas.

Just in case someone else is interested in something like this, the procedure is:
[ol]
[li]Shrink the windows partition (sdc1) to get a free one (sdc2), like in any normal dual boot installation. I used a windows partitioning tool to avoid problems. [/li][li]Download and burn a Live-USB (sda1) [/li][li]Prepare the bootable USB stick (sdb). This was the tricky part.[/li][LIST=1]
[li]Copy a MBR to the USB (sdb). [/li]```
dd if=/usr/share/syslinux/mbr.bin of=sdb &>/dev/null

 
[li]Set the first USB partition as bootable.[/li]```
parted /dev/sdb set 1 boot on &>/dev/null

[li]Now, or later during installation, this partition (sdb1) that will contain /boot must be formatted as EXT3 or EXT4, FAT doesn’t work!. The partition must be greater than 64MB (not very much today!) [/li][/ol]

[li]Install from the Live USB[/li][ol]
[li]Install swap, / and /home in the free windows partition (sdc2) as normal. [/li][li]In the partitioning section, edit the bootable USB partition (sdb1), format as EXT4 and mount as /boot [/li][li]Later in the installation, edit GRUB settings. Remove it from MBR and install it in /boot [/li][/ol]

[li]Set the BIOS so that the USB hard disk boots before the internal hard disk [/li][/LIST]

With this setup, if you boot with the bootable USB stick plugged on, you have a normal dual boot system but if you boot without the USB stick you have a normal Windows boot.

Advantages of this set up are:
[ul]
[li]You don’t touch Windows boot loader so you can avoid problems. [/li][li]As Windows and openSUSE boot loaders are placed in different places, and openSUSE’s one is even unpluggable, if you reinstall Windows or openSUSE you don’t affect or destroy the other, as is the case when you reinstall Windows in a typical dual boot system. [/li][li]You can hide the dual boot system if you are interested in that, except if someone checks the hard disk with a partitioning tool that detects EXT filesystems. [/li][li]Security. No one can boot (even you) without the bootable USB stick. [/li][/ul]

I hope this will be usefull for someone.

I see what you’re trying to achieve, but are you aware that anyone with a Live USB stick has access to your machine? Such a person wouldn’t need the bootloaders from any of the installed OS’s, yet be able to boot the system and completely empty or copy the HDD, even run programs installed on the HDD, see https://forums.opensuse.org/content/146-using-livecd-take-over-repair-installed-system.html

It is not really necessary and complicates things. /boot location and bootloader location are independent. If we are speaking about BIOS system here, you can simply install bootloader on USB stick while having all your system (including /boot) on HDD. Then during boot you would need to select USB as boot device in BIOS menu.

Well, security is not so tough. I only want to avoid someone pressing the ON button and see or log into some “no standard” OS and if I want to revert the PC to his original configuration I only have to delete or reformat the linux partitions, no windows reinstall is necessary.

In some way this is like a persistent Live USB, now that persistent Live USB seems not to work.