LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-10-2007, 04:57 PM   #1
aloishis89
Member
 
Registered: Sep 2007
Posts: 54

Rep: Reputation: 15
installing full ubuntu on a thumb drive


I have an old laptop that I have sucessfully been able to run live distros off of like puppy and dsl linux. I can't get my hard drives to work (their old and i dont want to spend a bunch of money on a new one). I cant get a partition on them. But i do have a 4gb thumb drive. Is it possible to use this as a boot path and install it on the thumb drive? Will I need to format it in something other than FAT32? Any help or a link to a tutorial would be great.
 
Old 10-10-2007, 08:54 PM   #2
AceofSpades19
Senior Member
 
Registered: Feb 2007
Location: Chilliwack,BC.Canada
Distribution: Slackware64 -current
Posts: 2,079

Rep: Reputation: 58
you might want to try pendrivelinux.org
it also depends if your computer can boot off of a flashdrive
 
Old 10-12-2007, 06:58 AM   #3
nooby
Member
 
Registered: Oct 2007
Location: Stockholm Sweden
Distribution: Snow Puppy and Fluppy and Lupu frugal install
Posts: 279

Rep: Reputation: 33
May I kindly ask you to tell us in this thread if you succeeded. The link given most likely will tell you how but it could be reassuring if we who haven't tried it yet that it is possible. I 've heard that some thumbs are not possible to boot from though. Not sure what that is so.
 
Old 10-12-2007, 04:13 PM   #4
IncredibleKarma
LQ Newbie
 
Registered: Oct 2007
Distribution: Ubuntu - Dapper Drake [Highly Modified]
Posts: 6

Rep: Reputation: 0
Ubuntu 6.06 Dapper Drake (and others I'm sure) do support this. These instructions are intended for a USB Harddrive but they have worked for me for a 2GB Flash Drive.

There are a few complications to fix if you were to go with this solution.

To do this, you would go about installing as usual until you reached the partitioning dialogue. Instead of choosing an internal IDE HD, you would choose the SCSI drive the system detected. [This should look like SCSI (0,0,0) (sda)] If you have more than one SCSI drive, it's probably the last one.

When the installation reaches the GRUB bootloader stage, it will ask you if you want to install on the internal hard drive, Say no then enter /dev/sda in the next screen.

When prompted to reboot the system press Alt+F2 to get a basic console, and press enter to activate it. Type the following commands:
mount -t proc /target/proc

chroot /target

vim /etc/mkinitramfs/modules

Add the following to the end of the file
ehci-hcd
usb-storage
scsi-mod
sd-mod

If the drive is on IEEE1394 you also need to add:
ieee1394
ohci1394
sbp2

Save and close the file

Next:

vim /etc/mkinitramfs/initramfs.conf

At the very beginning of the file add:
WAIT=10 (This will stall the GRUB long enough for the drive to mount)

mkinitram -o /boot/initrd.img-2.6.15-16-386 /lib/modules/2.6.15-16-386
The paths should match the kernel version of your installation

Almost Done

vim /boot/grub/menu.1st

find the lines that look like:
## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd1,0)

Change the final line to read "groot=(hd0,0)" instead.

Find another section which looks like:
title Ubuntu, kernel x.x.x-x-x
root (hd1,0)
kernel /boot/vmlinuz-x.x.x-x-x root=/dev/sda1/ ro quiet splash
initrd /boot/initrd.img-x.x.x-x-x
boot

title Ubuntu, kernel x.x.x-x-x
root (hd1,0)
kernel /boot/vmlinuz-x.x.x-x-x root=/dev/sda1/ ro single
initrd /boot/initrd.img-x.x.x-x-x
boot

title Ubuntu, memtest86+
root (hd1,0)
kernel /boot/memtest86+.bin
boot

Change all instances of (hd1,0) in this section to read (hd0,0).

Save and close.
Type exit in the console and press Alt+F1 to return to the main screen. Reboot the system.


Alternately, mount your thumb drive. (This is specifically for running from an Ubuntu 6.06 Live CD with a USB drive. The Live CD looks for a volume labled casper-cow at startup and theoretically you can take your Computer with you anywhere using this technique. It has never worked for me.)
Enter df -h to list mounted volumes.
Your thumb drive will most likely be /dev/sda1 (or sda0)

sudo mkfs.ext3 -b 4096 -L caper-cow /dev/sda1 (Or you could use mkfs.vfat if you prefer the FAT filesystem)

Reboot the machine and quickly insert the Live CD, if it does not load automatically on your machine, F2 at bios will probably allow you to choose for it to do so. Press F4 at the First Screen, add a space to the end of the list of arguments that appeared and type persistent. With fingers crossed, this will work and you can install programs, change settings, create files, shut down, go to your buddies house and stick the CD in his box, reboot, and see your system all without altering his OS.
 
Old 10-12-2007, 04:45 PM   #5
weisso5
Member
 
Registered: Oct 2007
Location: New York City
Distribution: Gentoo, FC
Posts: 133

Rep: Reputation: 16
you can try using these instructions and tweaking them a bit.
http://fedoraproject.org/wiki/FedoraLiveCD/USBHowTo
I have only used a USB Flash drive to boot on and run a network based installer, never put the whole thing on there.

The basics is just format the USB drive as Fat32 using the HP USB Disk format tool. Then using any MBR batch program to make the drive bootable, then copy the basic linux files to the usb flash drive. That is all i needed to do to boot into the Fedora install and then finish it with ftp.

-mpw
 
Old 10-12-2007, 04:46 PM   #6
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
I have not had enough patience to see through a full distro like Ubuntu installed into a flash drive.

It is just too damn slow!!!!!!!!!!!!!!!!!!!!

In the 4Gb flash drive I got show the manufacturer shows the read speed 12 MB/s and Write speed 3.5Mb/s.

When I clone a Sata II hard disk the speed is in excessive of 70Mb/s. That means installing a system in a flash drive is 70/3.5 = 20 times slower! That also means if Ubuntu takes say 10 minutes for an installation into an internal hard disk it would have to take 200 minutes or almost 3 hours on a flash drive. Even if one has the patience to put a full size Ubuntu into a flash drive he/she is unlikely to enjoy the snail speed it operates. There may be faster flash drives but technically it is a wrong media to hold a full size Linux at the moment.

Flash drives are good for small foot print Live CD distros which are only 1/4 to 1/5 of the size of a fully installed Linux.

I find installing Ubuntu in a external USB hard disk is more practical. The drop in speed is about 1/4 of the internal hard disk.

After I have put 7 Live CD iso into a DVD I then copied them into a flash drive. 3 (DSL, Mepis and Slax) out of the 7 iso boot successfully in the flash drive and gave reasonably response.

Thus my recommendation is if one needs Linux booted from a flash drive then install only the Live CD versions. Put them in USB hard disk if you want to run the full versions.

Also the journalling system of Ext3 is not good for flash drive because of the intensive/epetitive read/write activities. I used Ext2 partition for my 7 iso trial.

Last edited by saikee; 10-12-2007 at 04:50 PM.
 
Old 10-12-2007, 11:02 PM   #7
Boow
Member
 
Registered: Feb 2004
Distribution: Slackware 10.2
Posts: 669

Rep: Reputation: 32
it works I've used a 1 gig flash drive using instructions fron pendrivelinux.org.
 
Old 10-13-2007, 04:52 AM   #8
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
I am sure it works. It is just so much slower than a USB hard disk.

For Mepis to run as a Live CD its image is the same size as a CD about 0.5Gb. To install it properly it expands to 2.5Gb. Therefore the footprint is 5 times larger to start with. My selected 4Gb is possibly a slow one (20 times slower than a Sata hard disk) and there may be flash drive significantly faster. The overall response is unlikely to beat a USB hard disk which on average is 1/4 of the internal hard disk speed and has virtually no limit on space, because one could just buy any size hard disk and put it into an external hdd enclosure.

I have just done a read speed for the 6 flash drives I got. They range from 0.5Gb by Opti to 8Gb by Transcend. The output by root console command "hdparm -tT /dev/sdb" are

Lexor(2Gb) 24.97MB/s
Integral(1Gb) 18.66MB/s
Transcend(8Gb) 24.94MB/s
Kingston(1Gb) 14.5MB/s
Peak(4Gb) 31.32MB/s
Opti(0.5Gb) 7.55Mb/s

Interestingly my Sata II hard disk reports a similar buffered disk read speed of 81.99MB/s
AN attached external Pata disk yield a uffered disk read speed of 31.56MB/s

The write speed of 3.5MB/s flash drive I mentioned above is among the list but its listed read speed is up to 12MB/s.

I have tried to load a Ubuntu and a Mepis on a couple of the above flash drives, especially the 8Gb Transcend as I have it partitioned to hold 7 Live CD iso and a 4Gb partition for Ubuntu plus a swap. I gave up because I didn't think taking several hours to install a Linux would lead me to anywhere.

It is possible the killer in a flash drive could be the absence of the cache memory that is available in a hard disk. The cache, up to 16 Mb easily for larger hard disk, could speed up the read/write speed of a hard disk considerably. AFAIK a flash drives has no such benefit.

Last edited by saikee; 10-13-2007 at 05:39 AM.
 
Old 10-13-2007, 09:38 AM   #9
aloishis89
Member
 
Registered: Sep 2007
Posts: 54

Original Poster
Rep: Reputation: 15
thanks for all the help. it turns out that my bios is from 1999 so i couldnt get the newest release of ubuntu to work. i am on a school trip now so when i get back i will try to use an older distro or a differnt 1. for now puppy linux is working nicely. thanks again.
 
Old 10-13-2007, 05:10 PM   #10
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
I like to modify my stance in Post #8 because I am booting a Ubuntu 7.10 by a USB flash drive and it works OK. The response isn't too bad at all and much better than I have anticipated.

What I did was to take the fastest flash drive I had which is a 4Gb Peak pen drive list in Post #8, with a write speed 31.32 MB/s.

I have an internal hard disk sda and the flash drive is read as sdb after I booted up a Ubuntu installable Live CD.

Like in all installations I prefer to have the partitions ready and here is my partition scheme
Code:
saikee@saikee-desktop:~$ fdisk -l

Disk /dev/sdb: 4160 MB, 4160225280 bytes
128 heads, 62 sectors/track, 1023 cylinders
Units = cylinders of 7936 * 512 = 4063232 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1         246      976097    6  FAT16
/dev/sdb2             247         861     2440320   83  Linux
/dev/sdb3             862        1023      642816   82  Linux swap / Solaris
I therefore have 1Gb fat partition in sdb1. sdb2 is 2.5Gb large and the remainder as a swap. The partitions were created with Ubuntu CD using terminal command "cfdisk /dev/sdb". Partitions created in Linux is automatically Type 83. The cfdisk program has a facility to alter partition ID for swap (Type 82) and I needed a Fat16 partition (Type 6) for other purpose. Because a fat partition has been created I needed a reboot to finalise the partition table.

At the next reboot I booted back to the CD and just clicked the installer in the desktop to start the installation process.

When it came to partitioning I chose the last choice which is "manually".

Inside I just highlighted the sdb2, click edit, use it as Ext2 (avoiding the files journalling) and type / for the mount point. The installer will then install Ubuntu into sdb2. This steps tells the installer I want a single partition to store the Ubuntu in sdb2, format it in Ext2 filing system and use it to mount the root "/" of Ubuntu.

When it came to the the location of the boot loader it was either sda or sdb. I select sdb. This mean the MBR of the flash drive.

I didn't record the time it took but it was pretty quick, possibly 15 to 20 minutes because the wife was dragging me out to the movies. I was just able to finish the installation before going out.

When I came back I powered up the PC, removed the CD and told the Bios that I wanted the flash drive to be the first boot disk, which I did not expect it to work. This is because sdb was the 2nd disk when I installed Ubuntu inside so I must correct the Grub configuration file menu.lst. Grub is easy to work because a user can edit the configuration during the booting stage.

When the Grub in the MBR of the flash drive booted up I select the first choice of Ubuntu but instead pressing the return key I pressed "e" so that I could edit the Grub command.

Like I expected the root statement of Grub was
Code:
root (hd1,1)
indicating the Ubuntu was installed in the 2nd partition of the 2nd disk, as Grub counts everything from 0. To boot Ubuntu correctly now in the 1st boot disk I must correct the root statement to (hd0,1). I therefore highlighted the root statement and press "e" for edit and carried out the change.

Ubuntu now uses a by-uuid method to call the partition sdb2 and there no need for me to intervene because the by-uuid name is unique.

Now the booting instructions are correct I therefore pressed "b" for booting and the Ubuntu fired up like a clockwork for the first time.

Once operational I edit the /boot/grub/menu.lst to make the change permanent, as changes in the boot screen is not kept. My /boot/grub/menu.lst now looks like this
Code:
title           Ubuntu, kernel 2.6.22-9-generic
root            (hd0,1)
kernel          /boot/vmlinuz-2.6.22-9-generic root=UUID=f8d117b0-6979-41a0-b29d-c418cd7a644e ro quiet splash
initrd          /boot/initrd.img-2.6.22-9-generic
I removed other lines that are of no interest to me. In the above the red bit is the only editing I did. The blue bit is the by-uuid method of addressing a partition. If a user experiences a booting problem after installing Ubuntu Linux into a flash drive it is normally down to not correcting the red bit.

In conclusion one can install Ubuntu into a flash drive in exactly the manner as installing into a partition of an internal hard disk. The distro does take longer to boot but everything is no different to that in an internal hard disk.

Last edited by saikee; 10-13-2007 at 05:13 PM.
 
Old 10-14-2007, 02:55 PM   #11
nooby
Member
 
Registered: Oct 2007
Location: Stockholm Sweden
Distribution: Snow Puppy and Fluppy and Lupu frugal install
Posts: 279

Rep: Reputation: 33
Damn Small Linux and Puppy Linux? both suggests one should change how often the program writes to the thumb so it last longer. Suppose it has 100.000 writes, sound much but if the program do many write cycles that could kill the thumb fast. One of the programs above has set the time to only one write per 30 minutes to help the thumb last longer. I don't remember how often it usually writes.
 
  


Reply


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Using a usb thumb drive or flash drive as a swap partition. stevenjoseph Linux - Hardware 8 01-16-2012 12:09 PM
installing fedora off of a thumb drive Wes527 Linux - Software 1 03-15-2007 12:03 PM
ubuntu partitioning tool does not see external usb hard drive when installing ubuntu fakie_flip Linux - Software 2 07-30-2006 12:44 AM
Installing to thumb drive boot from CD android6011 Linux - General 1 07-06-2006 02:06 AM
Thumb Drive gerowen Linux - Hardware 2 11-20-2005 01:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:26 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration