[HOWTO] use the from=/path_to/porteus.iso cheatcode

When pointed to an .iso file, the from= cheatcode is designed to allow users to boot the Porteus ISO image directly from a hard drive or flash drive without extracting the full ISO image to disk. This comes in handy if you would like to quickly test out a new ISO image or if you have limited storage space (on a flash drive, for example) and don't want to have two copies of every module sitting around on disk.

In order to use this cheatcode, you need to have the kernel (/boot/syslinux/vmlinuz) and initrd (/boot/syslinux/initrd.xz) extracted from the ISO and placed in a location that can be seen by your bootloader. Your bootloader's config file must then be pointed to this kernel and initrd, as well as to the ISO image using the from=/path_to/porteus.iso cheatcode. Extracting the kernel and initrd can be done through a GUI using archival software (such as 7zip, winrar or wincdemu in windows), or from the CLI in Porteus using the commands below:

Open a terminal and execute these commands as root (modify the paths and file names to suit your needs):

mkdir -p /mnt/sdb2/linux-images/boot/

This will create a directory to hold the needed files. The ISO will go in /linux-images/, and the kernel and initrd will go in /linux-images/boot. The files don't have to be set up this way, but it helps keep things tidy.

cp /path/to/your/iso /mnt/sdb2/linux-images/latest-porteus.iso

This copies the ISO to your new directory. You can use mv instead of cp if you don't want to retain the ISO image in whatever location you've stored it.

mloop /mnt/sdb2/linux-images/latest-porteus.iso

This loop-mounts the ISO image and makes the contents available at /mnt/loop

cp /mnt/loop/boot/syslinux/vmlinuz /mnt/sdb2/linux-images/boot/
cp /mnt/loop/boot/syslinux/initrd.xz /mnt/sdb2/linux-images/boot/

This copies the kernel and initrd from the ISO to your new directory.

Once the files are in place, the most important thing is to make sure your bootloader is properly pointed to all three files (kernel, intird and ISO image). In this example, we have an existing Porteus installation on /dev/sdb2, so we're modifying an existing porteus.cfg file at /mnt/sdb2/boot/syslinux/porteus.cfg to add the following entry:

LABEL xconf
MENU LABEL KDE-Latest Porteus
KERNEL /linux-images/boot/syslinux/vmlinuz
APPEND initrd=/linux-images/boot/syslinux/initrd.xz from=/dev/sdb2/linux-images/latest-porteus.iso

TEXT HELP
Run Porteus the best way we can.
Try to autoconfigure graphics
card and use the maximum
allowed resolution
ENDTEXT

Save the config file, then reboot and select the new 'KDE-Latest Porteus' option from the SYSLINUX menu. The bootloader will load the kernel and initrd from the hard drive or flash drive (/dev/sdb2 in the example above) and then linuxrc will mount the ISO and load the xzm modules from it. Booting will continue from there as normal.


NOTES:

1) There should not be any line breaks between the cheatcodes in your config file; they must all be on the APPEND line.

2) The full path to the ISO is not required although it is recommended to avoid searching through all devices.

3) If you update your Porteus ISO to a newer version, you need to update the unpacked kernel and initrd so they match the kernel and initrd inside the ISO image.


A more complex example:

In this example we are using lilo to boot a porteus ISO from a hard disk with multiple partitions, with saved changes and a rootcopy directory on the hard disk. This is what the lilo.conf would look like:

# Porteus
label = Porteus
image = /boot/syslinux/vmlinuz-ps1
initrd = /boot/syslinux/initrd-ps.xz1
append = "from=/dev/sda5/iso_images/porteus-v1.2-x86_64.iso changes=/dev/sda4/porteus_changes rootcopy=/dev/sda4/porteus_rootcopy extramod=/dev/sda4/porteus_xzm login=root copy2ram nohd nocd"

 

 

[HOWTO] run multiple versions of Porteus from one partition

Many thanks to fanthom, who helped me sort this out!

This tutorial is aimed at installations on USB flash drives, done from within linux, but should be applicable in other cases as well with minor modifications. The real meat and potatoes of this HOWTO is in the porteus.cfg file, in step 7.  In the example below, 32-bit and 64-bit editions of Porteus are installed, but by following the same principles you could easily install other versions (for example, versions 1.1 and 1.2 side by side, etc.) as well as other live distributions.

1) First, you'll want to mount your device (this step is not necessary if your device is already mounted):

mkdir /mnt/sdXn
mount /dev/sdXn /mnt/sdXn

Where 'X' is the USB drive device letter and 'n' is the partition to which you're installing (in my case, this is sdb1).

2) Create three directories in the root of your device:

cd mnt/sdXn
mkdir boot
mkdir 32
mkdir 64

If you already have a /boot directory from your existing Porteus install, go ahead and leave it there, just create /32 and /64.  Note that the names of the /32 and /64 directories are arbitrary, and can be anything you like, as long as you properly reference them in your porteus.cfg file.

3)Copy the /boot and /porteus folders from each of the .iso files to their respective directories. I do this by mounting the .iso files on a loop, and then copy/pasting from my file manager (konqueror or dolphin). To mount an .iso on a loop, simply use the mloop command:

mloop /path/to/iso/isofilename.iso

From a linux distribution other than Porteus, you can use the following commands to mount an .iso on a loop:

mknod /dev/loop/142 b 7 142
#add an extra loop device, in case all of your loops are already mounted
mkdir /mnt/loop
mount -o loop /path/to/iso/isofilename.iso /mnt/loop

In both examples, you would replace the path and iso filenames with the actual file you wish to mount.

Once the .iso is mounted, you can then navigate to /mnt/loop in your file manager to copy and paste the /boot and /porteus folders.

After this step, you'll have the following directories on your drive:

/boot
/32/boot
/32/porteus
/64/boot
/64/porteus

4) If your boot directory in the root of the device (/mnt/sdXn/boot) was not already populated with files from a previous installation, copy and paste (do not cut and paste!) the contents of the boot folder from either /64/boot or /32/boot to /boot.  

5) If this drive is not already bootable from a previous porteus install, run the install script:

cd /mnt/sdXn/boot
./Porteus-installer-for-Linux.com

And follow the installation wizard's isntructions.

6) (optional) Reboot with the target USB device, to ensure it boots into the bootloader menu. At this point, however, it will not successfully get into Porteus because it has not been pointed to the proper files.

7) Boot back into a working operating system, mount the target device again, and open the following file in a text editor:

/mnt/sdXn/boot/syslinux/porteus.cfg

You will want to replace the contents of that file with the following (modified for the particulars of your installation), and save it:

PROMPT 0
TIMEOUT 90
DEFAULT /boot/syslinux/vesamenu.c32
MENU BACKGROUND /boot/syslinux/porteus.png
MENU TITLE Porteus-v2.0 64bit

MENU WIDTH 28
MENU MARGIN 2
MENU ROWS 10
MENU HELPMSGROW 17
MENU TIMEOUTROW 28
MENU TABMSGROW 15
MENU CMDLINEROW 22
MENU HSHIFT 4
MENU VSHIFT 5

   menu color screen   37;40      #00000000 #00000000 none
   menu color border   30;44      #00000000 #00000000 none
   menu color title   1;36;44    #ffA32F2F #30003f07 none
   menu color unsel   37;44      #ffBDC2D9 #00000000 none
   menu color hotkey   1;37;44    #ff8037b7 #00000000 none
   menu color sel      7;37;40    #ff111B78 #003f7fbf none
   menu color hotsel   1;7;37;40  #ffaf67f7 #003f7fbf none
   menu color scrollbar   30;44      #00000000 #00000000 none

   menu color tabmsg   31;40      #ffA32222 #00000000 none
   menu color cmdmark   1;36;40    #ffff0000 #00000000 none
   menu color cmdline   37;40      #ffffffff #ff000000 none
   menu color pwdborder   30;47      #ffff0000 #00000000 std
   menu color pwdheader   31;47      #ffff0000 #00000000 std
   menu color pwdentry   30;47      #ffff0000 #00000000 std
   menu color timeout_msg   37;40      #ff809aef #00000000 none
   menu color timeout   1;37;40    #ffb72f9f #00000000 none
   menu color help      37;40      #ff666C85 #00000000 none
   menu color msg07   37;40      #90ffffff #00000000 std


#64-bit entries

LABEL xconf
MENU LABEL 64-bit KDE
KERNEL /64/boot/syslinux/vmlinuz
APPEND initrd=/64/boot/syslinux/initrd.xz from=64 changes=/64/porteus
TEXT HELP
    Run 64-bit Porteus the best way we can.
    Try to autoconfigure graphics
    card and use the maximum
    allowed resolution
ENDTEXT

LABEL lxde
MENU LABEL 64-bit LXDE
KERNEL /64/boot/syslinux/vmlinuz
APPEND initrd=/64/boot/syslinux/initrd.xz from=64 changes=/64/porteus
TEXT HELP
    Run 64-bit Porteus the same as above.
    Lightweight LXDE to be
    launched as default desktop
ENDTEXT

LABEL fresh
MENU LABEL 64-bit KDE, Fresh
KERNEL /64/boot/syslinux/vmlinuz
APPEND initrd=/64/boot/syslinux/initrd.xz from=64
TEXT HELP
    Normally Porteus saves all changes
    to the /64/porteus/changes/ directory
    on the boot media (if writable)
    and restores them next boot.
    Use this option to start a fresh
    system, no changes are neither
    read nor written anywhere
ENDTEXT

LABEL text
MENU LABEL 64-bit Text mode
KERNEL /64/boot/syslinux/vmlinuz
APPEND initrd=/64/boot/syslinux/initrd.xz from=64 3
TEXT HELP
    Run 64-bit Porteus in textmode and start
    command prompt only
ENDTEXT

#32-bit entries:

LABEL xconf
MENU LABEL 32-bit KDE
KERNEL /32/boot/syslinux/vmlinuz
APPEND initrd=/32/boot/syslinux/initrd.xz from=32 changes=/32/porteus/save.dat
TEXT HELP
    Run 32-bit Porteus the best way we can.
    Try to autoconfigure graphics
    card and use the maximum
    allowed resolution
ENDTEXT

LABEL lxde
MENU LABEL 32-bit LXDE
KERNEL /32/boot/syslinux/vmlinuz
APPEND initrd=/32/boot/syslinux/initrd.xz from=32 changes=/32/porteus/save.dat
TEXT HELP
    Run 32-bit Porteus the same as above.
    Lightweight LXDE to be
    launched as default desktop
ENDTEXT

LABEL fresh
MENU LABEL 32-bit KDE, Fresh
KERNEL /32/boot/syslinux/vmlinuz
APPEND initrd=/32/boot/syslinux/initrd.xz from=32
TEXT HELP
    Normally Porteus saves all changes
    to the /32/porteus/changes/ directory
    on the boot media (if writable)
    and restores them next boot.
    Use this option to start a fresh
    system, no changes are neither
    read nor written anywhere
ENDTEXT

LABEL text
MENU LABEL 32-bit Text mode
KERNEL /32/boot/syslinux/vmlinuz
APPEND initrd=/32/boot/syslinux/initrd.xz from=32 3
TEXT HELP
    Run Porteus in textmode and start
    command prompt only
ENDTEXT

MENU SEPARATOR

LABEL plop
MENU LABEL PLoP BootManager
KERNEL /boot/plpbt
TEXT HELP
    Run the plop boot manager.
    This utility provides handy boot-USB options for
    machines with vintage/defective BIOS
ENDTEXT

LABEL memtest86
MENU LABEL Run Memtest utility
KERNEL /boot/mt86p
TEXT HELP
    Don't start Porteus at all, but
    rather run the MemTest utility
    to diagnose your computer's RAM
    for possible errors
ENDTEXT


Note that I've used a save.dat container file for my 32-bit changes file. You must use a container for your changes whenever you are installing to a FAT or NTFS filesystem. See this article for more information on save.dat containers.

I've removed the copy2ram and PXE options from this menu, as I rarely use them, but they could easily be left in if the user wants them. Just configure them in the same format.

After this, you should be able to boot into the device, and run either edition.

A final note: Using this setup, the /boot folder contains the configuration file, bootsplash, etc., for syslinux/extlinux, but the vmlinuz kernel and initrd file from this directory are not used. Syslinux/extlinux will boot the kernel and initrd from /32/boot or /64/boot. So, any changes to the boot menu (cheatcodes, boot options, booting to .iso, etc.) need to be made to the porteus.cfg file in /boot, and any changes to the kernel and/or initrd need to be made in /32/boot or /64/boot, respectively (with modifications to /boot/syslinux/porteus.cfg if you change the kernel or initrd's name).  This does get confusing with all of the folders named 'boot', but as you get familiar with how all of the pieces work together, it will make more sense.

Happy booting!


To view the conversation about this article, to ask a question or to make a suggestion, please visit this thread on our forum.

[HOWTO] Boot from a hard disk image file

Howto install porteus or other live cd/usb to NTFS or linux partition with original bootmenu.

NOTE: This article was written for an older version of Porteus, so some of the information (e.g., cheatcodes) are now out of date; this information is left here for reference purposes, if you have any troubles implementing this, please inquire on the Porteus forums.

Tested in slax-remix-v08 and porteus-v01-alpha.

If you are working in porteus-v01-alpha, please restart your system with 'max_loop=50' cheatcode before installation.

First step: create a directory called xlive in your favorite partition - in my case, this is NTFS /mnt/sda1/xlive.
Create a directory called porteus-v01-alpha in xlive - e.g. '/mnt/sda1/xlive/porteus-v01-alpha'.

Download the porteus.iso and extract it using the mount tool.

In console:

mkdir /mnt/tmp

mount -o loop /patchtoisofile/porteus.iso /mnt/tmp

 


Go to /mnt/tmp directory and copy the porteus directory to /mnt/sda1/xlive/porteus-v01-alpha.
Copy the boot directory to /root

In console:

umount /mnt/tmp

 


Download hard disk image (with syslinux 3.85) http://www.mediafire.com/file/oilhql3sgf7z42u/hd5M.img.tar.gz copy to /root directory and unpack:
tar -xvzf hd5M.img.tar.gz

Rename the file hd5M.img to porteus-alpha.img

In console:

cd /root

mkdir tmp
mount -o loop,offset=32256 porteus-alpha.img tmp

 


Go to the /root directory and copy the boot directory to tmp, then go to /root/tmp/boot and edit the porteus.cfg file to add the cheatcode parameters:
from_dev=/dev/sda1 from_dir=/xlive/porteus-v01-alpha.  For example, this is my porteus.cfg

LABEL xconf

MENU LABEL Graphics mode (KDE).
KERNEL /boot/vmlinuz
APPEND initrd=/boot/initrd.xz vga=791 autoexec=xconf;telinit~4 nomodeset from_dev=/dev/sda1 from_dir=/xlive/porteus-v01-alpha max_loop=50
TEXT HELP
Run Porteus the best way we can.
Try to autoconfigure graphics
card and use the maximum
allowed resolution
ENDTEXT
 
LABEL lxde
MENU LABEL Graphics mode (LXDE).
KERNEL /boot/vmlinuz
APPEND initrd=/boot/initrd.xz vga=791 autoexec=lxde;xconf;telinit~4 nomodeset from_dev=/dev/sda1 from_dir=/xlive/porteus-v01-alpha max_loop=50
TEXT HELP
Run Porteus the same as above.
Lightweight LXDE to be
launched as default desktop
ENDTEXT
 
LABEL fresh
MENU LABEL Always Fresh
KERNEL /boot/vmlinuz
APPEND initrd=/boot/initrd.xz autoexec=xconf;telinit~4 nomodeset from_dev=/dev/sda1 from_dir=/xlive/porteus-v01-alpha max_loop=50
TEXT HELP
Normally Porteus saves all changes
to the
on the boot media (if writable)
and restores them next boot.
Use this option to start a fresh
system, no changes are neither
read nor written anywhere
ENDTEXT
 
LABEL cp2ram
MENU LABEL Copy To RAM
KERNEL /boot/vmlinuz
APPEND initrd=/boot/initrd.xz vga=791 copy2ram autoexec=xconf;telinit~4 nomodeset from_dev=/dev/sda1 from_dir=/xlive/porteus-v01-alpha max_loop=50
TEXT HELP
Run Porteus the same as above,
but first copy all data to RAM
to get huge speed (needs >300MB)
ENDTEXT
 
LABEL startx
MENU LABEL Graphics VESA mode
KERNEL /boot/vmlinuz
APPEND initrd=/boot/initrd.xz autoexec=telinit~4 nomodeset from_dev=/dev/sda1 from_dir=/xlive/porteus-v01-alpha max_loop=50
TEXT HELP
Run Porteus with KDE, but skip
gfx-card config. Force 1024x768
using standard VESA driver
ENDTEXT
 
LABEL text
MENU LABEL Text mode
KERNEL /boot/vmlinuz
APPEND initrd=/boot/initrd.xz nomodeset from_dev=/dev/sda1 from_dir=/xlive/porteus-v01-alpha max_loop=50
TEXT HELP
Run Porteus in textmode and start
command prompt only
ENDTEXT

 


Save your porteus.cfg and in your console run:

umount tmp

 

 Now your porteus-alpha.img is ready to boot, first create boot directory in /mnt/sda1/xlive copy this image to /mnt/sda/xlive/boot


How to boot this image? With grub or Grub4Dos. If you are using grub, find your menu.lst and add:

title Porteus-v01-alpha from NTFS partition

fallback 1
map --mem (hd0,0)/xlive/boot/porteus-alpha.img (hd0)
map --hook
chainloader (hd0)+1
rootnoverify (hd0)
map --harddrives=1
boot

 


If you use only windows XP/vista/2008/7 you can download Grub4Dos here: http://sourceforge.net/projects/grub4dos/
Extract it and then copy the following to your C:\ directory:
grldr
menu.lst

Then edit your menu.lst.  Here is mine:

# This is a sample menu.lst file. You should make some changes to it.

# The old install method of booting via the stage-files has been removed.
# Please install GRLDR boot strap code to MBR with the bootlace.com
# utility under DOS/Win9x or Linux.
 
color blue/green yellow/red white/magenta white/magenta
timeout 30
default /default
 
title Porteus-v01-alpha from NTFS partition
fallback 1
map --mem (hd0,0)/xlive/boot/porteus-alpha.img (hd0)
map --hook
chainloader (hd0)+1
rootnoverify (hd0)
map --harddrives=1
boot
 
title slax-remix-v08 from NTFS partition
fallback 1
map --mem (hd0,0)/xlive/boot/remix-v08.img (hd0)
map --hook
chainloader (hd0)+1
rootnoverify (hd0)
map --harddrives=1
boot
 
title find and load NTLDR of Windows NT/2K/XP
fallback 2
find --set-root --ignore-floppies /ntldr
chainloader /ntldr
savedefault --wait=2
 
title find and load BOOTMGR of Windows VISTA
fallback 3
find --set-root --ignore-floppies /bootmgr
chainloader /bootmgr
savedefault --wait=2
 
title find and load CMLDR, the Recovery Console of Windows NT/2K/XP
fallback 4
find --set-root --ignore-floppies /cmldr
chainloader /cmldr
#####################################################################
# write string "cmdcons" to memory 0000:7C03 in 2 steps:
#####################################################################
# step 1. Write 4 chars "cmdc" at 0000:7C03
write 0x7C03 0x63646D63
# step 2. Write 3 chars "ons" and an ending null at 0000:7C07
write 0x7C07 0x00736E6F
savedefault --wait=2
 
title back to dos
quit
 
title reboot
reboot
 
title halt
halt

 

Last operation if you use windows XP you must edit boot.ini file.  Here is mine:

[boot loader]

timeout=5
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Home Edition" /noexecute=optin /fastdetect
c:\grldr="Start Grub4Dos"

For windows vista/2008/7 look at this excelent solution: http://diddy.boot-land.net/grub4dos/files/install_windows.htm

Porteus is now ready to boot from NTFS partition with the original bootmenu.  If you want to edit porteus.cfg please use mount tool.

If you want to add another livecd distro you must create another directory in xlive eg. slax-remix-v08 and copy to this directory only the slax folder with all subfolders, and then create slax-remix-v08.img image file for boot.  My menu.lst example above shows an entry for slax-remix-v08.

How to create a hard disk image file?

dd if=/dev/zero of=hd.img bs=1024k count=5

Creates a 5 MB hd.img file for adding syslinux.  I use qemu and win98.img floppy image.

Official Porteus Installation Guide

A copy of this document can also be found in the Porteus .iso file, at /boot/docs/install.txt
 


Contents:

Quick and Dirty Installation Instructions
Introduction
Downloading Porteus
Burning the Porteus iso to a CD or DVD
Installing Porteus to a USB Flash Drive (from Windows)
Installing Porteus to a USB Flash Drive (from Linux)
Installing Porteus to a Hard Drive
Appendix A:  Configuring your Boot Settings in BIOS
Appendix B:  Saving changes to a Windows Filesystem


Quick and Dirty Installation Instructions:

Porteus can be installed to a flash drive or hard drive by burning the ISO to a CD, booting from it, and then selecting 'Porteus Installer' from the system menu on your desktop.
 
If you already have an OS installed on that drive and want to keep it there, then you can run 'Porteus Installer' without clicking the option to install a bootloader.  After the files are copied over, you'll just need to point your existing bootloader to the Porteus data.
 
For more detailed information, as well as instructions to install Porteus to a USB drive from Windows, please keep reading.  You can also visit the Installation Documentation area of our website or the Installation Methods section of our forum. 


Introduction:

Porteus is a linux distribution that runs live, without being 'installed' natively like most other operating systems. Porteus creates its file system on the fly, within seconds, every time it is started up. This allows it to be run from many different kinds of media, including:

1) Writeable CD's or DVD's
2) USB Flash Drives (aka Pendrives)
3) External or Internal Hard Drives
4) Other writeable media, including flash cards, mp3 players, etc. (these installations are not covered by this Guide).

Porteus comes in the form of an ISO image file. An ISO file is an 'image' of what should be on a CD/DVD. This file can be burned as a CD or DVD, or it can be mounted as a file system or upacked to gain access to the files for flash drive or hard drive installations. Burning the file to a CD is the easiest method of installation, but none of the changes you make (or files that you download) will be saved once the system is rebooted*. Installing Porteus to a flash drive or hard drive will allow you boot up more quickly, save changes to your flashdrive and add new files and programs easily.

*Note that changes to your system can be saved to external media when running Porteus (from a CD or otherwise), using the 'changes=' cheatcode, and specifying the path to the desired storage location. You can find more information on this and many other useful cheatcodes in the file /boot/docs/cheatcodes.txt.


Downloading Porteus

Porteus is available for 32-bit (i486) and 64-bit (x86_64) architectures. If you are running a 64-bit computer system, then you can download either edition. If you are running a 32-bit system, then you must download the 32-bit edition. Both editions can be downloaded by going to http://www.porteus.org and clicking on the 'Download' button at the top of the page. From there, you can select your edition from the dropdown menus.

Once your download is complete, you should verify that the md5sum of the iso file matches the md5sum shown on the download page. This will ensure that the .iso file was not corrupted while being downloaded. If your md5sum does not match, you should delete the .iso file and download it again, or Porteus may not run properly. If you do not already have software to check the md5sum, you can use some freely available software, such as winMd5.



Burning an ISO file to a CD or DVD Disk

Most CD/DVD creation software has a function to 'burn an image to disk'. Please be aware that this is not the same as simply burning a file to disk or creating a 'data disk'. The end result should not be a disk that contains the .iso file, e.g. 'Porteus-v2.0-i486.iso'. The end result should be a disk that contains two folders: one called 'boot' and one called 'porteus'.

If your current CD/DVD creation software doesn't contain the function to 'burn an image to disk' then you can use some freely available software, such as imgburn.

Steps to install (varies by CD creation program):

Imae burn example1) Insert a blank writeable CD or DVD.

2) Start your CD/DVD creation software and select 'burn image' or 'burn image to disk'

3) Navigate to and select the Porteus .iso file

4) Burn the file to the disk.

5) Check the CD to make sure it contains the 'boot' and 'porteus' folders.

6) Reboot your computer, leaving the disk in your computer.

In order for your computer to run Porteus from the CD, you must make sure that your BIOS is set to boot to your CDROM device first, before booting to your hard disk. If you are unsure how to change the boot order in your BIOS, please see Appendix A.



Installing Porteus to a USB Flash Drive

As of Porteus Version 1.1, the officially supported method for installing Porteus to a flash drive or hard drive is to burn the ISO image to a CD following the instructions written above, then boot Porteus from the CD and run the program 'Porteus Installer', which can be found in the KDE, LXDE, Razor or Xfce menu under the 'System' heading. This program detects the available devices attached to your system and automates the installation procedure.

Note that you must have an existing, formatted partition for this installation to work.

If you would prefer to install without burning Porteus to a CD (either from Windows or from a Linux OS), then you can accomplish this by manually extracting the ISO and executing the relevant script to install the bootloader. To install using this method, please follow the instructions below:

 

From Windows:

See installation videos here

Porteus can be installed to a flash drive by copying the files from the .iso file to the flash drive and then making the drive bootable. Please note that you must be logged in as an administrator (or run the included 'Porteus-installer-for-Windows.exe' file with administrative priveleges) to make your drive bootable from Windows.

7zipIn order to install Porteus to a flash drive, you must first extract the porteus .iso file so that you can copy the included folders ('boot' and 'porteus') to your flash drive. This can be done with archival software, similar to unzipping a .zip file. If your existing archival software cannot extract an .iso file, then try installing the free application 7zip or winrar. Once installed, you can right click on the .iso file, choose 7zip from the right-click menu (or, open winrar and navigate to the .iso's location), and select the option to extract the file.

*NOTE* you can also use a program called wincdemu, which will allow you to double click on the .iso file and then access the folders inside it as if it were a CD mounted in your CD drive.

If you have already created a bootable Porteus CD, you can also insert that CD and copy the files from there.

Steps to install:

1) Insert your flash drive and open it to view the contents. Make a note of the Drive Letter assigned to this drive (e.g. E:\)

2) Copy the folders 'boot' and 'porteus' from the .iso file to the top-level directory of your flash drive (meaning the files should not be placed inside any other folders on the drive. For example, they should be located at E:\boot and E:\porteus, assuming your flash drive is device E:\).

3) Navigate into the boot folder that you just copied to your flash drive. You should see a file there called Porteus-installer-for-Windows.exe. Right click on this file (make sure it is Porteus-installer-for-Windows.exe and not Porteus-installer-for-Linux.com) and choose to run it as an administrator. A window will appear asking you to confirm that the correct drive or partition is beign selected for installation. Double check that the information shown is correct, and press Enter to complete the installation.

4) After running the installation program, you should be able to boot Porteus from your flash drive. Reboot your computer, and make sure that your BIOS is set to boot from the USB device first, before it boots to your hard disk. If you are unsure how to change the boot order in your BIOS, please see Appendix A. 

*NOTE* If you are having problems making your drive bootable from within Windows or if you do not have administrative priveleges, try burning Porteus to a CD or DVD using the instructions above, and then either run the 'Porteus Installer' program (which can be found in the KDE, LXDE, Razor or Xfce menu under the 'System' heading) or follow the instructions below to install Porteus to a USB flash drive from within Linux.

*NOTE* If your flashdrive is formatted with a Windows filesystem (e.g. FAT or NTFS), none of the changes you make to your system will survive between reboots (Porteus will default to "Always Fresh" mode).  If you would like to save your changes, you can create a '.dat' file container for this purpose. See Appendix B below for more information about this very important feature, which is required for saving your changes to a partition formatted with a Windows filesystem.


From Linux:


See installation videos here
*PLEASE NOTE* If you experience problems when running the Porteus installation scripts from your existing Linux distribution, please burn the Porteus ISO to a CD (see above instructions) and boot from that for the installation to USB.  The method described below should work from most Linux distrubutions, but full compatibility with every distribution is not guaranteed.

Installing Porteus through Linux is similar to installing through Windows. You must have root (super user) privileges on your system in order to run the installation script.

Before installing, you must extract or mount the .iso file in order to copy the /boot and /porteus directories to your target device. Some archiving programs are capable of extracting the .iso, or you can simply mount it with the following commands:

mkdir /mnt/loop
mount -o loop /path/to/file.iso /mnt/loop

If you are using Porteus for this installation, you can simply enter:

mloop /path/to/file.iso

And you can then navigate to /mnt/loop to access the necessary files. If you are running from a Porteus CD, you can navigate to /mnt/sr0/ and copy the files from there.

Steps to Install:

1) Insert your flash drive. If a window automatically pops up when you plug it in, click to open the device. This will mount your flash drive and you can see it's path by opening a console and typing:

mount

If the device is not mounted automatically, then you can open a console and type:

fdisk -l

to get the path of your flash drive (e.g., /dev/sdb1), and then:

mkdir /mnt/sdb1
mount /dev/sdb1 /mnt/sdb1

(substitute sdb1 with the name of your device if it was listed differently in fdisk)

Make note of the device's name, as this is the device which will need to be modified by a script later in the process.

2) Copy the files /boot and /porteus from the Porteus .iso file (or from a Porteus CD) to your flash drive. These folders can be placed in the top level directory on your drive, but as of Porteus version 2.0, you can place these folders inside a subdirectory and your bootloader configuration file will be adjusted automatically to boot from that location.

3) Open a console and change directories to the boot folder that you just copied into the flash drive, e.g.

cd /mnt/sdb1/boot

Execute the Porteus-installer-for-Linux.com script:

sh Porteus-installer-for-Linux.com

*NOTE* If you are not running as root already, you must use the su or sudo command and enter your root password before starting this script, or it will not be able to configure your device properly.

This script will ask you to confirm the drive or partition on which you are installing Porteus. Make sure the information displayed is correct, and then press Enter to complete the installation. The extlinux bootloader will be installed on devices that are formatted with ext2/3/4, FAT16/32, ntfs and btrfs filesystems. LILO will be installed on partitions formatted with any other filesystem.

4) After running the install script, you should be able to boot Porteus from your flash drive. Reboot your computer, and make sure that your BIOS is set to boot from the USB device first, before it boots to your hard disk. If you are unsure how to change the boot order in your BIOS, please see Appendix A.

*NOTE* If your flashdrive is formatted with a Windows filesystem (e.g. FAT or NTFS), none of the changes you make to your system will survive between reboots (Porteus will default to "Always Fresh" mode).  If you would like to save your changes, you can create a '.dat' file container for this purpose. See Appendix B below for more information about this very important feature, which is required for saving your changes to a partition formatted with a Windows filesystem.


Installations to Internal or External Hard Drives:


Porteus can be installed to hard drives, but it should be left in its compressed state (otherwise known as a 'Frugal' installation). Installing extracted files to a hard drive is not supported; it is suggested that you install Slackware Linux instead if you wish to have an Operating System installed to your system natively.

Creating a 'Frugal' installation is very similar to installing on a USB drive. Porteus can be installed on it's own partition, or it can be installed side by side with Windows or another Linux OS on the same partition.

If Porteus is the only Operating System that you are installing to a device (internal or external), follow the instructions given above for burning the ISO to a CD and booting from it, and then run the 'Porteus Installer' program, which can be found in the KDE, LXDE, Razor or Xfce menu under the 'System' heading.

You can also follow the instructions to manually unpack the ISO to your target device and run the lin_start_here or win_start_here scripts as described in the "Install to USB" section.

For directions on installing Porteus to a device that will also run other operating systems, please visit the documentation section and/or the community forum at the Porteus website, at http://porteus.org. These installations are highly variable depending on whether or not Windows needs to be installed on the device, and on what bootloader is used for the system.

*NOTE* If your drive is formatted with a Windows filesystem (e.g. FAT or NTFS), none of the changes you make to your system will survive between reboots (Porteus will default to "Always Fresh" mode).  If you would like to save your changes, you can create a '.dat' file container for this purpose. See Appendix B below for more information about this very important feature, which is required for saving your changes to a partition formatted with a Windows filesystem.


APPENDIX A: Configuring your boot settings in BIOS

In order to boot Porteus from a device other than your computer's hard drive, you must make sure that your BIOS is set to boot from that device before booting the first hard disk.

bios-settingsTo enter the BIOS of your machine, you will need to press a particular key during your computer's startup procedure. The exact key varies from computer to computer, but is typically shown briefly during startup, and it is usually one of the following keys:
F1, F2, F12, Esc, Tab, etc.

Once you press the specified key, you will be shown the BIOS menu. While in BIOS, the legend for using the keyboard is at the bottom of the screen. Inside the BIOS menu, you should look for your 'boot order' option, and set your desired device (CDROM or USB device) to the top of the list. Once you have changed your boot order, press F10 to save your changes and exit. If you are planning to boot to a USB device, make sure it is plugged in when you enter your BIOS, as some systems will only show the USB option when a USB device is present.

Many machines also have another key to press during startup that allows you to choose which device to boot from, without entering the BIOS. While this is very handy, at some stage you will probably want to change the BIOS setting so you don't have to keep pressing this button at every boot. Be aware if your machine contains sensitive data and is used by other people that leaving the setting to 'boot from USB' presents a security risk. Others could also plug in a device and boot to their own OS and access the information on your hard drive.

No Boot from USB in BIOS?

Don't panic just yet, you may still be able to boot from your USB device. Porteus contains a boot loader called Plop. Using this boot loader, you can plug in your USB device as well as a Porteus CD. Boot to the CD and when the Porteus menu comes up, highlight the Plop Boot Manager and press enter to start up Plop. Within Plop, you can select 'USB', and press enter to boot from the USB device.


Appendix B - Saving changes to a Windows Filesystem

Porteus allows users to save their changes (i.e., system settings, downloaded files, bookmarks, browser history, etc) to a folder or image file (aka container) that exists outside of Porteus' core files. The 'changes=' cheatcode parameter sets the location for these changes. When you start Porteus with this cheatcode (enabled by default for USB installations), it will boot up the operating system and then apply your changes from this location. By default, Porteus is set to save these changes to /porteus/changes.

If you are installing Porteus to a device that is formatted with a Windows filesystem (e.g. FAT 32, NTFS, etc), you are required to use a '.dat' container for your changes. This container allows you to retain linux permissions and symlinks, which are necessary for your system to run properly and securely. 

While starting up, Porteus will run a check to see if you are asking it to save changes directly to a device with a Windows filesystem.  If you are, then Porteus will boot without saved changes enabled.  To create a '.dat' container file and start saving your changes, boot Porteus into a GUI, then open up the menu and navigate to "System -> Porteus save file manager" (NOTE:  You can also access this program through "Porteus Settings Centre", which will help you to customize various settings, including creation of a save.dat).  Click on this application to open it, and click on the "Create" button.  It will ask you for the name, size and location where you want to create it .  You can choose any name you like, for example, porteussave, save, mychanges, etc (upon creation, the .dat suffix will be added).  You must then enter the size of the container in megabytes and the location on disk (e.g. /mnt/sdb1/porteus/, if sdb1 is your desired storage device), then click 'OK' and it will be created and placed on your storage device.  In order to start saving your changes, you will need to make a simple modification to the file that configures your bootup procedure.   The save.dat manager will walk you through these changes, but just in case, here are the necessary steps to peform this manually:

As root, open the file /boot/syslinux/porteus.cfg. You will have several entries in this file, which look like this:

LABEL xconf
MENU LABEL Graphics mode (KDE).
KERNEL vmlinuz
APPEND initrd=initrd.xz changes=/porteus/
TEXT HELP
Run Porteus the best way we can.
Try to autoconfigure graphics
card and use the maximum
allowed resolution
ENDTEXT

LABEL lxde
MENU LABEL Graphics mode (LXDE).
KERNEL vmlinuz
APPEND initrd=initrd.xz lxde changes=/porteus/
TEXT HELP
Run Porteus the same as above.
Lightweight LXDE to be
launched as default desktop
ENDTEXT


You will need to edit the end of the APPEND line, to make it read 'changes=/porteus/save.dat' (without the quotes, using the name you specified earlier). Save this file and upon reboot your changes will be saved to this container.

*NOTE* If you need to gain access directly to the files in your save.dat container (if, for example, you boot into 'Always Fresh' mode and need to remove or edit one of your saved files), you can mount the container on a loop, using these commands in a console:

mkdir /mnt/loop
mount -o loop /mnt/live/mnt/sdXN/save.dat /mnt/loop

where sdXN is the name of your device, e.g. sdb1.

You will then have access to these files, in /mnt/loop


Thanks for using Porteus!

Install Linux on U3 USB drive

Yesterday i made some tests with my SandDisk Cruzer 16GB USB pendrive, this is what i discovered (i know, most of you already know that, but for the others that could be interesting): 

  1. U3 pendrives are made by a CD-like read-only partition + a mass storage device (USB pendrive)
  2. They appear as 2 different devices (/dev/sr1 and /dev/sdxY)
  3. The memory is shared between the CD and the memory, so, the bigger is the CD, the smaller is the free Memory
  4. You can replace the ISO image on your pendrive with an ISO of your choice (with u3-tool), and it will appear as a real CD device
  5. The CD device can be booted as a normal CD, probably also on devices which don't allow boot from USB, anyway not sure about that (not on APPLE stuff, tested)
  6. The CD part is readonly, (i.e. noobproof, you can borrow it to anyone, and they will not accidentally delete your slax nor boot folder)
  7. The ID (/dev/disk/by-id/*) of the CD device is similar to the ID of the mass storage part (i.e. the pendrive partition can be easily recognized by any script)


How-to (assuming you don't have any encrypted partition on your pendrive):

DISCLAMER: if you don't know what commands mean, don't do it, this could destroy you computer, your fridge, and even your microwave oven. :evil:

  1. Make | take an ISO of your preferred live distro
  2. Insert your U3 pendrive into your computer
  3. Backup ALL the data on your pendrive, they will be lost after this process
  4. # u3-tool -i /dev/sdxY (where sdxY is your u3 pendrive)
  5. # u3-tool -p XXXXXXXXX /dev/sdxY (where XXXXXXXX is the size in bytes of your ISO (may be something more than the size, you can get the size with "ls -l YOUR_ISO.iso")
  6. u3-tool -l YOUR_ISO.iso /dev/sdxY
  7. wait for the process to finish --> your CD is ready, now you have to partition the memory device according to the new size
  8. # fdisk /dev/sdx
  9. create a fat32 partition on the device (maximum size)
  10. save the new partition table
  11. # mkfs.vfat /dev/sdxY
  12. enjoy your customized CD+USB pendrive