LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 07-11-2010, 04:25 PM   #1
gusblake
LQ Newbie
 
Registered: Feb 2010
Posts: 24

Rep: Reputation: 15
Creating linux persistent bootable USB drive from iso


Hi,

I am trying to install Linux (the distros I have attempted it with are Arch, Fedora, Ubuntu and Mint) on a USB drive and make it work like a removable hard drive, keeping programs and settings.

I tried it manually at first, partitioning the drive with Fedora's "Disk Utility" and dd'ing a Fedora 13 iso over.

I should note here that I have definitely configured the BIOS correctly, enabled booting from removable media and set it as the default with all other devices disabled, but that I have never actually booted from USB before with this motherboard.

On bootup I got

Code:
DISK BOOT FAILURE, INSERT SYSTEM DISK AND PRESS ENTER
I then tried it with Ubuntu 10 and Ubuntu's "usb-creator". This was apparently successful, but on bootup I got:

Code:
missing operating system
DISK BOOT FAILURE, INSERT SYSTEM DISK AND PRESS ENTER
I downloaded UNetBootIn, but the application kept saying I needed "p7zip-full", which I couldn't find anywhere.

I then got Fedora liveusb-creator, but whichever iso I give it I get this error:

Code:
Unable to find LiveOS on ISO
I looked at the source code and it seems to be looking for a directory named LiveOS on the iso containing the files "squashfs.img" and "osmin.img"

Here is the code (usr/lib/python2.6/site-packages/liveusb/creator.py, line 575):

Code:
...

    def extract_iso(self):
        """ Extract self.iso to self.dest """
        self.log.info(_("Extracting live image to USB device..."))
        tmpdir = tempfile.mkdtemp()
        self.popen('mount -o loop,ro "%s" %s' % (self.iso, tmpdir))
        tmpliveos = os.path.join(tmpdir, 'LiveOS')
        try:
            if not os.path.isdir(tmpliveos):
                raise LiveUSBError(_("Unable to find LiveOS on ISO"))
            liveos = os.path.join(self.dest, 'LiveOS')
            if not os.path.exists(liveos):
                os.mkdir(liveos)
            for img in ('squashfs.img', 'osmin.img'):
                start = datetime.now()
                self.popen("cp %s '%s'" % (os.path.join(tmpliveos, img),
                                           os.path.join(liveos, img)))

...
I couldn't find much about what LiveOS actually means and why I need it to create a bootable USB, so if anyone could tell me more about this that would be great. Is this (the .img files) the only thing distinguishing a "Live" OS from a non-Live one? I looked in my Ubuntu live CD and there was no such directory, but it works perfectly well.

In case it would make a difference, the stick is 8GB and branded duracell, not sure what manufacturer it is.

Cheers,
Gus
 
Old 07-11-2010, 05:03 PM   #2
tredegar
Guru
 
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 6,007

Rep: Reputation: 366Reputation: 366Reputation: 366Reputation: 366
Looks like your MoBo doesn't support booting from USB. Many older ones do not.

You provided no details of your MoBo.

Is there such an option in your BIOS?
 
Old 07-11-2010, 05:30 PM   #3
gammahermit
Member
 
Registered: Apr 2010
Distribution: Debian
Posts: 39

Rep: Reputation: 4
Well you need to use a distribution that meant to be installed on a flash drive. There are a lot of them around now. I'm not really sure what you are trying to do with it. If you just want a standard distro that boots off of a flash drive then knoppix, puppy linux, & damn small linux are good choices and I'm pretty sure all of those can be installed to a flash drive. How big is your flash drive? Knoppix is pretty big so you will need a large drive for it. But the other two will install on just about any flash drive.

Also just an fyi. Doing a direct copy of an iso to a flash drive won't work. The iso is a cd/dvd filesystem image so it won't be bootable. For most of the live cd, you download the iso image mount it then copy the contents to the flash drive and run syslinux on that drive to make it bootable. There will be specific instructions on how to install it on the distros site.
 
Old 07-12-2010, 04:57 AM   #4
gusblake
LQ Newbie
 
Registered: Feb 2010
Posts: 24

Original Poster
Rep: Reputation: 15
tredegar; the motherboard is an Asus A8N-SLI Deluxe with BIOS revision 1016. The boot priority menu has a "Removable" option, which I am assuming means USB drives.

gammahermit; thanks for the info, I will look into those distros. Apparently both Ubuntu 9.10 and 10.04 can be installed on USB sticks using the usb-creator utility.

What I am aiming for is to have a permanent operating system installed on the stick so I can use it in any computer that supports booting from USB, and have it keep my programs and settings across reboots ("persistence").

Cheers,
Gus

Edit - according to the Arch beginner's guide, it is possible to make a bootable USB from the ISO using dd:

Quote:
Insert an empty or expendable USB stick, determine its path, and write the .iso to the USB stick with the /bin/dd program:

Code:
dd if=archlinux-2010.05-{core|netinstall}-{i686|x86_64|dual}.iso of=/dev/sdx

Last edited by gusblake; 07-12-2010 at 06:53 AM.
 
Old 07-12-2010, 08:43 AM   #5
tredegar
Guru
 
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 6,007

Rep: Reputation: 366Reputation: 366Reputation: 366Reputation: 366
OK, it can boot from USB.

Easiest way for me to get an ISO onto a USB stick, and make it boot, and have some space on the stick for "documents & settings" [Ie a portable, bootable linux] was to use an ubuntu live CD of 10.04.

In BIOS set boot order as
1] Removable device(s)
2] CD ROM
3] HDD

Boot to ubuntu CD (try it live)
Plug in your USB stick
System - Administration - Startup disk Creator

Source Drive of disk image (ISO) ... Click other and navigate to the ISO file (in my case this was on external USB HDD). Select it.

Then select your USB stick as "Disk to use". Be very careful that you are selecting the right device, because it will be wiped!

Give yourself some space on the USB stick for storing "Documents & Settings". How much you can allocate depends on the size of your USB stick, but I don't think it can be more than the maximum size of a single file on a FAT32 partition (4GB??)

Click "Make startup disk".

Shut down ubuntu live. Leave the USB stick in, remove the live CD.

Reboot and the ISO on the USB stick should be booted.

It worked for me

Last edited by tredegar; 07-12-2010 at 08:44 AM. Reason: typo
 
Old 07-12-2010, 09:06 AM   #6
linus72
Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,057

Rep: Reputation: 328Reputation: 328Reputation: 328Reputation: 328
Hello gusblake

you actually dont need Unetbootin, usb-creator, etc
except in some circun=mstances

1) Plop bootmanager executable can boot usb, usb-cdroms, etc
on PC's that can or cannot boot usb as it bypasses bios.
Do you have Grub installed on your PC?

all the distro's run somewhat differently in "frugal" mode
frugal mode is basically the livecd compressed read-only media
as opposed to a hard drive install wherein the filesystem is decompressed.

Examples include Debian Live, Ubuntu, etc
all of them have different types of how they do persistence

With Debian Live for instance; the persistent file "live-rw" or labeled partition
must not be on the same partition your booting Debian Live from

In contrast is Ubuntu, which uses the "casper-rw" file or labeled partition;
the file can be on any fat32 partition including the one it boots from
while it cannot save to a casper-rw file on ext2/ext3
and ubuntu can boot fromiso too

Slax and its derivatives can save almost anywhere and to both files, and a persistent partition

Again, Puppy Linux saves to a file of whatever size, or to a partition
similar to Slax.

So, heres an example 8GB USB with fat32 as first partition
setup with Ubuntu, Debian Live, Fedora*, a Slax derivative**
and Puppy

Example USB is sdb

sdb1 fat32 boot flag "on", syslinux installed
contains
Fedora+ persistent overlay
Ubuntu+casper-rw
Debian
Slax derivative
Puppy

sdb2 ext3 (contains Debian "live-rw" file, Slax* "slaxsave.dat" file, Puppy "pup_save" file of whatever sizes...

*With Fedora I believe only Fedora's usb-creator can creat the persistent overlay

**Slax derivatives include
SlaxRemix07 (Slackware 13.1 based) http://www.slax.org/forum.php?action...parentID=62815

my own nFluxOS based on Slackware current
http://multidistro.com/

So, i will tell you how to get it all running but need to make sure
your interested as it can be a lengthy tutorial involving multiple OS'?
 
1 members found this post helpful.
Old 07-12-2010, 06:00 PM   #7
jefro
Guru
 
Registered: Mar 2008
Posts: 11,086

Rep: Reputation: 1362Reputation: 1362Reputation: 1362Reputation: 1362Reputation: 1362Reputation: 1362Reputation: 1362Reputation: 1362Reputation: 1362Reputation: 1362
I'd say one of two issues. One is you have to use HP's tools to get usb drive bootable. Otherwise your system isn't seeing this as a usb device but a real hard drive.

Stat at bios from a cold boot. See where in boot order the usb shows up.


Also see pendrivelinux.com for how to's on making flash drives and how to add in persistence on those that are difficult like mint. I had to play with mine for a while.

Also test your build on more than one system.
 
Old 09-22-2010, 04:43 PM   #8
TheDerf
LQ Newbie
 
Registered: Feb 2009
Posts: 9

Rep: Reputation: 0
Quote:
Originally Posted by gusblake View Post
Hi,

I am trying to install Linux (the distros I have attempted it with are Arch, Fedora, Ubuntu and Mint) on a USB drive and make it work like a removable hard drive, keeping programs and settings.

I tried it manually at first, partitioning the drive with Fedora's "Disk Utility" and dd'ing a Fedora 13 iso over.

I should note here that I have definitely configured the BIOS correctly, enabled booting from removable media and set it as the default with all other devices disabled, but that I have never actually booted from USB before with this motherboard.

On bootup I got

Code:
DISK BOOT FAILURE, INSERT SYSTEM DISK AND PRESS ENTER
I then tried it with Ubuntu 10 and Ubuntu's "usb-creator". This was apparently successful, but on bootup I got:

Code:
missing operating system
DISK BOOT FAILURE, INSERT SYSTEM DISK AND PRESS ENTER
I downloaded UNetBootIn, but the application kept saying I needed "p7zip-full", which I couldn't find anywhere.

I then got Fedora liveusb-creator, but whichever iso I give it I get this error:

Code:
Unable to find LiveOS on ISO
I looked at the source code and it seems to be looking for a directory named LiveOS on the iso containing the files "squashfs.img" and "osmin.img"
i've had the same problem. I was wondering if you had found a solution. the Plop bootmanager seems nifty but i'd rather find a simpler solution.
 
Old 12-12-2010, 08:14 AM   #9
changcheh
Member
 
Registered: Nov 2003
Location: china
Distribution: Linux Mint
Posts: 49

Rep: Reputation: 15
Persistent boot with ubuntu based distros

Unetbootin install to 8GB flash drive persistent


Started Fdisk, because gparted - creates gpt partition tables, which is a problem for windows, if u want to see your files on there

Created 4 partitions:
+4400M (this is for files on fat partition which will be visible to windows), toggle file type with t, then b
+1010M (this is for Linux mint) toggle bootable with a, toggle file type with t, then b
+1050M (this will be labelled as casper-rw later) leave as linux filetype
+default that's left (this will be labelled as home-rw later) leave as linux filetype
left about 3MB at end


Set disk labels - only works for ext formatted disks:
sudo e2label /dev/sdb3 casper-rw
sudo e2label /dev/sdb4 home-rw


Format partitions:
sudo mkfs.msdos /dev/sdb1
sudo mkfs.msdos /dev/sdb2
sudo mkfs.ext4 /dev/sdb3
sudo mkfs.ext4 /dev/sdb4


Installing Linux
Started Unetbootin
Installed to /dev/sdb2
Then opened syslinux.cfg in /dev/sdb2
Added "persistent" as shown below:
append initrd=/ubninit file=/cdrom/preseed/ubuntu.seed boot=casper quiet splash persistent

This allows you to save files, install programs, change settings and have everything saved. If you need to have some cross-platform portability, the first partition is a FAT one, which is readable by windows, the others are NOT. Also, only the first partition on any flash disk will be viewable by windows.

John
 
  


Reply

Tags
bootable, iso, persistent, usb


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
creating windows 7 bootable usb from linux endertux Linux - Software 17 01-23-2014 08:30 PM
Need help creating Acer Aspire One bootable USB thumb drive tkilbride Linux - Laptop and Netbook 22 04-03-2011 09:52 AM
Hello :) I'm new to Linux and I'm trying out a Persistent Bootable Ubuntu USB Drive! nate_rio LinuxQuestions.org Member Intro 0 04-30-2010 04:23 PM
Create Bootable Simply Mepis USB drive from CD ISO duryodhan MEPIS 0 11-16-2006 11:23 PM
creating a bootable usb thumb drive tlarkin Linux - Software 13 02-21-2006 06:39 AM


All times are GMT -5. The time now is 05:00 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration