[PPC] How to make a Live CD a Live USB stick
Boot Ubuntu Live CD from a USB Stick
I needed 4 days, but the solutiion is quite simple...
Here are the instructions, step by step.
But before that let me tell you that I'm German and so my english might be not as good as it could be. I also will drop some hints for the German readers, mostly because of our different keyboard layout. This is a free translation of my german instructions posted on apfeltalk.de.
Information sources used
- Where to download Ubuntu for PowerPC and other frequently asked questions
- Instructions on help.ubuntu.com
- Wie man mit Yaboot auf PowerPC bootet (German)
Step 1: Get the data
Fetch an ISO image for a Live CD [1]. Burn a CD(-RW) using the OS X Disk Utility.
You should format the USB Stick with a Name you can recognize.
Step 2: Boote the Live CD
UInsert the CD einlegen and reboot. At the Bootup sound press C to boot from CD.
A bit later the "boot: " Prompt will appear. I had to enter
live video=ofonly
in ordre to boot. My advise is to use
live-nosplash video=ofonly
Hint: The keyboard is set to US layout. German users will have to press the keys "liveßnosplash video´ofonlz".
Step 3: Creating the bootstrap-partition
Wenn Ubuntu is up, open the Terminal.
Now try to find the device name your USB stick currently has. So connect the USB stick now, if not already done.
df
Code:
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 775652 268 775384 1% /lib/modules/2.6.24-16-powerpc/volatile
tmpfs 775652 268 775384 1% /lib/modules/2.6.24-16-powerpc/volatile
varrun 775652 96 775556 1% /var/run
varlock 775652 0 775652 0% /var/lock
udev 775652 120 775532 1% /dev
devshm 775652 12 775640 1% /dev/shm
tmpfs 775652 16 775636 1% /tmp
/dev/sdc1 990156 12 990144 72% /media/BOOTSTICK
Here the device name is /dev/sdc. Note: The device name can be different after each boot. /dev/sdc in this instruction is to be replaced with the devicee name of your stick.
Now we have to switch to superuser
sudo -s
umount /dev/sdc1
Then we start partitioning using "mac-fdisk"
mac-fdisk /dev/sdc
Code:
/dev/sdc
Command (? for help):
Enter "i" for initialising the partition map.
Code:
Command (? for help): i
size of 'device' is 1980416 blocks:
new size of 'device' is 1980416 blocks
Review the map by entering "p"
Code:
Command (? for help): p
/dev/sdc
# type name length base ( size ) system
/dev/sdc1 Apple_partition_map Apple 63 @ 1 ( 31.5k) Partition map
/dev/sdc2 Apple_Free Extra 1980352 @ 64 (967.0M) Free space
Block size=512, Number of Blocks=1980416
DeviceType=0x0, DeviceId=0x0
Now we crate the bootstrap-partition. Newer versions of mac-fdisk know the command "b" for this. If you have an older one you need to enter "C xxxx 800k bootstrap Apple_Bootstrap". The xxxx is to be replaced with the number of the start block, which is 64 in the map shown above.
Code:
Command (? for help): b
First block: 64
Command (? for help): p
/dev/sdc
# type name length base ( size ) system
/dev/sdc1 Apple_partition_map Apple 63 @ 1 ( 31.5k) Partition map
/dev/sdc2 Apple_Bootstrap bootstrap 1600 @ 64 (800.0k) NewWorld bootblock
/dev/sdc3 Apple_Free Extra 1978752 @ 1664 (966.2M) Free space
Block size=512, Number of Blocks=1980416
DeviceType=0x0, DeviceId=0x0
This concludes the creation of the map and we have to write it to the stick.
Code:
Command (? for help): w
IMPORTANT: You are about to write a changed partition map to disk.
For any partition you changed the start or size of, writing out
the map causes all data on that partition to be LOST FOREVER.
Make sure you have a backup of any data on such partitions you
want to keep before answering 'yes' to the question below!
Write partition map? [n/y]: y
The partition map has been saved successfully!
Syncing disks.
Partition map written to disk. If any partitions on this disk
were still in use by the system (see messages above), you will need
to reboot in order to utilize the new partition map.
You leave mac-fdisk with "q".
Step 4: Filling the bootstrap-partition
Now you format the bootstrap-partition with hfs
hformat -l bootstrap /dev/sdc2
Code:
Volume name is "bootstrap"
Volume was created on Fri May 2 19:04:53 2008
Volume was last modified on Fri May 2 19:30:32 2008
Volume has 799744 bytes free
mount it
hmount /dev/sdc2
Code:
Volume name is "bootstrap"
Volume was created on Fri May 2 19:04:53 2008
Volume was last modified on Fri May 2 19:30:32 2008
Volume has 799744 bytes free
and copy yaboot onto it and set some attributes
.
hcopy -r /cdrom/install/yaboot :
hattrib -c UNIX -t tbxi :yaboot
hattrib -b :
humount
yaboot needs a configuration file. Fortunately we can use the one from the CD with just a small change
mount /dev/sdc2 /mnt
cp /cdrom/install/yaboot /mnt
We saw in the partition map that there is a partition 3. We will copy the live CD onto that partition. We have to inform yaboot about the fact that the system resides on partition 3.
vi /mnt/yaboot.conf
You will find information about yaboot.conf's structure on the internet. For now it's just important thatwe put the partition number near the top of the file. For example in the line directly after "timeout=300". For this, move the cursor into that line and press enter to activate the insert mode of vi. Then type
partition=3
after that press the escape key to leave the insert mode.
Note: Here you can add severeal settings you like the system to always use. For example your locale or your keyboard layout. This example is for a German locale with german keyboard. Also added is the (mandatory?) video=ofonly:
Please type in vi:
Code:
:1,$ s/ --"/ locale=de_DE bootkbd=de console-setup\/layoutcode=de video=ofonly --"/
You might also want to cnhange the "default=live" to "default=live-nosplash".
When done, the changed file need to be saved:
:wq!
Now we can unmount the partition
umount /dev/sdc2
Step 5: Copy the CD
First we need to format Partition 3:
mkfs -t ext3 /dev/sdc3
Code:
mke2fs 1.40.8 (13-Mar-2008)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
61952 inodes, 247344 blocks
12367 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=255852544
8 block groups
32768 blocks per group, 32768 fragments per group
7744 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376
Writing inode tables: 0/81/82/83/84/85/86/87/8done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 38 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
and mount it:
mount /dev/sdc3 /mnt
To copy the files I usually use this command sequence I'm usin since the last millenium ;-)
(cd /cdrom ; tarcBpf -.) | (cd /mnt ; tar xvBpf -)
Code:
./
./README.diskdefines
./.disk/
./.disk/casper-uuid-powerpc
./.disk/casper-uuid-powerpc64-smp
./.disk/info
./.disk/release_notes_url
./casper/
./casper/filesystem.manifest
./casper/filesystem.manifest-desktop
[...]
./ppc/bootinfo.txt
./preseed/
./preseed/cli.seed
./preseed/ltsp.seed
./preseed/ubuntu.seed
./ubuntu
This will last some time, but when done, we can unmount the partition
umount /dev/sdc3
and now we can boot from the stick!
Step 6: Boot from the stick
reboot
Sooner or later the CD will be ejected. Press enter then. When you hear the boot sound press the 4 keys: alt-cmd-o-f. Soon after that, the Open Firmware prompt should appear.
First we try to find the bootstick:
dev / ls
Hint: US keyboard! Germans pleas press "/" to get the "-".
You will see a longish hierachical list.
Somewhere in that list you will find a "/usb..." and somewhere below that a "/disk...". Maybe a "/hub..." is between that, should the stick be plugged into a usb hub.
It's important to write down that part.
Code:
/usb@15,1
:
:
/disk@1
With the command
devalias
we look whether or not there is a "shortcut" for the /usb@15:
Here is what my system has:
Code:
usb1 /pci@f2000000/@15,1
To boot from the stick, I enter:
boot usb1/disk@1:2,\\:tbxi
the :2 is the bootstrap-partition we created earlier.
That was it. After some time yaboot's "boot: " prompt should appear. Depending on the changes you made to yaboot.conf, you simply press enter or select the appropriate image to boot.
Re: [PPC] How to make a Live CD a Live USB stick
Outstanding! Congratulations on making it work.
Your English is much better than my Deutsch (took one semester while in college, or should I say it took me? :-( ), and I am able to follow your instructions quite well.
Re: [PPC] How to make a Live CD a Live USB stick
I'm trying this on my G4 PPC. It doesn't work after Step 4. This is the error I get when I try to "fill the bootstrap" partition. Any help, comments, appreciated.
Quote:
root@ubuntu:~# hformat -l bootstrap /dev/sdb12
hformat: /dev/sdb12: error opening medium (No such file or directory)
root@ubuntu:~#
FYI: I followed the Instructions to T up until Step 3. Everything looked exactly the same.
EDIT: Since this method is not working for me right now I'm trying to look for alternatives, but it's completely messed up my pen drive and it cannot be read anymore. I really need your help right now, or at least if you could tell me how to return my pen drive to normal (using OS X) so I can maybe try something else would be greatly appreciated.
Re: [PPC] How to make a Live CD a Live USB stick
Quote:
Originally Posted by
BeautyandSong
I'm trying this on my G4 PPC. It doesn't work after Step 4. This is the error I get when I try to "fill the bootstrap" partition. Any help, comments, appreciated.
FYI: I followed the Instructions to T up until Step 3. Everything looked exactly the same.
EDIT: Since this method is not working for me right now I'm trying to look for alternatives, but it's completely messed up my pen drive and it cannot be read anymore. I really need your help right now, or at least if you could tell me how to return my pen drive to normal (using OS X) so I can maybe try something else would be greatly appreciated.
you had a typo sdb12 instead of sdb2.
You pendrive should be fine, it just needs repartitioned / reformatted to be usable normally again.
Re: [PPC] How to make a Live CD a Live USB stick
Quote:
Originally Posted by
cyberdork33
you had a typo sdb12 instead of sdb2.
You pendrive should be fine, it just needs repartitioned / reformatted to be usable normally again.
Actually, the pen drive was located at /dev/sdb1, and the bootstrap partition was 2. Hence /sdb12. If I tried to run the hformat command using /dev/sdb1 as the destination, it gave a slightly different error, but I've closed all my windows now. I think it said it couldn't find the file/destination without the "error opening medium" line.
I know the pendrive has to be reformatted, but how? Mac OS X won't read it, and I can't load it in Disk Utility... Thanks!
Re: [PPC] How to make a Live CD a Live USB stick
Quote:
Originally Posted by
BeautyandSong
Actually, the pen drive was located at /dev/sdb1, and the bootstrap partition was 2. Hence /sdb12. If I tried to run the hformat command using /dev/sdb1 as the destination, it gave a slightly different error, but I've closed all my windows now. I think it said it couldn't find the file/destination without the "error opening medium" line.
I know the pendrive has to be reformatted, but how? Mac OS X won't read it, and I can't load it in Disk Utility... Thanks!
Except that is the wrong terminology. sdb would be the device... sdb1 would be a partition. so if you were trying to access the second partition on the device, it would be sdb2. And just for completeness, additional devices would be sdc, sdd, etc.
I am not sure what the process you followed actually does to the drive, but you might try using gparted to view and partition the device. FAT32 partitions are the norm for these devices since it is most compatible with other filesystems.
Re: [PPC] How to make a Live CD a Live USB stick
Hi!
I found the thread very interesting and I tried to go through all the steps. I have a PB 15" G4 with an external LACIE firewire disk. It is a "pen disk" i.e. it is powerd via the firewire cable, the disk has no power supply.
I dedicated the disk to ubuntu, then partition 2 is the boot partition 3 is the copy of livecd.
When I enter openfirmware I run a command like:
boot fw/node/sbp-2/disk@0:2, \\tbxi
I can hear the disk starting to spin a bit, e.g. the command address the disk. Then a receive a message:
sbp-2:Open -> login?
speed=ffffffff 2 2 MAC-PARTS - LOAD (non interposed) not supported load-size=0 adler32=1
LOAD_SIZE is to small
And obviously I can't boot :-)
Any useful hint/idea ? Any help is MUCH appreciated :-) Thanks a lot!
R.
Re: [PPC] How to make a Live CD a Live USB stick
Quote:
Originally Posted by
rednose0607
Hi!
When I enter openfirmware I run a command like:
boot fw/node/sbp-2/disk@0:2, \\tbxi
I can hear the disk starting to spin a bit, e.g. the command address the disk. Then a receive a message:
R.
Code:
0> boot fw/node/sbp-2/disk@0:2, \\tbxi
that has a colon : missing, and a bad space should be
0> boot fw/node/sbp-2/disk@0:2,\\:tbxi
or you can just boot yaboot -
0> boot fw/node/sbp-2/disk:2,yaboot
also try these
Code:
to list the files -
0> dir fw/node/sbp-2/disk:,\
0> dir fw/node/sbp-2/disk:2,\
Re: [PPC] How to make a Live CD a Live USB stick
Ok fellas, i've followed this until i got to the bit that said "G4 laptop cannot boot from usb, only firewire."
Here's the challenge:
I understand the process up to booting from firewire. The internal optical drive in my G4 is now officially toast, so i'm keen to install Ubuntu ppc from firewire. I have an external box that i've temporarily attached a cd drive to. (It works, but it's not pretty. Pile of wires, live power at my fingertips, literally. You get my drift.)
So far, from either OF or simply yaboot second stage bootstrap, i can put in the following command, the firewire CDrom gets all energetic, and screams like a z-list pop singer, but then just cycles down to a low hum, and the screen message says:
Welcome to yaboot version 1.3.13
boot: fw/node/sbp-2/disk@0:2,\\:txbi
Please wait...Loading kernel
Doesn't work. I fell asleep on attempt 483, and it still said the same thing when i woke up 3 hours later.
So;
When i do a dir, and question this in OF, i get a whole string of block messages (write-block? 17, then write-block? 3, etc, with a few retrys exceeded thrown in as well.)
I've burned 4 discs on a borrowed win pc (they're cheap) to use, and all come up with the same message when i try to use dir in OF to find stuff on the disk.
What am i doing wrong here? md5 sums are ok, so that's alright.
What sort of command do i have to put in in either OF, or at boot prompt to fire up an install. (The OS on the HD is toast, so i need to reinstall fresh. Don't ask. User Error...)
I'm no Linux Gandalf, so simple instructions would be thrilling.
I don't get the sudden enthusiasm from the FW cdrom, as that tells me the laptop is locating and using the device ok. It works the same way every time.
But if i have yaboot 1.3.13 already in place, how can i tell the firewire cdrom to get on with it and start my fresh install?
Some will no doubt say the old G4 is a good candidate as a boat anchor, but i'll be honest here, i'm rather attached to the old bitch. She might be missing a cdrom drive, and spit the dummy at installing from usb, but she's been a fair way round the world with me, and i know just how she ticks, at least until now.
So what i am trying to do?
Install Ubuntu ppc from a firewire cdrom.
Alex.
Re: [PPC] How to make a Live CD a Live USB stick
I have assumed its a bad initial install so im working on the boot from usb process.
When i get to this point
(cd /cdrom ; tarcBpf -.) | (cd /mnt ; tar xvBpf -)
I get a mssg back
bash: tarcBpf: command not found
When i space it differently I get
(cd /cdrom;tarcBpf-.)|(cd /mnt;tar xvBpf-)
tar: Old option `f' requires an argument.
Try `tar --help' or `tar --usage' for more information.
bash: tarcBpf-.: command not found
can someone point out another method or at what point im fat fingering the syntax. Thanks
OH sorry forgot to toss in a thanks credit to the author, for a translation andwith me a total noob its explained well