Linux install on portable (usb) harddrive....

Archives Forums/Linux Discussion/Linux install on portable (usb) harddrive....

Tricky(Posted 2011) [#1]
Hi guys;

I'm in need of a full Linux install, so no "Live" versions and also not running from emulators, virual machines or any other things like that, but it has to run on a computer in which I am NOT allowed to change anything on the local drives, so basically it has to run from a portable device, and I guess a portable harddrive will have to do the trick.

For now I chose Ubuntu as the distro to do this. Basically because I don't need that much to do, and as Ubuntu is the most popular distro I can at least make sure most utilities have full support on it.



First I made a test on my wife's computer with Wubi. Wubi did get Linux running on my wife's PC, all on a portable harddrive, and I can install software and make preference changes and so on which all get saved (so not all back in the default settings like in Live versions), but the little menu in which you choose if you want to use Windows or Linux (in this case "Ubuntu") has been written on my wife's bootsector and not on the portable drive. All nice and cool and on my wife's PC not a problem as she doesn't mind as long as she can keep on using Windows, but on the PC it actually has to run on even that change is forbidden, making the Wubi experiment a failure despite Ubuntu running (almost) perfectly.
The system will have to boot from the portable device and from nothing else.


That leaves me one final thing to try out, but as I am not sure if it's actually possible, and also since it may require me to buy a new portable harddrive (and I'm not exactly rich) and due to the fact that I'm afraid destroying the PCs own Windows installation (especially that one may catch me major hell) I first need to figure a few things out before I even begin on it, and I wanted to ask you if it's first of all even possible (most likely if the Ubuntu setup utility detects the portable HD and gives it up as a device to install to) but as I don't want to accidentally kill the original OS and since I am not quite sure about the names Linux gives for drives in this stage. Second of all does it matter from which computer I install Ubuntu. In other words, if I install Ubuntu on that device from my wife's PC will it work correctly from that device on the PC I actually have to work on. As there are actually two PCs I *may* need it on (one for sure and the other might be possible in the future) I'd be glad if I could do that.

If this all were possible I'd be glad.
Seeing the open-source/GPL setting of Linux (and thus also Ubuntu), I'd guess it must all be possible, right?


Yasha(Posted 2011) [#2]
if I install Ubuntu on that device from my wife's PC will it work correctly from that device on the PC I actually have to work on


Probably not. I tried this once and got yelled at by someone who knew what they were doing. Most likely the work PC simply won't do anything, but you might cause problems for your wife's one.

Why can't you use a Live version or a virtual machine? Both of those count as full installs in so far as everything is present and usable.

- You can have persistent storage for a Live USB, if that's the problem - you allocate it when you're creating the bootable USB drive.
- Startup is slow but small programs should load pretty quickly once the OS is loaded.

- Virtual machines are actually pretty fast (about as fast as native) if you're not doing 3D work; if you are doing 3D work, you need VirtualBox or VMware, but it can still be done.
- Virtual machines are 100% portable.


Winni(Posted 2011) [#3]
This will help you: http://www.pendrivelinux.com/universal-usb-installer-easy-as-1-2-3/


xlsior(Posted 2011) [#4]
The few times I installed an OS on a drive that I wish to keep independent of the system it's in, I made sure to unplug the other drives before starting the install -- that way it will only write the boot stuff to the (external) drive being used, and NOT to the primary drive in the system.

Works like a charm, only 'drawback' (if you can call it that) is that the system won't prompt you with the alternate OS on a normal bootup, but you have to explicitly tell the system to boot from that particular drive when you start the PC (either by altering the boot order in the BIOS, or by hitting a hotkey upon startup and speifying the drive to boot from)


Tricky(Posted 2011) [#5]
@Yasha
Well, when it comes why not virtual machines is basically because the computer I have to use is a Windows install which is basically sealed of from all programs the owner doesn't approve of and he's not willing to give me any space here and even if I could get it all to work, the system removes everything anyway to bring back the original settings and file system, not to mention the fact that I already hate Windows, and he found ways to make it worse, I never believed that was possible. He did allow me to use Linux as long as I wouldn't spook up anything in the original Windows install. Telling him he denies me to do what I have to is almost as interesting as trying to teach a dog to read... cut short senseless. That's when you work at a spot where you have a chief totally unaware of what he's doing. I was just hoping that Linux on an USB device would just help me get around that so that the boss can do what he likes, but that it doesn't spook up my work.
Yeah, he's an idiot, you don't have to tell me that.

Plus virtual machines are fast today I know, but as I need to avoid that kind of OS abuse that is practised there I will be confronted with all its flaws anyway when using a virtual machine making that option pretty much useless to solve my problem.

And Live is out of the question. I have to make adeptions to preferrences and stuf like that and Live versions store that on a RAM drive. In order words it ceases to exist as soon as you restart.

@xlsior
Yeah unplugging also came to my mind, but I got a problem there too. As we had an issue before that ALL computers were stolen all of them are now nailed to their place and they cannot be removed or opened without a key and guess who maintains that key? Yup, the same guy I mentioned before. Not a big help. But thanks for the suggestion anyways ;)
I would certainly have done that if there weren't any locks on those machines. Then again, I agree they are on it after that big theft issue.

Yeah, I know I got to use the bios-boot-menu (or whatever it is) to get it all running, but your post makes at least clear to me that it is possible and that means I can turn over to action into this matter.



@Winni
Thanks for the link, but.... er.... Is that a true install or only a Live version?


===

Anyway thanks a lot your posts did (despite a few issues I have here) enlight me a lot and I can now try out a few things here. I am fortunate in one thing. The guy who currently maintains the system back up for the machine I gotta work on is NOT the moron I mentioned before, so if I mess up any damage is very quickly repaired XD


Tricky(Posted 2011) [#6]
Okay;

Well, I've tried this it works.... until.... the reboot.....

The good news is, the Windows Harddrive was untouched as it was supposed to be, so nobody will ever be the wiser Ubuntu was ever installed using that computer.

The bad news is.... When I run Ubuntu from my protable USB drive then I get
Error: No such partition
grub rescue>_


Well, all I know about grub is that it's part of Ubuntu so at least I know it tries to boot a Linux install, but for the rest I'm completely in the dark here. Tried to run from my Live USB stick and used Disk Utility on that USB drive on all partitions they are all reported as "clean". I did check out the Linux boot partition from the File Finder or Explorer or whatever that's called in Linux, and I can see that Linux has all been installed, it even imported the files I had in my personal Windows folder and that is all perfect. So I really don't understand why that error pops up, or even better what I can do to make that error go away.

My first thought is to destroy that partition and to install it again from scratch, but I'm not quite sure if such a drastic measure is necessary. Well time shortage didn't allow me to go down that route yet, and I'll have to week till Monday till I can try it again, but I'm just wondering if there isn't a quicker way to get this fixed.


Winni(Posted 2011) [#7]
@Winni
Thanks for the link, but.... er.... Is that a true install or only a Live version?


PendriveLinux creates a USB stick from a Linux Live CD Images, BUT it gives you the option to create space on the USB stick where Linux can permanently safe changes. From the sound of it, this appears to be what you want to do and going the Pendrive Linux route will probably safe you a lot of headaches.

Your Grub problem:

Well, I'm afraid you will have to study and understand this documentation:
http://www.gnu.org/software/grub/manual/grub.html

I don't know what you did, but my guess is that Grub's partition and hard disk information is no longer valid - which is not surprising when you install it on an external hard disk and then move to a different computer with a different hardware configuration. You can manually provide the correct information on the Grub prompt, of course, but it's not necessarily "sexy". I hate messing around with boot loaders and avoid it as much as possible, so I really can't help you much here.

Which leads me back to my original point: Try using Linux on a large enough USB stick, this will probably be the only painless option.


Tricky(Posted 2011) [#8]
PendriveLinux creates a USB stick from a Linux Live CD Images, BUT it gives you the option to create space on the USB stick where Linux can permanently safe changes. From the sound of it, this appears to be what you want to do and going the Pendrive Linux route will probably safe you a lot of headaches.


Ok, I'll look into that solution. Sounds indeed like a good one.


I don't know what you did, but my guess is that Grub's partition and hard disk information is no longer valid - which is not surprising when you install it on an external hard disk and then move to a different computer with a different hardware configuration. You can manually provide the correct information on the Grub prompt, of course, but it's not necessarily "sexy". I hate messing around with boot loaders and avoid it as much as possible, so I really can't help you much here.

To prevent misunderstanding, both installation and the error occurred on the same computer. I haven't yet tried anything on another one.

I'll look into the Pendrive solution, if that really provides me the situation you picture, I think that will be a very fine solution indeed.


Yasha(Posted 2011) [#9]
By the way, that's the same thing I was referring to as "persistent storage" earlier. Sorry I wasn't clearer...


Tricky(Posted 2011) [#10]
Ah... That's okay, sorry that I took you wrong there :)
Most likely it'll be Monday when i can try out if your suggestions work.
I'll let ya know if this was successful :)


Tricky(Posted 2011) [#11]
Well.... I got it working at last.

Thanks a lot guys.... ;)