Creating linux persistent bootable USB drive from iso
Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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.
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.
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:
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
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
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.
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.
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.