Ubuntu 8.04 Hardy Heron (save changes) on a USB drive

-= ~(O_o)***THIS GUIDE WAS MADE OBSOLETE BY THE LINKED POST. IT HAS BEEN LEFT UP FOR REFERENCE AND ARCHIVING GO AWAY.***(o_O)~ =-

One of the problems with Operating Systems like Windows is that the
only way you can really make it ‘portable’ to the extent that you can
carry it around in your pocket is if you use something like BartPE,
which is really based as a recovery-suite maker. But that’s different
with Linux. You might now be thinking that a portable Linux operating
system would exist only in a special ‘condensed’ distribution featuring
ugly shoes (no offence) or a catchy theme song.
But if you think about it, USB sticks are the same kind of memory (sort
of) that we use in our regular computers’ hard disks. So why not just
install a full-size ubuntu distro on a USB stick? That’s right; why
not? The answer is this: Because if you do, the USB stick get’s worn
out fast, and stops working after a few boots. So the ppl at Linux came
up with a way of reading and writing changes to the disk when
necessary, and they called it ‘casper persistence’. However, in this
release of Ubuntu (Hardy Heron 8.04) it. doesn’t seem to work for some
reason. So to obtain ‘casper persistence’ you have to get in and fix it
yourself. This guide shows you how to get Ubuntu 8.04 Hardy Heron onto
any portable storage device with 1 gigabyte or more.

Before you
begin the tutorial, it is assumed that you have the following:

–A portable storage device (Like a thumbdrive or something) with 1 gigabyte of space or more.

Recommended over one gigabyte, since the Operating System takes up about 800 megabytes, and you need some room for apps and documents. Be sure to back up everything on it, since you will be hopelessly wiping it all out in the first few steps of the tutorial.

–A computer running Ubuntu 8.04 Hardy heron.

If you don’t run Linux on any of your computers , and don’t plan to, that is OK. Get the VMware Player (free but big download.) And then get the Ubuntu desktop vmware applet *english edition* ( or whatever else you wanna call it. ) at that website. Yeah, I know its a huge download. If you want to save yourself some greif just use the TORRENT file with some torrent manager like U|torrent


–An Ubuntu Hardy Heron 8.04 disk image .iso file.

If you had to follow the above steps, there is no need to downlode it again. Put it in your HOME/*username* directory.

–This file from Ryan Cloke’s Website. Put it on your desktop.

1. Okay, so let’s get started. First you have to set up your computers boot sequence with this guide. You have to move your ‘USB-STORAGE DEVICE’ listing to the top. This will force your computer to look at the USB port for an operating system before it scans the HardDrive for one. This option is not included on some older computers. Sorry. You might try a laptop or something.

2. Now that you are booted to Ubuntu Linux, it’s time to ready your Portable Drive to be able to handle linux. Plug in your memory card and move the ISO file you copied there earlier to the ‘home/*username*’ directory. (Whenever you see ‘*username*’ replace it with your username if you are using ubuntu as your desktop. If you are using VMware, then replace it with the word ‘jars’. The password for the VMware version is ‘jars’ also.

3. Now go to the terminal (Grr. Evil terminal. :evil: ) by clicking on the dropdown menu on the top of the screen Applications>Acessories>Terminal.

type: sudo su

Hit enter. You might have to type in your password if you set one.

fdisk -l

//FYI, that’s a lowercase L, not the number 1. Fdisk means Format Disk (It’s just the name of a program; it won’t format your disk.) and the -l means ‘list’

Hit enter…
and you get a list of all of the drives plugged into the computer. Usually your portable one has the smallest numbers and is near the bottom. Look for something like ‘/dev/sdX*’ (X replaced by the corresponding letter and * replaced by a number, if there is one there at all.) Remember it, or even write it down; you will use it a lot throughout the entire tutorial.

I refer to it as *thingyourememberedearler*. It is usually followed by a number. Type in the number also without spaces. It’s not a typo.

4. Now type in

gksudo gparted

/*Takes you into superuser mode (Sudo means ’superuser-do’. It’s made
for terminal applications, and Gksudo is focused more on ones with
‘button click’ GUI user interfaces.) and logs you in as the super user.
Super user has complete admin privleges and is included by default in
ubuntu. After it logs you on it will open up the Gnome Partition
Editor. You don’t have to read the entire wikipedia article on the
link, but it helps to know what you are doing. It is very dangerous to
edit the partitions if you do it carelessly. */

If nothing happens, or the terminal blurts out some kind of error, type

sudo apt-get install gparted

5. A window will pop up called GParted. On the right side of the window you will see a dropdown menu. Open that up and select the one with the text you remembered earlier. It is VERY important that you select the RIGHT ONE. There is a long box below that that represents the single partition on the thumbdrive. Right click on it and select ‘unmount’. If there are any other boxes beside that one, unmount them also. Unless you know that there is more than one Partition (Not gigabyte) on the disk, you have PROBABLY SELECTED THE WRONG LISTING FROM THE DROPDOWN BOX. CHECK AGAIN
IF THERE ARE TWO BOXES. Now click on the box again and then click the delete button near the top of the window.

6. Now you should see one big gray bar that says ‘unallocated’ in the middle. Click on it to select it and then click the ‘new’ button near the top to make a new partition on the disk. Make it a ‘FAT16′ partition with a ‘new size’ of 770 MB. Hit OK and then make another partition using up the rest of the spacewith a ‘ext2′ file system. Right click on the 770 MegaByte one, and click on flags. Check the ‘boot’ selection on the window that pops up and hit ok. That tells the BIOS that the computer can boot to it. After you have done all this, hit apply. These last few steps are very important, so here is a step-by step analysis of what you are going to do in them:

USB-Ubuntu Gparted steps

Numbers change depending on how big your SD card is. Hit apply. After everything is finished exit out of the terminal, which, in turn, will exit gparted.

7. Now that you have a prepared USB drive, you have to prepare the operating system. First you type into
the terminal:

mkdir hardy-usb

//Okay, all that does is make a directory in /*username*/ called hardy-usb.

sudo mkdir /mnt/iso

//Same, only it makes a directory in /mnt called iso

sudo mount -o loop ubuntu-8.04-desktop-i386.iso /mnt/iso

//Mounts your ubuntu disk image to /mnt/iso

cd /mnt/iso

//Goes to the /mnt/iso directory you just made. This is also where the disk image is, so there are a whole lot of files there.

cp -rf casper dists install pics pool preseed .disk isolinux/* md5sum.txt README.diskdefines casper/vmlinuz casper/initrd.gz install/mt86plus /home/*username*/hardy-usb/

// o_O That looks really scary, but all it does, really, is copy and paste everything from /mnt/iso into your hardy-usb directory. Just because it preforms a simple task doesn’t mean you can make a mistake in typing it. Best to copy and pate it instead.

cd /home/*username*/hardy-usb/

//Goes to the hardy-usb directory

mv isolinux.cfg syslinux.cfg

// Takes isolinux.cfg and renames it to syslinux.cfg, deleting the syslinux.cfg that’s already there. (if it exists)

sudo gedit syslinux.cfg &

//Opens up the default GNOME text editor: Gedit. It edits the file we previously renamedsyslinux.cfg. The & means that after you close gedit, you will goback to terminal mode. Erase everything in the text editor that pops up. Paste in all of this text:


DEFAULT usblive
GFXBOOT bootlogo
APPEND
file=/preseed/ubuntu.seed boot=casper initrd=initrd.gz quiet splash –
LABEL usblive
menu label ^Start Ubuntu and save changes to USB
kernel vmlinuz
append
file=/preseed/ubuntu.seed boot=casper persistent initrd=initrd.gz quiet splash –
LABEL live
menu label ^Try Ubuntu without any change to your computer
kernel vmlinuz
append
file=/preseed/ubuntu.seed boot=casper initrd=initrd.gz quiet splash –
LABEL live-
install
menu label ^Install Ubuntu
kernel vmlinuz
append
file=/preseed/ubuntu.seed boot=casper only-ubiquity initrd=initrd.gz quiet splash –
LABEL memtest
menu label Test ^memory
kernel mt86plus
append -
LABEL hd
menu label ^Boot from first hard disk
localboot 0×80
append -
DISPLAY isolinux.txt
TIMEOUT
300
PROMPT
1
F1 f1.txt
F2 f2.txt
F3 f3.txt
F4 f4.txt
F5 f5.txt
F6 f6.txt
F7 f7.txt
F8 f8.txt
F9 f9.txt
F0 f10.txt

Save everything and exit gedit.

8. Open up a new terminal and type in:
gksudo nautilus
//Thanks, Andy Woodhead.

Type in the password if you have to. A file explorer should pop up. Now remember that file that you downloaded from Ryan Cloke’s Website? well in the new explorer that you opened up go to the home/*username*/hardy-usb directory and click and drag the initrd.gz file from the desktop into the explorer to move it. Replace the existing one that was already there, or delete it beforehand.
9. Type:

sudo umount /dev/*thingyourememberedearlier*1
//Unmounts the first partition in the USB drive. The the linux partition.

sudo umount /dev/*thingyouremembmeredearlier*2

//Unmounts the second partition in the USB drive.

sudo mkfs.vfat -F 16 -n UbuntuLive /dev/*thingyourememberedearlier*1

//This formats the linux partition to what we need it to be. You can change ‘UbuntuLive’ with any 9-letter klaus you want the usb drive to be called.

sudo mkfs.ext2 -b 4096 -L casper-rw /dev/*thingyouremembmeredearlier*2

// This formats the memory partition to what we need it to be. Don’t change the ‘casper-rw’. Nuff said.

sudo mkdir /mount/usb

// Makes a directory in /mount called usb

sudo mount /dev/*thingyourememberedearlier*1 /mount/usb

// Mounts your linux partition in the /mount/usb directory you made earlier.

cd /home/*username*/hardy-usb

// (c:

sudo cp -rf .disk * /mount/usb

// Copies EVERYTHING in the hardy-usb directory to the linux partition.

sudo umount /mount/usb

// Unmounts whatever is mounted in /mount/usb.

sudo apt-get install syslinux mtools

// Installs the syslinux mtools packages.

sudo syslinux -f /dev/*thingyourememmberedearlier*1

//Uses syslinux to fix the linux partition one last time.

You are done!!! :mrgreen: :mrgreen: :mrgreen: :!: :!: :!: :!: :!:
Reboot and see how it works!

Based on (but not the same as) a guide by Ryan Cloke.

Comment if you have any problems and I will try and help in any way that I can.

-= ~(O_o)***-=THIS GUIDE WAS MADE OBSOLETE BY THE LINKED POST. IT HAS BEEN LEFT UP FOR REFERENCE AND ARCHIVING. GO AWAY.***(o_O)~  =-

9 Responses to “Ubuntu 8.04 Hardy Heron (save changes) on a USB drive”

  1. Andy Woodhead Says:

    Please for the love of loveliness can people stop using sudo for gui apps!!!

    sudo is for CLI programs like rm, apt-get, mv etc. These stay in the prompt. If you want to run nautilus then please use gksudo (for gnome) or kdesu (for kde). These will set up your environment correctly and preserve ownership and correct permissions.

    Yes sudo DOES give you admin access in your gui apps (konqueror, gedit etc) but the ownership can get damaged so only root can access the file. This can result in an unbootable system.

    Short answer

    sudo for CLI programs
    kdesu / gksudo for GUI apps

    In the live environment this doesnt matter as the file system is detroyed on reboot but if you are setting up stuff on a running system to be permanent stick to the guide. Strictly speaking, kdesu and gksudo can be used for CLI apps too without any negative effects.

    I always point this out as it makes people look like kreepfests, but otherwise its a sound walkthrough.

    Peace
    -Andy

  2. Enth Degree Says:

    Don’t worry. I need all the help I can get with this. (c:

    I haven’t heard of the GKSUDO command. It sounds useful (Googling it right now.) ; I’ll try and impliment it here.
    But gksudo gives you root-access from GUI, so the only difference is that it uses the libgksudo-something-something libraries and gives you a nice little buttonclick interface! Owell. There is probably a good reason for it and I should definitely use what was made for a GUI with what was made for a GUI– because that’s what it’s made for. :wink:

    Thanks for telling me about it,
    -Enthdegree

  3. muhit Says:

    I cant see the rest of this command

    cp -rf casper dists install pics pool preseed .disk isolinux/* md5sum.txt README.diskdefines cas

    Ive used IE and firefox both do not show the full command.

    Should I just copy everything from the iso dir to the hardy-usb directory.

  4. Enth Degree Says:

    Oh yeah, I guess that that’s a possible solution to your problem. It used to be up on the guide that way but I decided not to leave it like that because the commandline option would actually be easier to use.

    Here’s the complete command line option if you wanna do it with the console like it shows on the guide. :

    cp -rf casper dists install pics pool preseed .disk isolinux/* md5sum.txt README.diskdefines casper/vmlinuz casper/initrd.gz install/mt86plus /home/*username*/hardy-usb/

    (I will add that to the guide in a minute. Thanks for pointing out the error.)

    If you still wanna do it on a gksudo NAUTILUS explorer, it should also be fine. It’s just your personal preference. If you do do it that way let me know how it works!
    -Thanks

  5. Tom Praill Says:

    Solid guide. A little too thorough for me, but Im sure newer users appreciate it :)

    Not working though. The ubuntu splash screen appears for about 30 seconds and then defaults to a BusyBox ash prompt (initramfs).

  6. Enth Degree Says:

    I wonder why? I tested it with two computers and it works fine. Some people have said that Gparted doesn’t work for them, so you might have to use fdisk on the command line.

    With the new version of Ubuntu coming out so soon, I may have to do a new guide for this.

  7. Altaf Says:

    I have created a USB boot able Ubuntu OS by following the tutorials in the following link,
    http://www.pendrivelinux.com/2008/10/06/usb-ubuntu-810-install-from-windows-non-persistent/

    It works fine. My problem is, it doesn’t save changes I make to the OS. For example the software & drivers that I install. How do i fix it?

  8. Enth Degree Says:

    You used the non-persistent method. The casper-rw guide is over here. :wink:

    I don’t know why pendrivelinux bothers to link to these guides after the persistence-enabled versions are up. It creates confusion. Pendrivelinux is a reliable site through my experience, otherwise. ( Maybe even more reliable than nerdhow Oc: )

  9. BKOsuper Says:

    The theme is opened completely and very actual! Thanks the author of a blog!
    Скачать фильм зеркала

Leave a Reply