Boot and Run Ubuntu from a Flash Drive by TechnoGeek95

Step 5: Install Ubuntu to the Flash Drive

Now that you have finished formatting the drive, you can now install Ubuntu onto the flash drive partitions.

1. Insert flash drive.

2. Open Terminal.

3. Type "apt-get update".

4. Go to Ubuntu Packages and download Mtools and install. Afterward, download Syslinux and install.

5. In terminal, type "syslinux -sf /dev/sdb1".

6. Type "cd /cdrom"

7. Type "cp -rf casper disctree dists install pics pool preseed .disk isolinux/* md5sum.txt README.diskdefines ubuntu.ico casper/vmlinuz casper/initrd.gz /media/Ubuntu/".
  • Ignore any "cannot create symbolic link" errors.

8. Go to first partition of the first flash drive and rename "isolinux.cfg" to "syslinux.cfg".

9. Edit "syslinux.cfg" so that it looks like the attached text file.

Finally... You are done!
 
Remove these adsRemove these ads by Signing Up
leon-geyer says: May 3, 2012. 7:44 AM
Just for people who has problems like mine
I am installing from a Netbook already with Ubuntu on it. So no CD-Drive.
Using a downloaded Ubuntu.iso (10 LTS), and had this "can not stat" = didn't find original files to copy.

I figured out: Mount and uncompress files, then drag the folder into the terminal to have the path (like user/home/desktop/folder) to put before cd.

If this ain't right, please correct me.

Question: didn't find «disctree», «ubuntu.ico» and «casper/initrd.gz», not in the folder. Last needed for boot. What can I do? best greetings, thnx
leon-geyer says: May 3, 2012. 7:44 AM
Just for people who has problems like mine
I am installing from a Netbook already with Ubuntu on it. So no CD-Drive.
Using a downloaded Ubuntu.iso (10 LTS), and had this "can not stat" = didn't find original files to copy.

I figured out: Mount and uncompress files, then drag the folder into the terminal to have the path (like user/home/desktop/folder) to put before cd.

If this ain't right, please correct me.

Question: didn't find «disctree», «ubuntu.ico» and «casper/initrd.gz», not in the folder. Last needed for boot. What can I do? best greetings, thnx
Jolum says: Dec 7, 2011. 3:04 AM
I realize this thread is probably dead, but I am trying to intall Ubuntu 11.10 onto a flash drive, so far I have completed all steps save for step 5 bullet 7:

"cp -rf casper disctree dists install pics pool preseed .disk isolinux/* md5sum.txt README.diskdefines ubuntu.ico casper/vmlinuz casper/initrd.gz /media/Ubuntu/"

I get the following error:

cp: target `/media/Ubuntu/' is not a directory

Any Suggestions? Thanks!
jsebíň says: Oct 10, 2011. 1:26 AM
I have troubles with step #5, where it shows:
syslinux: invalid option -- 's'
syslinux: Unknown option: -s

And also in step #7, where it shows
cp: target `/media/Ubuntu/' is not a directory

What should I do with these?

Thanks.
Deez23 says: Apr 23, 2008. 2:33 PM
Hello...great tutorial, but I am stuck on Step 7. I'm running Ubuntu 7.10 now and do not have a CD drive. Do I still execute "cd /cdrom"? When I execute the command in step 7, the cursor moves down to the next line and then...nada. I completed the rest of the steps with no problem. Can you help me? Cheers and great work!
kevinsa5 says: Apr 27, 2010. 5:25 PM
I'm having the same problem. I got everything to work up until that point, but when I do step 7, the cursor goes to the next line and nothing happens. I tried it a few times, and right now I can hear the disc drive going nuts, which didn't happen before. Any ideas?
kevinsa5 says: Apr 27, 2010. 6:07 PM
okay, I think I fixed that. turns out I needed to do "cd /media/cdrom" for step 6.

So I did it and now there are a bunch of files on my drive. I edited isolinux.cfg (by the way, the original was like five lines long and looked nothing like the new version) and booted into OSX to change the boot order. However, my flash drive doesn't show up in the available disks for startup.

If it helps, I'm doing this in system preferences --> startup disk and am dual booting ubuntu and OSX. I followed all the steps in ubuntu, of course.
Deez23 says: Apr 23, 2008. 2:37 PM
I tried it again, both in 'cdrom' and in root: This is what I get. cp: cannot stat `casper': No such file or directory cp: cannot stat `disctree': No such file or directory cp: cannot stat `dists': No such file or directory cp: cannot stat `install': No such file or directory cp: cannot stat `pics': No such file or directory cp: cannot stat `pool': No such file or directory cp: cannot stat `preseed': No such file or directory cp: cannot stat `.disk': No such file or directory cp: cannot stat `isolinux/*': No such file or directory cp: cannot stat `md5sum.txt': No such file or directory cp: cannot stat `README.diskdefines': No such file or directory cp: cannot stat `ubuntu.ico': No such file or directory cp: cannot stat `casper/vmlinuz': No such file or directory cp: cannot stat `casper/initrd.gz': No such file or directory
TechnoGeek95 (author) says: Apr 24, 2008. 2:57 PM
Try mounting the Ubuntu iso.
Deez23 says: Apr 24, 2008. 5:18 PM
yeah, eventually, I figured that out. A few hours later, I got it sorted out. Cheers.
plyalex1994 says: Aug 17, 2008. 12:47 AM
Help!!! At step seven it says this: cp: target `/media/Ubuntu/' is not a directory: No such file or directory ubuntu@ubuntu:/cdrom$
plyalex1994 says: Aug 17, 2008. 1:12 AM
oops I worked out what i did wrong i had called my usb the wrong name. duh
billy_bob666 says: Mar 27, 2008. 10:21 AM
please help with step 7 i get the error (cp: target `/media/ubuntu710/' is not a directory: No such file or directory) every thing went good till now.. thanks for the great instructable
TechnoGeek95 (author) says: Mar 27, 2008. 1:54 PM
Sorry! Try it now... I edited it. If it doesn't work, please tell me.
billy_bob666 says: Mar 27, 2008. 7:19 PM
thanks the new command works .. now im just having trouble booting from it ..the comp trys to read the thunbdrive. i think its the mbr but when i try the command (lilo -M /dev/sda) i get the error (Fatal: creat /boot/boot.0800: Permission denied) thanks for the input
TechnoGeek95 (author) says: Mar 28, 2008. 5:16 AM
Try a different computer, maybe. Make sure when you installed Lilo in Terminal it says that is successfully installed. If it doesn't go on the Ubuntu Packages website and download and install it manually. I don't really understand why that error came up. Make sure sda is actually your flash drive and it is mounted. That is all I can say... Sorry! Hope it works.
TechnoGeek95 (author) says: Mar 28, 2008. 5:17 AM
Oh yah, according to that error it couldn't create that file. Make sure you have permission to edit that.
TechnoGeek95 (author) says: Mar 28, 2008. 5:18 AM
Wait, I have another idea to try. When you open terminal, type sudo su, before do anything else. Hope that works!
TechnoGeek95 (author) says: Mar 28, 2008. 5:19 AM
One last thing, did you install ubuntu to the computer or using a LiveCD? If you installed try logging in as root.
billy_bob666 says: Mar 28, 2008. 8:49 AM
thanks again.. :) typing sudo su first got (lilo -M /dev/sda) to work.. but that didn't fix my prob ..when i select my pc to boot from my flash it reads the thumb drive and says (no active partition) but in windows and ubuntu it shows up properly as a MBR with all the files ..... i am using a scandisk cruzer thumb drive and live cd ...also the thumb drive comes up as a scandisk cruzer in the bios so that shouldnt be the cause.. thanks id be lost without your help
TechnoGeek95 (author) says: Mar 28, 2008. 8:55 AM
Did you try another computer? What exactly does it say when you attempt to boot up from the flash drive? Try this. In the LiveCD, go to GParted. It is somewhere in the System menu. When it scans the drive, does it say the first, 750 MB partition, has a boot label? Try to give me the most details you can.
billy_bob666 says: Mar 28, 2008. 10:11 AM
i got it working ...it was my bios being stupid ... thanks for all your help ...i found that i have to plug in my thumbdrive as i reboot or it wont load ... i like this os im very impressed thanks alot :)
TechnoGeek95 (author) says: Mar 28, 2008. 10:35 AM
Your welcome. Glad you like Ubuntu!
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!