Installing openSUSE 12.1 on a Flash Drive

Hi All :slight_smile:
I am new to these forums, and to openSUSE,(I have had a little experience with Ubuntu) and after a very long time of going back and forth between distributions, I have chosen openSUSE. I apologize if this is mentioned on the wiki, or has already been asked and mentioned on the forums, but I couldn’t find anything, so here goes:

I use an HP laptop with Windows 7. It came with Windows 7, and I am not ready to give it up.(Sorry, I know you guys probably hate hearing this, but I have responsibilities with my computer and can’t afford any major complications. I could probably survive a day or two, but not any more then that.)
Do to security reasons, I would like install openSUSE on a flash drive so that if the flash drive isn’t in the computer, it won’t boot up. I put openSUSE Live KDE on another flash drive, booted it up, and began the installer. I then chose the flash drive that I want to install openSUSE on as the Hard disk. (I hope I am explaining this right, sorry if I am not) So if I chose the flash drive as my hard drive, will it still dual-boot with my Windows OS? So basically when I start my computer, I will have an option for openSUSE or Windows 7. If I chose openSUSE with the flash drive in my computer, it will boot up. If it isn’t, then I will get an error. Or I can choose Windows 7 when I start my computer. Any input is greatly appreciated!!! Thanks!!!

If I understand you correctly. You think having openSUSE installed on a flash drive is going to secure your Laptop?

Does the Laptop have a optical drive?

A caveat. Flash drive are not very good devices for a OS to live on. They use flash memory and flash memory ware out. So don’t expect a long life. In SSD’s there are spared memory locations that are used to replace burned up memory location and there are special internal routines that do ware leveling. Not so on a cheap Flash stick.

That said you might want to read this: SDB:Live USB stick - openSUSE
Note that this is dated but I think the basics should apply.

Hi,
Thanks for the quick reply. Yes, the laptop does have an optical drive. The question that I am trying to ask (Sorry if it wasn’t clear) is that when openSUSE asks which hard disk to install on, and I choose my flash drive, will it still dual boot my computer, and give me an option for openSUSE, and Windows 7 when I boot up my computer?

Maybe if you really understand how booting works you could make it work. But you are putting your system at risk. Try the instruction I Posted above. Not don’t know if it works with 12.1 but it is a lot safer then want you want to try.

Only if you actually know what you are doing. You could easily mess it up.
Wouldn’t it be easier just to set a BIOS password?

Pardon me if I am being simple-minded, but it sounds like all he needs to do is get flash drive set up with openSuSE. If he takes it out, he will boot to windows. Can’t he create a persistent partition on his hard drive to keep docs etc. without installing opensuse at all?

It sounds to me like he wants openSUSE on a USB device to control all booting. Without the USB nothing will boot.

Hey Guys! Thanks for your input! Actually, prexy is right.

This is what I want to do. I’m sorry if I wasn’t clear. During my little experience with Ubuntu, I dual-booted with windows. When I turned the computer on, it asked if I wanted Ubuntu, or Windows. I later deleted the Ubuntu installation, but the MBR still showed Ubuntu. If I choose Ubuntu, it wouldn’t boot up. This is what I want to do. Dual-boot with openSUSE, so that when I boot up my computer it asks if I want to boot up into Windows or openSUSE. However, if the flash drive isn’t in my computer, openSUSE won’t boot up, but windows will still boot up. If the flash drive is in my computer, openSUSE will boot up.

Ok, I can see that my original question is a little confusing. For that, I apologize. I will attempt to ask it again in less words.

I want to dual-boot with Windows 7. When openSUSE asks where to install, and I choose a flash drive, will it still dual-boot? Or is there a special setting to make it dual-boot? Thanks!

Technically it’s possible I think, though I have never tried it.
You would have to be sure to write all the grub boot code to the USB and nothing to the MBR of sda

Hi HamRadio,

First, yes, you can install openSUSE on a flash drive. However, as the colleagues said, these drives are not reliable. So, although technically possible, it’s not generally a good idea to use these drives to host an operating system. Another aspect to consider is that flash drives have a much lower read/write transference rate (i.e., are too slow). In fact, some cheaper flash drives are so prohibitively slow, that you’ll give up even before finishing the installation, let alone run the system later. If you happen to have a USB 3.0 port, you could buy a USB 3.0 flash drive (like this: http://www.amazon.co.uk/Kingston-Ultimate-16g-USB-Datatraveller/dp/B0041G2YP8), which will be faster, but not necessarily more reliable. You can also install openSUSE in an external hard drive, which is both more reliable and faster than flash drives, specially if you use eSATA or USB 3.0 interface (if you happen to have these ports in your computer).

Second, yes, you can install the boot loader (a small and smart program called GRUB) on the flash drive. If the USB takes precedence over the internal hard drive on the boot order (as configured in the BIOS of your computer), then GRUB will load and will display a menu with whatever you want, including Windows and or other system that may be present in your internal hard drive and/or on the flash drive itself.

If you still want to install on the flash drive, then the question is “how?”. You have to do the following (I hope I remember correctly):

  1. Begin the installation as usual;

  2. When you reach the screen “Suggested partitioning”, click on “Edit partition setup”, then on “Rescan devices”, so that it clears its suggestions and you can play with your settings. Your USB flash drive is probably going to be /dev/sdb, and it will probably contain just 1 partition, /dev/sdb1, which is probably formatted as FAT. What you have to do is delete this partition of the flash drive [BE CAREFUL NOT TO DELETE THE WINDOWS PARTITION ON YOUR HARD DRIVE!], and create at least 2 others, one for the file system, another for swap (see more comments on this below). You have to choose the sizes according to the capacity of the drive you have and the amount of applications you are putting on it. I suggest you use a flash drive with at least 8 GB, leaving between 2 to 4 GB of swap and between 4 to 6 GB for files. As mount point, use “/” for the partition that will contain openSUSE and your files. There are other ways to partition, like using /home and/or /boot in separate. This is generally a good idea, so think about it and decide what you think is better for you. But, again, BE CAREFUL when saving changes so that you don’t lose the data you have in the Windows partition;

  3. When you reach the screen “Installation Settings” you’ll see a summary of what is going to be done in your system. Here it comes another crucial step. Click on “Booting”. In the screen that appears, there is a big button in the lower part of the screen. I can’t recall what is the name of the button. Click on it. In the screen that appears, you’ll see a list containing probably /dev/sda as the first item, then /dev/sdb as the second item. You MUST change the order so that /dev/sdb is either the first or the only item in the list. You can safely remove /dev/sda from this list. The first item on this list is where the boot loader will be installed and, from what you explained, you want it on the flash drive. So, make sure /dev/sda is not the first. Confirm the change on this screen, which will send you back to the previous. Confirm again (or change items if you want to), and you’ll be back to the “Installation Summary”;

  4. Double check carefully again that you are NOT going to mess with the Windows partition, then click “Install”. Confirm again, and wait. Wait a lot. Prepare some coffee, go watch the grass grow and, depending of the speed of your flash drive, many hours later, come back to continue with the rest of the installation, i.e., configuring hardware, network, etc.

Honestly, I wouldn’t spend time with this. I personally installed on a flash drive (minimal install only, no graphics) and the reason was solely to help the installation to the internal hard drive in non-usual circumstances. The installation was very slow. If it helps you, I posted yesterday the steps in my blog. The link is this: Installing Linux in a file in an NTFS partition | Brainder.

Hope it helps.

Regards,

amwink

PS: I forgot to comment about the swap. Swap is not mandatory in principle, and the system should run just fine without it as long as you have enough RAM. However, I observed that, for whatever reason, Firefox runs very slowly in openSUSE if there is no swap.

In any case, even if you leave just 1 partition in your USB flash drive for everything (a big /), you can always configure later the swap space as a file (use the command dd to create the file of the size you want, mkswap to format it properly, then swapon to activate it). Swap on the flash drive (either as a partition or a file) won’t be fast at all, though…