From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.54) id 1EvNVE-0008VE-Am for garchives@archives.gentoo.org; Sat, 07 Jan 2006 23:29:40 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.5/8.13.5) with SMTP id k07NTMnG002177; Sat, 7 Jan 2006 23:29:22 GMT Received: from smtp.gentoo.org (smtp.gentoo.org [134.68.220.30]) by robin.gentoo.org (8.13.5/8.13.5) with ESMTP id k07NTKwX009141 for ; Sat, 7 Jan 2006 23:29:21 GMT Message-Id: <200601072329.k07NTKwX009141@robin.gentoo.org> Received: from lark.gentoo.osuosl.org ([140.211.166.177] helo=lark.gentoo.org) by smtp.gentoo.org with smtp (Exim 4.54) id 1EvNUu-0003rX-Gh for gentoo-doc-cvs@lists.gentoo.org; Sat, 07 Jan 2006 23:29:20 +0000 Received: by lark.gentoo.org (sSMTP sendmail emulation); Sat, 7 Jan 2006 23:29:20 +0000 From: "Lukasz Damentko" Date: Sat, 7 Jan 2006 23:29:20 +0000 To: gentoo-doc-cvs@lists.gentoo.org Subject: [gentoo-doc-cvs] cvs commit: liveusb.xml Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-doc-cvs@gentoo.org Reply-to: docs-team@lists.gentoo.org X-Archives-Salt: a173737a-ea6e-4145-a9f0-9846ff62c819 X-Archives-Hash: f674aa6c4158d9dd8b7c4b8e5dc85f7b rane 06/01/07 23:29:20 Added: xml/htdocs/doc/en liveusb.xml Log: #118179, Gentoo LiveUSB installation HOWTO Revision Changes Path 1.1 xml/htdocs/doc/en/liveusb.xml file : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/liveusb.xml?rev=1.1&content-type=text/x-cvsweb-markup&cvsroot=gentoo plain: http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/liveusb.xml?rev=1.1&content-type=text/plain&cvsroot=gentoo Index: liveusb.xml =================================================================== Gentoo Linux LiveUSB HOWTO Henrik Brix Andersen This HOWTO explains how to create a Gentoo Linux LiveUSB or, in other words, how to emulate a Gentoo Linux Installation CD using an USB flash drive. 1.0 2006-01-04 Introduction
The LiveUSB

This HOWTO explains how to create a Gentoo Linux LiveUSB or, in other words, how to emulate a Gentoo Linux Installation CD using an USB flash drive. This is particularly useful for installing Gentoo Linux on a modern laptop with no CD-ROM drive.

Although the instructions found in this document aims at emulating a Gentoo Linux Installation CD using an USB flash drive, they should work for any arbitrary block device as long as you adjust the device names accordingly.

Prerequisites

In order to use a Gentoo Linux LiveUSB you need the following:

  • Bootable USB flash drive (at least 64MB)
  • x86 computer with support for booting from USB

You will also need access to the following for creating the LiveUSB:

  • A computer running Gentoo Linux (or alternatively another Linux distribution)
Preparing the USB flash drive
Partitioning the drive These instructions will erase all data from the USB flash drive. Make sure to backup your data first. This HOWTO assumes that the /dev/sda device node corresponds to your USB flash drive. If you have other SCSI-like devices make sure to use the correct device node.

Create a FAT32 partition on your USB flash drive and mark it bootable using fdisk. An example partitioning scheme can be seen below:

# fdisk -l /dev/sda

Disk /dev/sda: 1048 MB, 1048313856 bytes
33 heads, 61 sectors/track, 1017 cylinders
Units = cylinders of 2013 * 512 = 1030656 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1017     1023580    b  W95 FAT32
Creating the filesystem

Create a FAT32 filesystem on the USB flash drive using mkdosfs:

(Make sure you have sys-fs/dosfstools installed)
# emerge -av sys-fs/dosfstools
# mkdosfs -F 32 /dev/sda1
mkdosfs 2.11 (12 Mar 2005)
Installing a Master Boot Record

Install the precompiled Master Boot Record (MBR) from syslinux on the USB flash drive:

(Make sure you have sys-boot/syslinux-3.00 or later installed)
# emerge -av '>=sys-boot/syslinux-3*'
# dd if=/usr/lib/syslinux/mbr.bin of=/dev/sda
0+1 records in
0+1 records out
Copying the files
Mounting the Gentoo Linux Installation CD

Download the install-x86-minimal-2005.1-r1.iso file from your local Gentoo Linux mirror site and mount the ISO image on /mnt/cdrom/ as shown below:

(Create the /mnt/cdrom/ mount point if needed)
# mkdir -p /mnt/cdrom
# mount -o loop,ro -t iso9660 install-x86-minimal-2005.1-r1.iso /mnt/cdrom/
Mounting the LiveUSB

Mount the newly formatted USB flash drive on /mnt/usb/ as shown below:

(Create the /mnt/usb/ mount point if needed)
# mkdir -p /mnt/usb
# mount -t vfat /dev/sda1 /mnt/usb/
Copying the files

Copy the files from the Gentoo Linux Installation CD to the LiveUSB. The files needs to be reordered a bit as we will be using the syslinux bootloader instead of isolinux:

# cp -r /mnt/cdrom/* /mnt/usb/
# mv /mnt/usb/isolinux/* /mnt/usb/
# mv /mnt/usb/isolinux.cfg /mnt/usb/syslinux.cfg
# rm -rf /mnt/usb/isolinux*

(The memtest86 kernel needs to be renamed for loading it via syslinux)
# mv /mnt/usb/memtest86 /mnt/usb/memtest

You can now unmount the ISO image:

# umount /mnt/cdrom/
Adjusting the bootloader configuration

Adjust the syslinux configuration file using sed as shown below. The scandelay=10 parameter will introduce a 10 seconds delay before attempting to mount the filesystem. This is needed to allow the USB flash drive to settle upon detection.

# sed -i \
    -e "s:cdroot:cdroot scandelay=10:" \
    -e "s:kernel memtest86:kernel memtest:" \
    /mnt/usb/syslinux.cfg
Consider adding docache to the boot parameters. This will allow running umount /mnt/cdrom/ after booting so that you can unplug the USB flash drive.
Installing a bootloader
Unmounting the drive

Make sure you unmount the USB flash drive drive before installing the bootloader:

# umount /mnt/usb/
Installing syslinux

Finally install the syslinux bootloader on the USB flash drive:

# syslinux /dev/sda1
You will need to rerun syslinux /dev/sda1 each time you modify the syslinux.cfg file for the configuration changes to take affect.
Using the LiveUSB
Booting

Insert the USB flash drive and turn on the computer, making sure the BIOS is set to boot from USB. If all goes well you should be presented with a standard syslinux prompt.

You should be able to follow the generic installation instructions found in the Gentoo Handbook from here on.

-- gentoo-doc-cvs@gentoo.org mailing list