Installing openSUSE 13.1 onto an External Hard Drive

Be aware that you need to follow and understand how to direct all openSUSE installation actions to the external hard drive. Failure to follow all instructions may cause modifications to your internal hard drive, defeating the purpose of this written procedure and modifying your main OS installation.

Please read through this procedure more than once to insure full understanding before trying this on your PC.

This write up is written to assist in installing openSUSE, in this case version 13.1, onto an external hard drive. This procedure allows you to dual boot openSUSE with any other OS, such as Windows, without making any changes to your original installation on your first hard drive, normally /dev/sda. In order to boot from an external hard drive, designated as /dev/sdb or higher, you must be able to set the external hard drive as the boot drive in your PC BIOS setup or you will be pressing a function key (F12 on my Dell Laptop) to select the external hard drive to boot from. Be aware if you have more than one external USB hard drive, the function key method may not work as you require, meaning you must select the boot drive from your PC BIOS setup, but only testing this will let your know for sure.

In this example I am using the following items to install openSUSE:

  1. openSUSE 13.1 installation DVD
  2. External USB 2.0 hard drive, 120 GB SSD using MBR format, /dev/sdc on this system
  3. Dell XPS 13 Ultrabook Laptop
  4. External USB 2.0 CD/DVD drive

The installation process is broken up into five steps. The entire installation of openSUSE has more steps, but only those required to direct openSUSE to install onto an external hard drive are being shown. I took pictures of the Laptop screen to show what needs to be done. The pictures are not very good, but hopefully they will be helpful.

Step 1. Partition External Hard Drive:

I used “Create Partition Setup…” for the following three partitions on my External Hard Drive called /dev/sdc.

  1. /dev/sdc MBR formatted w/Generic Boot Code
  2. /dev/sdc1, Primary Partition, SWAP, 4 GB
  3. /dev/sdc2, Primary Partition, EXT4, Active Boot, root /, 52 GB, grub 2 installed
  4. /dev/sdc3, Primary Partition, EXT4, /home, 55.79 GB

Partition sizes are arbitrary here but root / should be 30 GB or more in my opinion. The smaller you make root /, the larger you can make /home, where you store your personnel files. If root / runs out of disk space, openSUSE will not start. I have seen more than one problem report where a root of 20 GB ran out of space. I have never seen a openSUSE installation where root / was larger than 60 GB after installing all required system files. Just use your best judgment here.

Step 2. Boot Loader Settings:

Select only the option of “Boot from root partition” and all other options are not selected. For step 3 you select “Boot Loader Options”. For step 4 you need to select the next step using your mouse of “Boot loader installation details”.

Step 3. Boot Loader Options:

On the Boot Loader Options Screen, you want to check “Set Active Flag in Partition Table for Boot Partition” and “Write Generic Boot Code to MBR”. Just accept the defaults for everything else show on the screen. Consider that a new external hard drive will have a blank MBR and if you fail to “Write Generic Boot Code to MBR” and do everything else right, booting from your external hard drive will fail.

Step 4. Disk Order Settings:

You must make sure that your external hard drive, in this case /dev/sdc, is listed as being first. Failure to get this right can cause you to write the grub 2 boot loader to the wrong hard drive. For some reason the UP fuction did not work and only the DOWN fuction seem to work for me to make sure /dev/sdc is listed first.

Step 5. The Installation Summary:

The Booting Section should confirm you have everything right to install all of openSUSE to your external hard drive. We can see that …

Boot Loader Type: GRUB2
Status Location: /dev/sdc2 ("/")
Change Location:
Boot From MBR is disabled
Boot From “/” is enabled
Order of Hard Disks: /dev/sdc, /dev/sda, /dev/sdb, /dev/sdd

Status Location indicates where the Grub boot loader is installed, which is the root “/” partition for this procedure to work. Peviously we have already elected to install generic boot code into the MBR. The number of hard drives may only be only a couple using /dev/sda and /dev/sdb on your system. When the installation summary is correct, we know we will be only installing openSUSE on our external hard drive and our internal hard drive /dev/sda will not be modified in any way and we may allow the installation of openSUSE to proceed.

If you have any questions or comments, please let me know.

Thank You,

Thanks! I had left off the checkbox to copy to the MBR and my first attempt didn’t boot. Now it boots fast off an external drive connected to USB 3.0. I feel like I owe you a beer!

Greg

[QUOTE=gmesser57;bt963]Thanks! I had left off the checkbox to copy to the MBR and my first attempt didn’t boot. Now it boots fast off an external drive connected to USB 3.0. I feel like I owe you a beer!

Greg[/QUOTE]

I am very happy to hear of your success. The beer sounds good should you ever make it to Austin, Texas. But really I do this because I enjoy helping others and you learn the subject even better.

Thank You,

Great tutorial, thinking of installing opensuse on my 32 gig flash drive, as i learn my way round it.

Hi, JD:

If you wish to post actual screenshots here (or when you do a future install tutorial), I have copied this from some other forum member and have used it myself a few times. I would provide the link instead, but I no longer have that at my disposal.

INSTALLATION SCREENSHOTS:

Mount filesystem

You need access to some kind of filesystem to be able to save the screenshots - if you plan to format your entire harddisk during installation it’s not recommended to use this filesystem of course. This example uses a floppy disk, you can use any filesystem however, i.e. usb-key, harddisk partition that will not be overwritten or others.

When the YaST graphical installer starts, press Ctrl + Alt + F2 - this will provide you with a root terminal.

If device is ext (Linux), Enter the following command:
	mount /dev/sdx /media/

If device is vfat (FAT32), Enter the following command:
	mount -t vfat /dev/sdX /media/

If device is NTFS, Enter the following command:
	mount -t ntfs-3g /dev/sdX /media/

Note: You need to replace /dev/sdx to match the filesystem you want to mount

Your flash disk might be sdb. you can check it out using "fdisk -l" command, then judge by size, or mount them one by one, "cd" into them, judge by checking files inside using "ls" command.

	Note:Most of our flash disks are formated by Microsoft's NTFS or FAT partition format instead of Linux partition formats, so the mount command you may use in reality is: mount -t ntfs-3g /dev/fdX /media/ (NTFS) or mount -t vfat /dev/fdX /media/ (FAT32); and the mount point isn't /dev/fdX either(floppy disk is 1990s). Here's the simple Linux rule: floppy is prefixed by fd*;CD/DVD-ROM is prefixed by sr*, so if you use a writable CD it'll be sr0(not possible unless you install using USB, or sr0 will be your openSUSE DVD!);Harddisk is prefixed by sd*, so your local partition wanna use might be sda2 and your flash disk might be sdb. you can check it out using "fdisk -l" command, then judge by size, or mount them one by one, "cd" into them, judge by checking files inside using "ls" command.

Press Ctrl + Alt + F7 to return to the graphical installer. 

Make the screenshots

Now all you have to do is press Print Screen.

A file dialog will appear asking you where to save the screenshot - save it to the location where you mounted the filesystem - in this case /media/ 

You will have to navigate to that location (in this case /media/) for each screenshot and only the active window is captured.

During the Package Installation part of installation you're only allowed to make screenshots if certain objects are in focus - hit Tab and Print Screen alternately a couple of times and you should be all right.


The screenshots are saved in PNG format.

Unmount the filesystem

When you’re done taking screenshots or before ending the installation you should unmount the filesystem to ensure all data is actually written to the filesystem.

Hit Ctrl+ Alt+ F2 to go to the virtual terminal. Enter the following command:
	umount /media/

Notice that you cannot unmount the directory you’re currently located in - so if you’re in /media/ use the command cd to navigate to some other location before unmounting.