Installing to 2nd drive (USB) without disturbing main drive

Here is my situation:

HP Laptop. Windows 7/64bit is installed on the built in drive, and has a full disk encryption utility that runs. It runs from the MBR, to decrypt the drive to be able to run normally.

I have a USB drive, and I can set the boot order in the BIOS. I’ve read the installation options, and am seeing “install to MBR” is not recommended if you have an existing OS installation.

What I want to do is set this system up such that if the USB hard drive is attached, when I power it on, it will boot that, ignoring completely the internal drive. If I don’t have it connected, then the system boots Win 7 normally.

Where I am now: I’ve booted from the OpenSuSE 12.1 dvd, ran the install to the dev/sdb disk, formatting it with a swap, /boot (ext2), / (ex4), and /home (ext4). My bootloader was installed to /boot.

If I tell the installer to install to MBR, will it go to the MBR on the USB disk, or to the “dev/sda” disk? – (I’m afraid to touch MBR, in case it writes to /dev/sda, as it would potentially corrupt the full disk encryption / Win 7 partition.)

As insurance you could temporally disconnect the internal drive during the install.

If I had Windows installed on /dev/sda and openSUSE installed on /dev/sdb and I wanted to boot from openSUSE and select openSUSE or Windows from the Grub OS selection menu, I would have to do several things to make that work:

  1. Select /dev/sdb as my boot device in the PC BIOS.
  2. Install openSUSE onto /dev/sdb, making sure ALL (Grub, / root, /home & SWAP all on /dev/sdb) of openSUSE was installed there.
  3. In the openSUSE install section, before I allowed the installation to begin, make sure that /dev/sdb is listed first before /dev/sda other wise the Grub menu and device.map fies will not be constructed properly.

When you install openSUSE and the boot target is Not the first drive, you must make sure the installer knows how it will be when it boots the openSUSE hard disk. This can not be guesed when you boot from a CD or DVD first.

Each hard drive can have up to four PRIMARY partitions, any of which could be marked active and bootable. No matter what you might hear, only one of the first four primary partitions can be booted from. That means you can boot from Primary partitions 1, 2, 3 or 4 and that is all. In order to boot openSUSE, you must load openSUSE and the grub boot loader into one of the first four partitions. Or, your second choice is to load the grub boot loader into the MBR (Master Boot Record) at the start of the disk. The MBR can be blank, like a new disk, it can contain a Windows partition booting code or generic booting code to boot the active partition 1, 2, 3, or 4. Or, as stated before, it can contain the grub boot loader. Why load grub into the MBR then? You do this so that you can “boot” openSUSE from a logical partition, numbered 5 or higher, which is not normally possible. In order to have more than four partitions, one of them (and only one can be assigned as extended) must be a extended partition. It is called an Extended Primary Partition, a container partition, it can be any one of the first four and it can contain one or more logical partitions within. Anytime you see partition numbers 5, 6 or higher for instance, they can only occur inside of the one and only Extended Primary partition you could have.

What does openSUSE want as far as partitions? It needs at minimum a SWAP partition and a “/” partition where all of your software is loaded. Further, it is recommended you create a separate /home partition, which makes it easier to upgrade or reload openSUSE without losing all of your settings. So, that is three more partitions you must add to what you have now. What must you do to load and boot openSUSE from an external hard drive? Number one, you must be able to select your external hard drive as the boot drive in your BIOS setup. Number two, you need to make sure that the external hard drive, perhaps /dev/sdb, is listed as the first hard drive in your grub device.map file and listed as drive hd0. I always suggest that you do not load grub into the MBR, but rather into the openSUSE “/” root primary partition which means a primary number of 1, 2, 3 or 4. If number one is used, then that will be out. You will mark the openSUSE partition as active for booting and finally you must load generic booting code into the MBR so that it will boot the openSUSE partition. I suggest a partition like this:

  1. /dev/sdb, Load MBR with generic booting code
  2. /dev/sdb1, Primary SWAP partition (4 GB)
  3. /dev/sdb2, Primary EXT4 “/” openSUSE Partition Marked Active for booting (60-120 GB)
  4. /dev/sdb3, Primary EXT4 “/home” Your main home directory (Rest of the hard disk)

Thank You,

Ignoring the first drive will depend on the BIOS setup. If you can set the BIOS to boot from USB if present, then that should be possible.

Here’s a guide to installing on a USB drive: SDB:Installation on external hard drive - openSUSE

Note that I have not tested that myself.

Installing openSUSE onto an External Hard drive works like a champ. I use it with my work Laptop and on my second PC at home (loaded with Windows). But, openSUSE does not want to do this by default and users unaware of how this procedure works can very easily and unintentionally write to their main hard drive by accident, not realizing what they are doing. I my first message, I have pointed out just what must be done for this to work and it starts with your BIOS settings and you must follow through with the correct openSUSE installation choices.

Thank You,

OK –

The advice here looks pretty promising…

To point out a couple facts,

Windows is seen as /dev/sda, when in the OpenSUSE installer… Being that /dev/sda contains the FDE bootloader, and /dev/sda1 is the encrypted Windows 7 volume, I know I don’t want to touch that at all…

While in the installer, I did set up /dev/sdb with [swap], /, /boot, and /home… Where things got squirrely: when I’m being asked for where to install the bootloader… Is it safe to say MBR? Will it in fact take /dev/sdb for the MBR location? It’s not easy to pull the first drive out, nor can that be disabled in the bios. I can change the boot order in the BIOS, and as it sits now, when I choose to boot USB drive, it skips through and boots into Windows.

I’ve tried SuperGrubBoot, but it’s hanging on trying to read fd0 - there is no floppy, but it’s hanging there. I’ve read that the media reader can cause that sometimes.

Let me look at this some more, based on the suggestions here.

Thanks all.

As some added info, an external hard drive, never booted from before, will contain nothing in its MBR as it will be blank and it will be skipped over by any BIOS looking for a boot drive until you put something there. When you install openSUSE, its OK to place grub into the MBR and in fact, you must do so on purpose or place generic boot code there else it will not boot at all. The key is to look at the openSUSE installation summary before you begin. You have the sdb drive as first and grub into the MBR and in your BIOS you selected the external hard drive to boot first. So, if that openSUSE Installation summary does not look right, don’t allow the installation to proceed and come here and ask more questions.

Thank You,

The requirement appears to be parallel to mine in http://forums.opensuse.org/english/get-technical-help-here/install-boot-login/465297-installing-suse-11-4-64-bit-external-hard-disk-replace-11-2-64-bit-internal-hard-disk.html.

Just be extra careful to understand the choices/options selected in “booting” section. Check that the USB disc is identified by its identification number as the one to write MBR to!!

PrakashC