Pre-requisites:- Working from an installed PCLOS ..... either updated to present or a 2009.1 install.
Flash stick minimum of 1GB but preferably larger
Aim:- To produce a flash stick that will run PCLOS 2009.1 (or later) from any PC which is capable of booting from USB
Synopsis:- 1. Create an ext3 partition on a flash drive of 1GB size or greater. Give permission to everyone to R/W
2. Copy the OS files to the partition from an ISO or CD of 2009
3. Create a boot folder on the partition, and copy the grub folder from a running PCLOS 2009 into the boot folder
4. Edit the menu.lst file on the flash disk
5. Install Grub to the MBR of the flash drive
That's it!
Below is my suggestion of one method of achieving this.
It is not the only method, nor is it exhaustive, but it should get you through the process if you are in any doubt.
Essentially this is the same method as described here
http://pclosmag.com/html/Issues/200804/page01.htmlwith a few minor changes to the boot stanza and the use of the partition Label to boot, and also includes persistence.
************
Process :- 1. Use PCLOS Control Centre - Local Disks - Manage Disk Partitions.
Delete all existing partitions on the stick.
Create an ext3 partition of minimum 1 GB but preferably more if persistence is needed.
If it is a 4GB flash disk then make the partition the full size of the flash drive.
Set the permissions of the partition to allow everyone to read and write it.
Give the partition a Label .... let's say 2009
Format the partition.
Select Done from the bottom of the page.
2. Safely remove the drive and then reinsert it after a few seconds.
An icon should appear on the Desktop called 2009.
It should now mount to
/media/2009 when clicked.
Right click on the Desktop icon, select
Properties and from the
Mounting tab untick
"Access time Updates". OK
Next ...
Using a 2009 live CD open it in Konqueror ...
orif you have just the ISO of 2009, right click on it ...
Actions - ISO9660 View. This will open the ISO in Konqueror. Click on the folder ISO9660 to display its contents.
Then ....
Click on the 2009 Desktop icon so that it opens in Konqueror or other file manager.
Now from the Konq view of the CD or ISO, copy
to the 2009 flash disk partition, the
isolinux directory and the
livecd.sqfs file.
3. Next create a directory called
boot on the 2009 flash disk.
Navigate to
/boot in the running OS and copy the
grub directory to within the
boot directory of the 2009 flash disk.
Your flash disk should now have
isolinux folder
boot folder {and inside this folder should be the grub folder}
livecd.sqfs file
4. Open the
/boot/grub/menu.lst file on the flash disk for editing.
Delete the existing boot stanzas, leaving the headings etc intact.
Place a
# in front of the
gfxmenu line. {if you want a graphical boot it can be done later}
Add the following boot stanzas [
EDIT: Added second boot stanza to allow use without Persistence]
title 2009 -- With Persistence
kernel (hd0,0)/isolinux/vmlinuz vga=788 livecd=livecd fromusb root=Label=2009 changes_dev=LABEL=2009 acpi=on fstab=rw,noauto
initrd (hd0,0)/isolinux/initrd.gz
title 2009 -- No Persistence
kernel (hd0,0)/isolinux/vmlinuz vga=788 livecd=livecd fromusb root=Label=2009 acpi=on fstab=rw,noauto
initrd (hd0,0)/isolinux/initrd.gz
Now for the terminal stuff .....
5. Open a terminal and su to root. Type
grub <enter>
After some little time you get a grub prompt
grub>To be sure we work on the correct drive and not interfere with any HDDs in the system we ask Grub to find all instances of menu.lst file
grub> find /boot/grub/menu.lstYou will get a response something like
(hd0,0)
(hd0,5)
(hd2,0)grub>This shows I have a
menu.lst file in partitions 0 & 5 of hd0 (first HDD) and on the first partition of my third disk. So I reckon that the third disk is my flash drive but I want to confirm it, so
grub>
geometry (hd2) This gives me
drive 0x82: C/H/S = 500/255/63, The number of sectors = 8040448,
/dev/sdc Partition num: 0, Filesystem type is ext2fs, partition type 0x83
{Note: There may be other lines like the one above if there are other partitions on the device .... such as
Partition num: 1, Filesystem type is ext2fs, partition type 0x83}
I can see from this that the third disk is /dev/sdc and I can confirm that to be my flash drive by hovering the mouse over the icon on the desktop which will give me the device node of the drive. In my case it tells me it is /dev/sdc1. So now I am sure I can go ahead and install grub to the MBR of that drive.
grub>
root (hd2,0) <enter> -> this specifies the location of the files that Grub is to use when booting
grub>
setup (hd2) <enter> -> this installs Grub to the MBR of (hd2) which is /dev/sdc
When this completes and reports success, all is finished.
To change your flash stick to 2009.2 or .3 or later all that is required is to replace the isolinux folder and the livecd.sqfs file with the newer version.
Note: Without the fromusb code in the boot line the stick does not shut down properly. I do not know if its presence will affect correct booting in other situations ..... I have only a limited amount of hardware to try it on. I would appreciate it if others could check this out on their hardware. If the stick has a problem booting in any situation please first try removing the "fromusb" code from the boot line and then reboot.
Finally there is additional information below for those wishing to have more than one choice of OS on their flash drive. This explains how to configure the files to allow different versions of PCLOS to be bootable from the same flash stick.
Have fun!