Initial Bootloader > Flash Drive. Warning. If not used carefully this process can be dangerous

Similar documents
Initial Bootloader. On power-up, when a computer is turned on, the following operations are performed:

Overview of USB Flash Drive Based Install Instructions

Linux+ Guide to Linux Certification, Third Edition. Chapter 2 Linux Installation and Usage

NEC Versa 500D/550D Windows 98 Upgrade Information

Upgrading the Cisco IOS XE Software

Lionstracs Groove X-R

How to install the software of ZNS8022

Instructions For Formatting Hard Drive Windows 7 Command Prompt

AMD RAID Installation Guide

NVIDIA RAID Installation Guide

AMD RAID Installation Guide

SECUDRIVE Sanitizer Portable User Guide

Linux+ Guide to Linux Certification, Third Edition. Chapter 6 Advanced Installation

How To Make A Pen-Drive Bootable?

NVIDIA / JMicron RAID Installation Guide

AMD RAID Installation Guide

AMD RAID Installation Guide

Lesson 1: Preparing for Installation

Boot. How OS boots

4190 Information Management System (IMS) Software Upgrade Instructions

How to Restore a Windows System to Bare Metal

Boot Process in details for (X86) Computers

RAID Installation Guide

AMD RAID Installation Guide

1. Save the Express BIOS update file to a temporary directory on the target PC. 2. Double-click the *.EXE file to run the Express BIOS update.

Server Systems and Motherboards

Guide to SATA Hard Disks Installation and RAID Configuration

Procedures to Install Eye Com's ImageMouse and ImageMouse Plus using Windows XP platform

C A S P E R USER GUIDE V ERSION 5.0

v5: How to recover your PC using the Linux Rescue CD

BACKING UP AN IMAGE OF YOUR HARD-DRIVE

Guide to SATA Hard Disks Installation and RAID Configuration

Disk Imaging with Knoppix

Sound Card Installation for Windows 95/98

Setting up and running the pyrophosphate tools under the Knoppix GNU Linux system

Getting Started with the Deployment Console and Deploying the Clients Per PXE Network Booting using their MAC address. Quick Guide

Lab: Setting up PL-App with a Raspberry Pi

Fedora Linux Installation Guide

DELLEMC. TUESDAY September 19 th 4:00PM (GMT) & 10:00AM (CST) Webinar Series Episode Nine WELCOME TO OUR ONLINE EVENTS ONLINE EVENTS

How to Back-Up a fit-pc2 Using Only a USB Stick (and some creative partitioning)

Enterprise Surveillance Manager. Version Installation Manual

NVIDIA RAID Installation Guide

IT ESSENTIALS V. 4.1 Module 5 Fundamental Operating Systems

V Workstation Imaging

HDD Setting OBJECTIVES RESOURCES DISCUSSION LAB PROCEDURE 4

Installing the UnixWare Package. Installing the UnixWare Package - 1

Veritas System Recovery Disk Help

JetFlash User s Manual

TSM800 / TSM1330 Update Instructions

Guide to SATA Hard Disks Installation and RAID Coniguration

AMD RAID Installation Guide

Rocket RAID 2644 SAS Controller opensuse Linux Installation Guide

Peerless Drive System User's Manual

Description of the Windows XP Recovery Console for advanced users

by sudodus alias nio-wiklund at launchpad mkusb - quick start manual

Fedora Linux Installation Guide

Chapter 6. Boot time configuration. Chapter 6 Boot time configuration

Fujitsu LifeBook A Series

Chapter Two File Systems. CIS 4000 Intro. to Forensic Computing David McDonald, Ph.D.

Veritas System Recovery Disk Help

HOW TO: Perform a Hardware Independent Restore (HIR)

GV Director Restoring USB Image / Frame and Panel Installation

Computer Forensics: Investigating Data and Image Files, 2nd Edition. Chapter 3 Forensic Investigations Using EnCase

RocketRAID 2522 SATA Controller Ubuntu Linux Installation Guide

User. Applications. Operating System. Hardware

AMD RAID Installation Guide

FASTTRAK TX4000 QUICK START GUIDE. Version 1.2

PL-I Assignment Broup B-Ass 5 BIOS & UEFI

Tutorial How to upgrade firmware on Phison S8 controller MyDigitalSSD

User s Manual. Rev July 29,

Fujitsu LifeBook A Series

MBB100 / DSM800 Update Instructions

Windows Update Instructions Xp To 7 Without Cd Drive

RocketRAID 231x/230x SATA Controller Debian Linux Installation Guide

Introduction to the File Manager

Pro-face/Xycom Workstation Recovery Media Software Installation Instructions for Microsoft MS-DOS 6.22

RocketRAID 231x/230x SATA Controller Fedora Linux Installation Guide

Using grub to Boot various Operating Systems

LENOVO THINKSTATION P520C, P520, P720, & P920 WINDOWS 7 INSTALLATION

Guide to SATA Hard Disks Installation and RAID Coniguration

Digital HiNote VP 500 Series

N Series BIOS BIOS SETUP UTILITY

Performing Maintenance Operations

How to Dual-Boot OS X and Ubuntu

SLES Linux Installation Guide

Manually Installation Windows Updates Xp From Usb Drive Bootable

Format and Lock Utility User Manual (v2.0) USB 2.0 Flash Disk

C A S P E R USER GUIDE V ERSION 10

8 MANAGING SHARED FOLDERS & DATA

RocketRAID 2680/2684 SAS Controller Red Hat Enterprise/CentOS Linux Installation Guide

HELP Use the help command to list all the following supported commands:

Simplex 4190 TrueSite Workstation (TSW) Software Upgrade Instructions

A+ Guide to Managing and Maintaining your PC, 6e. Chapter 8 Hard Drives

Figure 1.0 ULTRA 22C Board Layout JP1 JP5. Table 1.0 Default Jumper Settings

Server Systems and Motherboards

M2GO & M1 Operating System Installation

A+ Guide to Hardware, 4e. Chapter 7 Hard Drives

Wavestore VMS v6 Installation Instructions

CST8177 Linux II. Linux Boot Process

Reinstalling the Operating System on the Dell PowerVault 745N

Transcription:

Initial Bootloader > Flash Drive Warning If not used carefully this process can be dangerous Running the script used in this article with an incorrect argument can cause loss of data and potentially damage the computer. The script with this article makes sector-to-sector copies to the target media which cannot be undone. To ensure that the computer is not compromised, follow the instructions in this article with care and ensure that the argument passed to the script is not in doubt. It is recommended to make backups of valuable data on the computer before performing operations that cannot be undone. Introduction This article explains how to populate a flash drive (the target media) with a bootloader. The bootloader used in this article is GRUB (GRand Unified Bootloader). GRUB is self-propagating and once it exists on media in one device it can be used to install itself onto another target. However, it is not possible to install GRUB using a Windows executable, so the script in this article populates the target with an initial image using dd to perform a sector-tosector copy of a GRUB image.

Prerequisites The following hardware is required: one flash drive The following Windows programs must be installed: Tar gzip dd It is also essential that the computer can boot from a flash drive. After the computer completes its power on self test, it searches for bootable storage devices and boots from the first one it finds. The order in which the computer searches for devices is controlled in the ROM BIOS and the BIOS settings need to be configured to instruct the computer to search for bootable flash drives before searching for bootable hard disks. Computers vary widely in how this is done. Many display a message shortly after the computer is turned on indicating which key to press to enter BIOS configuration (typically the esc or F10 key). Others require a configuration floppy disk or CD to configure the BIOS.

Download Download initial_flash from helpcentreonline.com. This will save a file named initial_flash.tar.gz. Note the directory initial_flash.tar.gz is downloaded to: this will be referred to as the download directory ([download]). Installation 1. Collect information. 1. Note the target device mount identifier. In Windows, flash drives are represented by drive letters. The drive letter can be found by starting Windows Explorer and then plugging the flash drive into a USB socket. Note the drive letter used to represent the flash drive. The drive letter is referred to later in this article as the target identifier. Leave the flash drive in the USB socket. If devices are connected to or disconnected from the computer, the target identifier may change. For this reason it is important to note the target identifier each time the process in this article is followed and complete the process before connecting or disconnecting any devices. 2. Note the target device ([target device]). Start a command prompt and type the following command (do not type the > character - it is the prompt): > dd --list A list of devices is returned. Look through the list and find the reference to the target identifier. An example of a reference in the output is as follows: \\.\Volume{1def118c-6a20-11dd-b565-0016d4483735}\ link to \\?\Device\Harddisk1\DP(1)0-0+b removeable media Mounted on \\.\f: In this example, the target identifier is f and the target device is Harddisk1.

2. Backup target. 1. Operations performed in this article overwrite the master boot record and destroy all existing partitions on the target flash drive. One small partition is created on the drive and the rest of the device is marked as unused. This means that much of the flash drive is unusable without rebuilding the partitions, and even if partitions are rebuilt, the master boot record's code area is overwritten with GRUB's initial bootstrap program, so the flash drive may still not be bootable if GRUB is removed. To preserve any existing data on the drive and make it fully usable again without altering its partitions, it is possible to backup the entire drive using the following command at the command prompt: > dd if=\\?\device\[target device]\partition0 of=temp.img bs=1m When typing the command replace [target device] with the target device value noted earlier. For example, if the target device is Harddisk1, type the following: > dd if=\\?\device\harddisk1\partition0 of=temp.img bs=1m Before typing the above command it will be necessary to navigate to the directory the backup image is to be stored in. Do not type the > character - it is the command prompt. The data can later be restored to the flash drive using the following command: > dd if=temp.img of=\\?\device\[target device]\partition0 bs=1m 3. Create sources directory ([sources]). 1. Create a directory from which the flash drive installation will be performed. For example, a suitable directory could be c:\unix\source. This directory will be referred to as the sources directory.

4. Unpack sources. Start a command prompt and type the following commands. (Do not type the > character - it is the command prompt.) 1. > copy [download]\initial_flash.tar.gz [sources] Copy the sources from the download directory to the sources directory. When typing the command replace [download] with the path name of the download directory including the drive letter and replace [sources] with the path name of the sources directory including the drive letter. For example, if initial_flash.tar.gz was downloaded to d:\download and the sources directory is c:\unix\source, type: > copy d:\download\initial_flash.tar.gz c:\unix\source 2. > [sources drive]: Change to the drive containing the sources directory. When typing the command replace [sources drive] with the drive letter of the drive containing the sources directory. For example if the sources directory is c:\unix\source, type: > c: 3. > cd [sources] Change to the sources directory. When typing the command replace [sources] with the path name of the sources directory excluding the drive letter. For example if the sources directory is c:\unix\source, type: > cd \Unix\source 4. > gzip -d initial_flash.tar.gz Decompress the compressed file. 5. > tar -xf initial_flash.tar Extract the archive.

5. Install. 6. > cd initial_flash 1. > install [target device] 6. Clean sources directory. Install the GRUB image. When typing the command replace [target device] with the target device. For example, if the flash drive is represented by Harddisk1, type the following: 1. > cd.. > install Harddisk1 2. > del initial_flash.tar 3. > rd initial_flash /S

7. Test installation. 1. Reboot the computer with the flash drive still connected. If the installation has been successful the computer reboots with the following screen: GRUB version 0.93 (640K lower / 3072K upper memory) [ Minimal BASH-like line editing is supported. For the first word, TAB lists possible command completions. Anywhere else TAB lists the possible completions of a device/filename. ] grub> As indicated in the prerequisites section, the BIOS must be configured so that flash drives have priority over hard disks in the search order. Script 2. Remove the flash drive and reboot the computer. The following script is used: Unplug the flash drive and then at the grub> prompt type: grub> reboot install.bat is run from the command prompt to perform the installation. install.bat The install.bat script is run from the command prompt to perform the installation. It accepts the target device as an argument and copies the GRUB image to the flash drive.

Further Comments Script To understand the process followed in this article, it is worth examining the script. The installation is performed by the following command in the install.bat script: dd if=grub.img of=\\?\device\%1\partition0 bs=1m This command uses dd to copy the contents of file grub.img to the target flash drive in blocks of 1 megabyte. dd is not the same as the DOS copy command which copies one file to another. dd streams a specified quantity of data from a defined point in a source to a defined point in a target without regard to any content that may already be in the target. The source and target may be files or devices. In the above example all data is streamed from the beginning of file grub.img to the beginning of a flash drive. The first sector of a flash drive contains the master boot record, which is overwritten, and a small partition is copied. The dd command enables an entire image to be created on the target, which may contain data in a variety of forms, including: a single file the entire contents of a device an operating system a copy of a master boot record. Flash Drive Contents The image copied to the flash drive is in FAT32 format, so it can be viewed from Windows Explorer. The drive contains the following files in directory \boot\grub: stage1 stage2 fat_stage1_5 In addition, stage1 is also embedded in the drive's master boot record as the initial bootstrap program. When the computer starts, stage1 is loaded from the master boot record and it loads fat_stage1_5, which understands the FAT32 file system. fat_stage1_5 then loads stage2, which contains the user interface and functionality in GRUB.