installation - Install linux to USB flash drive - "normal" not "live"

11
2013-09
  • František Žiačik

    Is it possible to install linux to USB flash drive so that I can

    1. install further software in it? I mean
    2. use my harddrive as /home

    I know ho to create a live-usb, but it leaves me with read-only filesystem which I can't update with new software (or security updates). Also I know I can have a persistent /home storage on the flashdisk, but I'd like to have it on my harddrive as if I booted from it.

    Please comment if I was unclear about my concern.

  • Answers
  • TheCompWiz

    absolutely. In most cases (depending on your linux of choice) you can simply boot off of a live CD and do a full install directly to your thumb-drive. You will probably be required to format your pen-drive in ext2/3/4 prior to installing, but still should be doable. The trick will be finding out if your bios will support booting from the thumb-drive.

  • Journeyman Geek

    You can - as long as you have a suitably large USB key - with ubuntu, for example, i used a customised build on a 4 gb key, so, you'd need at LEAST that much. I'd also suggest running the clean-up (apt-get autoclean and apt-get autoremove on debian derivatives) function on your package manager often, since many of them keep downloaded packages cached, and that's NOT useful on a small sized system.

    Set the system to mount the hard drive at boot by editing fstab.

    The home drive is a little trickier - If you want linux to 'share' the drive with another OS to me, the 'sanest' way to do it would be to do a standard install and symlinks - since normally you're expected to mount /home to a partition. Else, simply set the hard drive as /home at install, or edit fstab at a later point.

    If you're going to use symlinks, i suggest doing it with the directory that the package manager downloads packages to (see a trend?) as well.


  • Related Question

    boot - Ubuntu live CD and installing new applications onto a USB drive
  • bikesandcode

    Background: I am a programmer that occasionally has access to other computers when on vacation or something. These are generally the machines of friends or family, so randomly installing Ubuntu on it wouldn't be terribly polite. I would like to completely avoid the hard drive of the target machine.

    Not all of these machines can boot to USB either, so that simple solution is out.

    What I want to be able to do is boot to an Ubuntu live CD, plug in a USB drive and then grab various updates and other applications, installing them to the USB drive.

    Later, on another machine, put in the live CD, after boot, put in the USB drive and then magic, I have all of the updates/applications/data/etc that I've tossed onto the drive.

    I suspect that it should be possible to mount /home, /var, /usr, and maybe a couple of other locations from the USB drive or something along those lines.

    So is this possible and what do I need to do?


  • Related Answers
  • quack quixote

    It is absolutely possible.

    The mechanism built into Ubuntu is available. Basically, use the usb-creator tool or LiveUSB Creator (available once you've booted the LiveCD) to create a LiveUSB system on the USB stick.

    Here's an install-it-from-Windows tutorial.

    There are lots of posts on the Ubuntu forums about persistence; you'll want to check there in your research. These posts seem particularly useful with 9.04:

    • installing on a 16gb

    • This post suggests (while using the LiveUSB Creator) just "created one without any persistence space, then manually created an EXT2 partition labelled 'casper-rw' and on boot-up I had a system with persistence"

    If the system you're on can boot from USB, that's all you need. If not, then use the LiveCD or build yourself a boot floppy (ha! -- tho you can probably build a boot CD instead of a floppy...).

    Hope that helps!