Installation of Red Hat from a USB drive
Notes:
You can use rewritable DVD to add files to the standard installation
ISO (for example kickstart files) but the USB hard drive is faster, that
can hold multiple DVD images. That makes it more flexible. The key idea
is to use Red Hat kickstart. And making modifications on-the-fly is not
a problem. In other words using rewritable DVD is a bad idea.
You can set up multiple installation tasks on a single USB drive, limited
only by your: device’s space: 80 GB drive can hold enough images to cover
all cases that can be found in a pretty large corporation :-). For
large-scale deployments, consider the use of PXE boot. Please note that
USB flashdrives are slower and usually has less capacity that USB harddrives.
The USB drive is in many ways ideal for field
support. It is portable, fast, easy to modify and can perform
a wide variety of pre-execution tasks—including firmware deployment, diagnostics,
backup and recovery—in addition to OS installation.
Finally, some of the techniques described here cover the operation of
the SYSLINUX bootloader and its menu system. These are good techniques to
learn, as SYSLINUX also supports boot via CD-ROM (ISOLINUX) and network-based
PXE boot (PXELINUX). With a few exceptions, the SYSLINUX bootloaders work
the same way across all the media types. So, learning to work with SYSLINUX
will help you build custom boot media, regardless of which media type is
best suited for the task.
WARNING: In Linux, a USB drive is “enumerated” just like a HDD,
typically with a designation like /dev/sdb, /dev/sdc, etc.
Make sure you properly identify which disk is your USB drive! In most cases
you will be performing these operations as root and it is very easy to overwrite
the contents of a HDD by writing directly to the device file. See
Sysadmin Horror Stories for some sysadmin
tales. Like Beetles aptly noted even before Unix was invented: "Yesterday was such
an easy game to play."
To help identify
the device assignment, tail the /var/log/messages file when inserting
the USB drive:
[root@ss1 ~]# tail -f /var/log/messages
Nov 5 13:36:39 ss1 kernel: usb 1-4: new high speed USB device using address 26
Nov 5 13:36:39 ss1 kernel: scsi27 : SCSI emulation for USB Mass Storage devices
Nov 5 13:36:39 ss1 kernel: Vendor: Model: Patriot Memory Rev: PMAP
Nov 5 13:36:40 ss1 kernel: Type: Direct-Access ANSI SCSI revision: 02
Nov 5 13:36:43 ss1 kernel: SCSI device sdc: 16121856 512-byte hdwr sectors (8254 MB)
Nov 5 13:36:43 ss1 kernel: sdc: Write Protect is off
Nov 5 13:36:43 ss1 kernel: sdc: Mode Sense: 23 00 00 00
Nov 5 13:36:43 ss1 kernel: sdc: assuming drive cache: write through
Nov 5 13:36:43 ss1 kernel: sdc: sdc1
Nov 5 13:36:43 ss1 kernel: Attached scsi removable disk sdc at scsi27, channel 0, id
0, lun 0
Nov 5 13:36:43 ss1 kernel: USB Mass Storage device found at 26
Nov 5 13:36:43 ss1 scsi.agent[29350]: disk at
/devices/pci0000:00/0000:00:1d.7/usb1/1-4/1-4:1.0/host27/target27:0:0/27:0:0:0
Nov 5 13:36:43 ss1 fstab-sync[13220]: added mount point /media/usbdisk for /dev/sdc1
This sample output was generated on a system that already had two HDDs
installed, so the USB drive is enumerated as /dev/sdc. But this will
vary from system to system so BE CAREFUL.
WARNING: Make sure the filesystem is unmounted and all data has been
written to USB drive before removing the device from the USB port. Due to
Linux disk caching and “lazy writes”, some commands will appear to complete
before the write operations are truly done. Removing the device in mid-write
can corrupt the contents of the USB drive or, in some circumstances, even
crash your system! If in doubt, issue a Linux sync command
before removing the USB connection.
We will discuss how to prepare the USB drive in Linux. It is also possible
to perform the operations in MS Windows. However, Linux provides a rich
set of native tools that allow you to perform all the necessary operations
with any additional software, and the tools provide a good deal of visibility.
In Windows, you will need a separate utility to perform some of the
operations and visibility is somewhat limited. You will need Red Hat
Linux installation media in either CD-ROM or DVD-ROM ISO image format
Selecting the bootloader
You have two options:
- If you use Ext3 filesystem you can use Grub. If is flexible enough
to pass parameters to kickstart.
- If you use FAT32 you need to use Syslinux.
As Grub is well documented we will describe here using SYSLINUX.
While SYSLINUX is
bundled with most popular Linux distributions, it is recommended to use
the latest version posted by
The Syslinux Project. RPM packages are available from a number of sources,
including
kernel.org (Hans Peter Anvin(HPA), the author of SYSLINUX is a well-known
kernel developer, co-webmaster of Kernel.org). You need the correct package
for your distribution (“i386” => 32-bit; “x86_64” => 64-bit).
To install:
rpm -ihv syslinux-4.04-1.el4.rf.x86_64.rpm
To upgrade from a previous version:
rpm -Uhv syslinux-4.04-1.el4.rf.x86_64.rpm
Note: Starting with v.3.52, SYSLINUX has a dependency on “perl-Crypt-PasswdMD5”
so you may need to install that package first.
Mounting and unmounting your USB drive
For the first few operations below, your USB drive’s filesystem should
be in an unmounted state. However, Linux hotplug may automatically
mount your filesystem as soon as the device is inserted. If this happens
you should see a message in the /var/log/messages file (as shown
above).
If in doubt,
- To check:
# mount
/dev/sdc1 on /media/usbdisk type vfat \
(rw,nosuid,nodev,sync,noatime,fscontext=system_u:object_r:removable_t)
- To unmount: umount /media/usbdisk
- To mount manually: mount /dev/sdc1 /media/usbdisk
Using your USB drive’s existing partitioning and formatting
In most cases your USB drive’s original partitioning and formatting will work fine, and all
you’ll need to do is follow the steps to make the device bootable. FAT32 should be used.
- The MBR must contain a valid partition table with at least one (and
typically just one) primary partition
- The filesystem must be formatted FAT32 . The “partition ID” must
match with filesystem contained within the partition, typically: “0x6”
(FAT16), “0xe” (FAT16-LBA), “0xb” (FAT32) or “0xc” (FAT32-LBA)
To make the device bootable there are two additional conditions, which
are commonly NOT met with the as-shipped configuration:
- The MBR must contain generic “boot code” In most cases the
factory formatting will NOT include generic boot code. You can try examining
the contents of the MBR with the Linux command:
hexdump -C /dev/sdc | more
You may be able to discern if boot code is present by looking for
such telltale strings as “Missing operating system”, “Operating system
load error”, etc. However, the only to way to be sure is to try booting
from the USB drive. If you install the SYSLINUX bootloader as described
below and your USB drive still won’t boot, chances are the MBR boot
code is missing (or the partition active flag has not been set).
To install the SYSLINUX generic MBR boot code:
dd conv=notrunc bs=440 count=1 if=mbr.bin of=/dev/sdX
In general, any operation that writes to the MBR can potentially
destroy existing data on the drive, if it overwrites the partition table
at the end of the MBR. However, since the SYSLINUX bootcode file
mbr.bin is only 440 bytes long (less than the full 512 bytes of
the MBR) the following procedure should NOT overwrite the partition
table and is generally safe. Still, having a backup is never a bad idea.
- The first partition must be bootable (i.e. the “active” flag
must be set)
To check if your partition boot flag is set “active”, run fdisk
and print the partition table. (Note: for brevity, some extraneous
info is deleted from the fdisk output below. See Appendix B for
complete examples.):
Command (m for help): p
Disk /dev/sdc: 8254 MB, 8254390272 bytes
16 heads, 32 sectors/track, 31488 cylinders
Units = cylinders of 512 * 512 = 262144 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 31488 8060912 c W95 FAT32 (LBA)
The “Boot” column is empty, indicating the boot flag is not set.
Set it as follows, then reprint the partition table:
Command (m for help): a
Partition number (1-4): 1
Command (m for help): p
Disk /dev/sdc: 8254 MB, 8254390272 bytes
16 heads, 32 sectors/track, 31488 cylinders
Units = cylinders of 512 * 512 = 262144 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 * 1 31488 8060912 c W95 FAT32 (LBA)
Now, write the partition table (commit the changes) and exit:
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
Installing the bootloader
This step will install the SYSLINUX boot code to the Partition Boot Record
(PBR) and will install the bootloader file ldlinux.sys to the root
directory:
syslinux /dev/sdc1
Note the use of “sdc1 ” here, as we are performing these operations on
the first partition. If you use “sdc” by mistake you will overwrite your
MBR! Now, mount your partition:
mount /dev/sdc1 /media/usbdisk
and copy the menu.c32 file to the root directory. This is the
SYSLINUX “com32” file that supports the simple menu system:
cp -p /usr/lib/syslinux/menu.c32 /media/usbdisk/
Your drive should now be bootable.
Copying the Red Hat installation media
Now you are ready to copy the installation media to the USB drive. You
can use either the CD-ROM or DVD-ROM ISO images (remember: FAT32 is required
for files > 2 GB). Because you are creating a custom boot disk,
you will need to extract the Anaconda installer files vmlinuz
and initrd.img from the installation
media.
These can be found in the “/isolinux” directory on the DVD-ROM ISO, or
on disc #1 of the CD-ROM ISO image set.
The vmlinuz and initrd.img files can reside anywhere on
the USB drive as long as they are properly referenced in the syslinux.cfg
file. However, you may want to create a tree directory structure to
help organize the files. This will allow you to store the files from multiple
Linux versions without having to rename them.
The files are relatively small, and saving a copy will prevent you from
having to extract the files again in the future. For example:
# tree /media/usbdisk/li/
/media/usbdisk/li/
|-- RHEL6
| |--i386
| | |-- initrd.img
| | `-- vmlinuz
| `-- x86_64
| |-- initrd.img
| `-- vmlinuz
`-- RHEL5.6
|--i386
| |-- initrd.img
| `-- vmlinuz
`-- x86_64
|-- initrd.img
`-- vmlinuz
Remember, typical USB drive has space for several dozens of DVD ISO images.
Note: You MUST use the correct vmlinuz and initrd.img files
for the Linux version you wish to install. Files from a different “point
release” (e.g. RHEL 5.5 vs. RHEL 5.6) and technology (i386 vs. x86_64) will
NOT work. The Anaconda installer will boot but when it goes to read the
installation media from the ISO it will complain you have the wrong version
and abort.
Use the following commands to loopback-mount the ISO image and copy the
necessary files to the USB drive:
mkdir loop
This example is for RHEL 5.1, x86_64 version:
mount -o loop RHEL5.1-Server-x86_64-DVD.iso loop
mkdir /media/usbdisk/li/RHEL5.1
mkdir /media/usbdisk/li/RHEL5.1/x86_64
cp -p loop/isolinux/vmlinuz /media/usbdisk/li/RHEL5.1/x86_64/
cp -p loop/isolinux/initrd.img /media/usbdisk/li/RHEL5.1/x86_64/
umount loop
Now copy the complete DVD ISO image:
cp -p RHEL5.1-Server-x86_64-DVD.iso /media/usbdisk/
Creating the SYSLINUX menu file
You can easily set up custom installation tasks using SYSLINUX menus.
The file that governs the operation of the boot menu is syslinux.cfg.
For a full description of this file refer to the SYSLINUX documentation
at: http://syslinux.zytor.com/faq.php. A sample file is provided in Appendix
A.
Here are two sample stanzas from syslinux.cfg:
## -- Manual install of RHEL 5.1...
LABEL RHEL5.1
MENU LABEL RHEL AS 5.1 Manual Install
KERNEL li/RHEL5.1/x86_64/vmlinuz
APPEND linux load_ramdisk=1 initrd=li/RHEL5.1/x86_64/initrd.img
## -- Kickstart install of RHEL 5.1...
LABEL RHEL5.1_KS
MENU LABEL RHEL AS 5.1 Kickstart Install
KERNEL li/RHEL5.1/x86_64/vmlinuz
APPEND linux load_ramdisk=1 initrd=li/RHEL5.1/x86_64/initrd.img method=hd:sdb1:/ ks=hd:sdb1:/ks.cfg
- LABEL is the unique identifier for that stanza.
- MENU LABEL is the string that will appear in the boot menu. KERNEL
is the path to the Anaconda installer kernel file.
- APPEND passes boot-time parameters to the kernel, including the
path to initrd.img. The parameters pertinent to USB drive installation
are
- “method=”, which specifies the location of the installation
media (ISO images)
- and “ks=”, which points to the kickstart file.
The syntax should be fairly self-explanatory. Note the use of “sdb1”
here rather than “sdc1”. This is because the system we are INSTALLING TO
has only one fixed HDD installed, whereas the system we built our USB key
on had two HDDs. This points out an important caveat:
it may take a bit of experimentation to determine
how the USB drive is enumerated on a given system.
And obviously, the system you used to build the USB drive may have no
bearing on the system on which you intend to install Linux. If in doubt,
run through a manual install first to help identify your devices, then edit
your syslinux.cfg if necessary.
To copy the completed file to the USB drive:
cp -p syslinux.cfg /media/usbdisk/
Finally, note how flexible the SYSLINUX menu file is. You can set up
multiple installation tasks for different versions of Linux or for different
variations of the install method.
Using Kickstart
You can create an unattended installation task using Red Hat Kickstart.
A kickstart file is essentially a “response file” for the Anaconda installer;
it contains all the data you would normally enter during an interactive
install. (For a more detailed description of kickstart see: Kickstart
A sample file is provided below
Remember, because you have the ability to set up multiple installation
tasks in syslinux.cfg, you can create both manual and automated installation
tasks against the same set of media. So just because you have a kickstart
file on the drive does not mean you have to use it in every case.
cp -p ks.cfg /media/usbdisk/
At this point your root directory should look something like this: (Note
this is an 8GB USB drive so it has room for both versions of RHEL):
ls -l /media/usbdisk/
total 5903312
-rwxr-xr-x 1 root root 3902 Nov 5 23:10 ks.cfg
-r-xr-xr-x 1 root root 10827 Nov 5 20:46 ldlinux.sys
drwxr-xr-x 4 root root 4096 Nov 5 20:48 li
-rwxr-xr-x 1 root root 36108 Sep 26 18:01 menu.c32
-rwxr-xr-x 1 root root 3515662336 Oct 17 23:47 RHEL5.1-Server-x86_64-DVD.iso
-rwxr-xr-x 1 root root 2141 Nov 5 20:52 syslinux.cfg
Appendix A – Sample configuration files
Sample SYSLINUX menu file (syslinux.cfg):
DEFAULT menu.c32
MENU TITLE Linux Installation Boot Menu
## -- Manual install of RHEL 4.4...
LABEL RHEL4.4
MENU LABEL RHEL AS 4.4 Manual Install
KERNEL li/RHEL4.4/i386/vmlinuz
APPEND linux load_ramdisk=1 initrd=li/RHEL4.4/i386/initrd.img
## -- Kickstart install of RHEL 4.4...
LABEL RHEL4.4_KS
MENU LABEL RHEL AS 4.4 Kickstart Install
KERNEL li/RHEL4.4/i386/vmlinuz
APPEND linux load_ramdisk=1 initrd=li/RHEL4.4/i386/initrd.img \
method=hd:sdb1:/ ks=hd:sdb1:/ks.cfg
## -- Linux Rescue mode - RHEL 4.4...
LABEL RHEL4.4_Rescue
MENU LABEL RHEL AS 4.4 Linux Rescue mode
KERNEL li/RHEL4.4/i386/vmlinuz
APPEND linux rescue load_ramdisk=1 initrd=li/RHEL4.4/i386/initrd.img \
method=hd:sdb1:/ ks=hd:sdb1:/ks.cfg
## -- Manual install of RHEL 5.1...
LABEL RHEL5.1
MENU LABEL RHEL AS 5.1 Manual Install
KERNEL li/RHEL5.1/x86_64/vmlinuz
APPEND linux load_ramdisk=1 initrd=li/RHEL5.1/x86_64/initrd.img
## -- Kickstart install of RHEL 5.1...
LABEL RHEL5.1_KS
MENU LABEL RHEL AS 5.1 Kickstart Install
KERNEL li/RHEL5.1/x86_64/vmlinuz
APPEND linux load_ramdisk=1 initrd=li/RHEL5.1/x86_64/initrd.img \
method=hd:sdb1:/ ks=hd:sdb1:/ks.cfg
## -- Linux Rescue mode - RHEL 5.1...
LABEL RHEL5.1_Rescue
MENU LABEL RHEL AS 5.1 Linux Rescue mode
KERNEL li/RHEL5.1/x86_64/vmlinuz
APPEND linux rescue load_ramdisk=1 initrd=li/RHEL5.1/x86_64/initrd.img \
method=hd:sdb1:/ ks=hd:sdb1:/ks.cfg
Sample Red Hat Kickstart file (ks.cfg):
# ====================================================================
# Kickstart configuration file for Red Hat
# ====================================================================
# --------------------------------------------------------------------
# Select install (default) or upgrade...
# --------------------------------------------------------------------
# upgrade
install
# --------------------------------------------------------------------
# Enable interactive or autostep installation...
# --------------------------------------------------------------------
# interactive
autostep
# --------------------------------------------------------------------
# System language, language modules, keyboard...
# --------------------------------------------------------------------
lang en_US
langsupport --default=en_US
keyboard us
# --------------------------------------------------------------------
# Comment out to prevent from being prompted for "Installation number",
# RHEL 5 only!
# --------------------------------------------------------------------
# key --skip
# --------------------------------------------------------------------
# X11 configuration...
# --------------------------------------------------------------------
# xconfig --vsync 80-85 --resolution 1024x768 --depth 24 --startxonboot --
defaultdesktop gnome
xconfig --resolution 1280x1024 --depth 24
# --------------------------------------------------------------------
# Network configuration...
# --------------------------------------------------------------------
network --device eth0 --bootproto dhcp
# network --bootproto=static --ip=192.168.0.29 --netmask=255.255.255.0 --
gateway=192.168.0.1 --nameserver=192.168.0.1
# --------------------------------------------------------------------
# Set root password...
# --------------------------------------------------------------------
rootpw passw0rd
# --------------------------------------------------------------------
# Timezone, firewall, use shadow file with md5 hash...
# --------------------------------------------------------------------
timezone America/New_York
firewall --disabled
authconfig --enableshadow --enablemd5
# ====================================================================
# Disk Partitioning (comment out this entire section for "upgrade")...
# ====================================================================
# --------------------------------------------------------------------
# Force Anaconda to ignore the USB drive...
# --------------------------------------------------------------------
© 2007 IBM, Version 2.0, Nov 26, 2007 http://w3-03.ibm.com/support/techdocs/atsmastr.nsf/Web/Techdocs Page 23
This guide is intended as a personal productivity tool. It is not intended to be comprehensive and is provided for guidance only, on
an ‘as is’ basis, without warranty of any kind. Please be aware that its contents have not been certified by IBM.
ignoredisk --drives=sdb
# --------------------------------------------------------------------
# Force grub to treat the real HDD as first in the BIOS boot order
# (drive 0x80) even though the system is currently booted from the USB stick.
# --------------------------------------------------------------------
bootloader --driveorder=sda
# --------------------------------------------------------------------
# Clear the Master Boot Record...
# --------------------------------------------------------------------
zerombr yes
# --------------------------------------------------------------------
# Clear all partitions (UNCOMMENTING THIS LINE WILL DELETE ALL PARTITIONS!!!).
# --------------------------------------------------------------------
clearpart --all --initlabel
# --------------------------------------------------------------------
# Partitioning scheme...
# --------------------------------------------------------------------
# part /boot --fstype ext3 --size 75 --asprimary
# part swap --recommended
# part / --fstype ext3 --size 2700 --grow
# --------------------------------------------------------------------
# Use auto partitioning...
# --------------------------------------------------------------------
autopart
# ====================================================================
# Package selection...
# ====================================================================
%packages
Test and deployment
At this point you should have a bootable USB drive capable of installing
Red Hat Linux. In general, installing from USB drive is not much different
than installing from any other media type. In this section we will address
the handful of known issues specific to installing from USB drive, and review
some of the common problems encountered when trying to get a machine to
boot from USB.
you may need to make some adjustments to your server BIOS to make it
boot from a USB drive. If your server supports a “boot menu” during POST
(F12 on IBM servers), you can boot from the USB drive without having to
make the change permanent in the BIOS. Otherwise, you may have to enter
the BIOS setup screen to change the boot order
Upon booting from the USB drive you should see a SYSLINUX menu like the
one shown here:
Tip: If you hit Tab from SYSLINUX menu you
can view or even edit your kernel command line. This is very
useful for debugging as it allows you to try something different without
having to edit your syslinux.cfg:
Make your selection from the menu and hit Enter, and SYSLINUX will to
load the appropriate kernel and initrd which will start the
installer running. After a moment, Anconda will try to locate the install
media (ISO images) as specified on the kernel command line (above) or in
the kickstart file. If this is not specified, or for whatever reason Anaconda
cannot find the files, it will prompt you for the location. This is a common
point of failure when trying to automate the install as it depends on a
correct reference to the USB device, which may vary from system to system.
As described in section 2.9, it may take a little experimentation to get
this right. Once the install media is located you will see the following
message at the bottom of the screen:
After which, the GUI installer should start:
Note: When using Kickstart (for unattended install), by default you will
not see any of the Anaconda screens that you would during a manual install,
unless the installer cannot find the necessary response in the kickstart
file and needs to prompt you.
However, there are two switches you can use within the kickstart file
to give you a degree of control over this.
- The first is autostep, which tells Anaconda to flash each
screen for a second, even if no input is required.
- The other is interactive, which tells Anconda to stop on
each screen. The result is similar to a manual install except each screen
is prepopulated with the info from your kickstart file. If all the parameters
are correct, all you need to do is hit “Next” at each screen.
This is particularly useful for debugging
Known issues
One of the caveats of using USB drive for installation is that the system
treats the USB drive just like a HDD, and in some circumstances this can
confuse the Linux installer. The major issue is not with the Anaconda installer
itself, which seems to always enumerate the real HDDs before the
USB drive, even if the system was booted from the USB drive. In all our
tests, Anaconda successfully chose the real HDD as the correct installation
target, rather than the USB drive, by default. The worst side effect of
having the USB stick present is that an extra entry is sometimes placed
in grub.conf that refers to the USB drive (as if to infer the USB
drive could be an additional boot option, even if it were present after
the install). If this occurs, you may want to clean up grub.conf
by removing the entry. Or, you can prevent this during installation
by de-selecting the USB drive if it appears in the list of possible install
destinations, or by using the following line in kickstart:
ignoredisk --drives=sdb
The bigger issue is with the GRUB bootloader which can, in some circumstances,
confuse the USB drive with the target installation drive. This is likely
due to the fact that the USB drive is first in the BIOS boot order (drive
0x80) during the install. When this happens, GRUB will mistakenly install
itself to the MBR of the USB drive instead of the target installation drive,
overwriting the SYSLINUX bootcode on the USB drive. In addition, GRUB may
write incorrect entries to grub.conf. If GRUB treats the USB drive
as the first drive in the boot order, hd(0), then it will mistakenly refer
to the target installation drive as hd(1). The result is that the newly-installed
system will not be bootable. (Or, it’s possible the system WILL be bootable
as long as the USB stick is present but will not boot after it’s removed).
This can be repaired post-installation by booting to Linux rescue mode,
editing grub.conf and performing a GRUB restore operation (root
command followed by setup). Or it can be prevented during install,
simply by making sure the USB drive is NOT selected first in the GRUB Drive
Order. During the partitioning phase, select “Configure advanced bootloader
options” followed by “Change Drive Order” and make sure your target installation
drive appears first in the list. This can also be done with the following
line in kickstart:
bootloader --driveorder=sda
where the drive specified is the target installation drive, not the USB
drive. This will ensure that GRUB treats the target installation drive as
first in the BIOS boot order, even if that is not the case at the time of
installation.
. Locate your Pendrive
[root@tuxfixer ~]# blkid
/dev/sda1: LABEL="kvm" UUID="ae344cef-02bd-41a0-9ae5-a65ca9b473a8" TYPE="ext4" PARTUUID="5802aed2-01"
/dev/sdb1: LABEL="linux" UUID="ef15b875-ee2a-4def-8e16-a3ccdb41ff36" TYPE="ext4" PARTUUID="00006b3e-01"
/dev/sdb2: LABEL="win7" UUID="56FCCA5FFCCA394F" TYPE="ntfs" PARTUUID="00006b3e-02"
/dev/sdb3: LABEL="home" UUID="5279bdb7-aecb-4bb2-9a54-d7d042f70e6c" TYPE="ext4" PARTUUID="00006b3e-03"
/dev/sdb4: LABEL="swap" UUID="087470ac-4819-44cb-81df-9980fd601a73" TYPE="swap" PARTUUID="00006b3e-04"
/dev/sdc1: UUID="2015-12-09-23-03-16-00" LABEL="CentOS 7 x86_64" TYPE="iso9660" PTUUID="57f6f38a"
PTTYPE="dos" PARTUUID="57f6f38a-01"
/dev/sdc2: SEC_TYPE="msdos" LABEL="ANACONDA" UUID="C522-73DA" TYPE="vfat" PARTUUID="57f6f38a-02"
Above example shows that our Pendrive was detected by the system as /dev/sdc and contains
partitons (/dev/sdc1, dev/sdc2) with some data.
3. Format your Pendrive (optional)
If the Pendrive contains data, perform low level format (this may take time):
[root@tuxfixer ~]# dd if=/dev/urandom of=/dev/sdc
dd: writing to '/dev/sdc': No space left on device
15654913+0 records in
15654912+0 records out
8015314944 bytes (8.0 GB) copied, 2133.11 s, 3.8 MB/s
4. Create USB Boot Disk using dd utility
Prepare / download ISO image.
Copy ISO image to /dev/sdc device (our Pendrive) using dd command:
[root@tuxfixer ~]# dd if=manjaro-xfce-16.06-rc2-x86_64.iso of=/dev/sdc
3065152+0 records in
3065152+0 records out
1569357824 bytes (1.6 GB) copied, 381.378 s, 4.1 MB/s
If you are installing to a netbook, or otherwise do not have an optical
drive (or burner, or media), and you want the extra flexibility of using
the regular DVD installer instead of the Live image, then this method
will give a useful install medium. You are then free to customize package
selection, choose which filesystem you prefer for your rootfs (ext3
OR ext4, btrfs, etc), and rescue mode is available.
Preparing the USB stick
The easiest setup method is to install and use unetbootin
or Fedora's own livecd-iso-to-disk script from livecd-tools.
Note that the liveusb-creator GUI, however, does not support putting
the DVD installer on USB.
The manual setup method follows:
First, download the iso file Fedora-12-i386-DVD.iso from a Fedora
mirror. Then loop mount the iso on a local mount point such as /mnt/tmp
# mount -o loop /path-to-iso/Fedora-12-i386-DVD.iso /mnt/tmp
Now plug in the USB stick and then copy the main iso file as well
as the images directory from the /mnt/tmp/ directory to the root directory
of the USB stick.
# cp /path-to-iso/Fedora-12-i386-DVD.iso /media/usbdisk/
# cp -r /mnt/tmp/images /media/usbdisk/
Next download the boot.iso the linux/releases/VERSION/Fedora/ARCH/os/images/
directory of your local Fedora mirror and store it on your computer's
hard drive.
From your running 14 system (including an 14 livecd) make sure you
have the livecd-tools package installed by doing:
yum install livecd-tools
Use the "mount" command to find the USB stick (e.g., /dev/sdb1) or
look at /var/log/messages to find where the stick was mounted. Next
unmount the USB stick either from the desktop icon or using the umount
command - but keep a note of where the USB stick is attached to the
filesystem, e.g., /dev/sdb1
Now as root run:
# livecd-iso-to-disk path-to/boot.iso /dev/sdb1
If the stick is not bootable, then refer to the information below
to make it bootable, otherwise this command will fail.
You should now have a bootable USB stick which will run an 14 install.
When you boot the stick, select a hard drive install and select the
drive as /dev/sdb1 (or your USB device drive) and the path should be
/
The remainder of the install should be the same as for using a DVD
in an optical drive, but when you select options make sure that you
select your disk partitioning carefully if you are doing custom partitioning
and also make sure that the bootloader is installed on the correct drive
- by default it will be installed on the USB stick so you will need
to change it to the master boot record on the hard drive.
STEP 0: Your motherboard (BIOS) has to support boot from usb
(usb-key or usb-hdd). You don't need to know which of these types your
media is though, your BIOS recognizes the usb controller in the device,
and this determines usb-key or usb-hdd type.
STEP 1: Download the latest copy of syslinux and extract it.
Download.
STEP 2: Open a command prompt and cd to your 'syslinux/linux'
folder. Run ./syslinux /dev/sdX1
replacing X with the device node of your media.
STEP 3: Ensure the usb drive is bootable. For that, we need
a working MBR code and an active partition.
Open a command prompt and cd to your 'syslinux/mbr' folder. Run the
following two commands,
replacing X with the device node of your usb drive:
dd conv=notrunc bs=440 count=1 if=mbr.bin of=/dev/sdX
parted /dev/sdX set 1 boot on
This will write the syslinux mbr code (mbr.bin) into the
master boot record of the drive,
and mark first partition as active (bootable). For the second task,
you can use fdisk or other
disk partitioning tools.
STEP 4: Copy a Linux kernel image (like vmlinuz) to the root
(/dev/sdX1) of your media.
STEP 5: Lastly, create a 'syslinux.cfg' file in the root of
your media (/dev/sdX1) and
enter any configuration options you need/want.
Procedure 2.1. Making USB Media on Linux
-
Connect a USB flash drive to the system and execute the
dmesg
command. A log
detailing all recent events will be displayed. At the
bottom of this log, you will see a set of messages
caused by the USB flash drive you just connected. It
will look like a set of lines similar to the following:
[ 170.171135] sd 5:0:0:0: [sdb] Attached SCSI removable disk
Note the name of the connected device - in the above
example, it is
sdb
.
-
Log in as
root
:
$
su -
Provide your root password when prompted.
-
Make sure that the device is not mounted. First, use
the
findmnt
device
command and
the device name you found in the earlier steps. For
example, if the device name is
sdb
, use the following command:
#
findmnt /dev/sdb
If the command displays no output, you can proceed with
the next step. However, if the command does provide
output, it means that the device was automatically
mounted and you must unmount it before proceeding. A
sample output will look similar to the following:
#
findmnt /dev/sdb
TARGET SOURCE FSTYPE OPTIONS
/mnt/iso /dev/sdb iso9660 ro,relatime
Note the TARGET
column.
Next, use the umount
target
command to
unmount the device:
#
umount /mnt/iso
-
Use the
dd
command to
write the installation ISO image directly to the USB
device:
#
dd if=/path/to/image.iso of=/dev/device bs=blocksize
Replace /path/to/image.iso
with the full path to the ISO image file you
downloaded, device with
the device name as reported by the
dmesg
command earlier, and
blocksize with a
reasonable block size (for example,
512k
) to speed up the
writing process. The bs
parameter is optional, but it can speed up the process
considerably.
For example, if the ISO image is located in
/home/testuser/Downloads/rhel-server-7.3x86_64-boot.iso
and the detected device name is
sdb
, the command will look like the following:
#
dd if=/home/testuser/Downloads/rhel-server-7.3x86_64-boot.iso of=/dev/sdb bs=512k
-
Wait for
dd
to finish
writing the image to the device. Note that no progress
bar is displayed; the data transfer is finished when
the #
prompt appears again.
After the prompt is displayed, log out from the
root
account and unplug
the USB drive.
The USB drive is now ready to be used as a boot device. You
can continue with
Chapter 5, Booting the Installation on AMD64 and Intel 64
Systems on AMD64 and Intel 64 systems or
Chapter 10, Booting the Installation on IBM Power Systems
on IBM Power Systems servers.
Softpanorama Recommended
How To Make USB
Drive Bootable From ISO Image Tom's Hardware
SYSLINUX - Wikipedia,
the free encyclopedia
The Syslinux Project
How to
create and use Live USB - FedoraProject
3.2. Preparing a USB flash drive as an installation source
6.3. Making bootable USB media - Fedora Documentation
UNetbootin - Homepage and Downloads
Society
Groupthink :
Two Party System
as Polyarchy :
Corruption of Regulators :
Bureaucracies :
Understanding Micromanagers
and Control Freaks : Toxic Managers :
Harvard Mafia :
Diplomatic Communication
: Surviving a Bad Performance
Review : Insufficient Retirement Funds as
Immanent Problem of Neoliberal Regime : PseudoScience :
Who Rules America :
Neoliberalism
: The Iron
Law of Oligarchy :
Libertarian Philosophy
Quotes
War and Peace
: Skeptical
Finance : John
Kenneth Galbraith :Talleyrand :
Oscar Wilde :
Otto Von Bismarck :
Keynes :
George Carlin :
Skeptics :
Propaganda : SE
quotes : Language Design and Programming Quotes :
Random IT-related quotes :
Somerset Maugham :
Marcus Aurelius :
Kurt Vonnegut :
Eric Hoffer :
Winston Churchill :
Napoleon Bonaparte :
Ambrose Bierce :
Bernard Shaw :
Mark Twain Quotes
Bulletin:
Vol 25, No.12 (December, 2013) Rational Fools vs. Efficient Crooks The efficient
markets hypothesis :
Political Skeptic Bulletin, 2013 :
Unemployment Bulletin, 2010 :
Vol 23, No.10
(October, 2011) An observation about corporate security departments :
Slightly Skeptical Euromaydan Chronicles, June 2014 :
Greenspan legacy bulletin, 2008 :
Vol 25, No.10 (October, 2013) Cryptolocker Trojan
(Win32/Crilock.A) :
Vol 25, No.08 (August, 2013) Cloud providers
as intelligence collection hubs :
Financial Humor Bulletin, 2010 :
Inequality Bulletin, 2009 :
Financial Humor Bulletin, 2008 :
Copyleft Problems
Bulletin, 2004 :
Financial Humor Bulletin, 2011 :
Energy Bulletin, 2010 :
Malware Protection Bulletin, 2010 : Vol 26,
No.1 (January, 2013) Object-Oriented Cult :
Political Skeptic Bulletin, 2011 :
Vol 23, No.11 (November, 2011) Softpanorama classification
of sysadmin horror stories : Vol 25, No.05
(May, 2013) Corporate bullshit as a communication method :
Vol 25, No.06 (June, 2013) A Note on the Relationship of Brooks Law and Conway Law
History:
Fifty glorious years (1950-2000):
the triumph of the US computer engineering :
Donald Knuth : TAoCP
and its Influence of Computer Science : Richard Stallman
: Linus Torvalds :
Larry Wall :
John K. Ousterhout :
CTSS : Multix OS Unix
History : Unix shell history :
VI editor :
History of pipes concept :
Solaris : MS DOS
: Programming Languages History :
PL/1 : Simula 67 :
C :
History of GCC development :
Scripting Languages :
Perl history :
OS History : Mail :
DNS : SSH
: CPU Instruction Sets :
SPARC systems 1987-2006 :
Norton Commander :
Norton Utilities :
Norton Ghost :
Frontpage history :
Malware Defense History :
GNU Screen :
OSS early history
Classic books:
The Peter
Principle : Parkinson
Law : 1984 :
The Mythical Man-Month :
How to Solve It by George Polya :
The Art of Computer Programming :
The Elements of Programming Style :
The Unix Hater’s Handbook :
The Jargon file :
The True Believer :
Programming Pearls :
The Good Soldier Svejk :
The Power Elite
Most popular humor pages:
Manifest of the Softpanorama IT Slacker Society :
Ten Commandments
of the IT Slackers Society : Computer Humor Collection
: BSD Logo Story :
The Cuckoo's Egg :
IT Slang : C++ Humor
: ARE YOU A BBS ADDICT? :
The Perl Purity Test :
Object oriented programmers of all nations
: Financial Humor :
Financial Humor Bulletin,
2008 : Financial
Humor Bulletin, 2010 : The Most Comprehensive Collection of Editor-related
Humor : Programming Language Humor :
Goldman Sachs related humor :
Greenspan humor : C Humor :
Scripting Humor :
Real Programmers Humor :
Web Humor : GPL-related Humor
: OFM Humor :
Politically Incorrect Humor :
IDS Humor :
"Linux Sucks" Humor : Russian
Musical Humor : Best Russian Programmer
Humor : Microsoft plans to buy Catholic Church
: Richard Stallman Related Humor :
Admin Humor : Perl-related
Humor : Linus Torvalds Related
humor : PseudoScience Related Humor :
Networking Humor :
Shell Humor :
Financial Humor Bulletin,
2011 : Financial
Humor Bulletin, 2012 :
Financial Humor Bulletin,
2013 : Java Humor : Software
Engineering Humor : Sun Solaris Related Humor :
Education Humor : IBM
Humor : Assembler-related Humor :
VIM Humor : Computer
Viruses Humor : Bright tomorrow is rescheduled
to a day after tomorrow : Classic Computer
Humor
The Last but not Least Technology is dominated by
two types of people: those who understand what they do not manage and those who manage what they do not understand ~Archibald Putt.
Ph.D
Copyright © 1996-2021 by Softpanorama Society. www.softpanorama.org
was initially created as a service to the (now defunct) UN Sustainable Development Networking Programme (SDNP)
without any remuneration. This document is an industrial compilation designed and created exclusively
for educational use and is distributed under the Softpanorama Content License.
Original materials copyright belong
to respective owners. Quotes are made for educational purposes only
in compliance with the fair use doctrine.
FAIR USE NOTICE This site contains
copyrighted material the use of which has not always been specifically
authorized by the copyright owner. We are making such material available
to advance understanding of computer science, IT technology, economic, scientific, and social
issues. We believe this constitutes a 'fair use' of any such
copyrighted material as provided by section 107 of the US Copyright Law according to which
such material can be distributed without profit exclusively for research and educational purposes.
This is a Spartan WHYFF (We Help You For Free)
site written by people for whom English is not a native language. Grammar and spelling errors should
be expected. The site contain some broken links as it develops like a living tree...
Disclaimer:
The statements, views and opinions presented on this web page are those of the author (or
referenced source) and are
not endorsed by, nor do they necessarily reflect, the opinions of the Softpanorama society. We do not warrant the correctness
of the information provided or its fitness for any purpose. The site uses AdSense so you need to be aware of Google privacy policy. You you do not want to be
tracked by Google please disable Javascript for this site. This site is perfectly usable without
Javascript.
Last modified:
March 12, 2019