Creating the LiveUSB

来源:百度文库 编辑:神马文学网 时间:2024/06/13 04:58:54
Creating the LiveUSB Friday, 22 May 2009 18:37
Creating the Parted Magic LiveUSB:


These instructions will help Linux and Windows users alike with the simple task of creating the Parted Magic LiveUSB. And for the purpose of this example, the target USB media will be a single, primary-partitioned drive.

1. Download the file "partedmagic-usb-x.x.zip" from this location: http://partedmagic.com/download.html. Extract it to a local folder using Windows' 'Compressed (zipped) Folders', or similiarly, '7-Zip' (another fine, Open Source project). 'unzip' if using Linux.

2. Most USB drives ship FAT16-formatted. If the USB drive is not FAT16 or FAT32, it must be formatted as such (your choice between the two), or the SYSLINUX boot loader will not work. You do not have to erase the files you have on the USB drive to use Parted Magic. If you do have existing data on the USB drive, not to worry - it won't get in the way. If your USB stick doesn't boot after your have completed all steps, you can try to format your USB stick under Windows, with the tools listed on Index of USB boot making applications. Do make sure though to have 100 MB of free space available on the drive's partition where you will install Parted Magic.

3. From the folder storing the contents extracted from the zipped Parted Magic file, copy the two folders (/boot and /pmagic) to the root of the USB drive.

4. To be able to boot from the LiveUSB, a boot loader for Linux operating from a FAT filesystem is required. With Parted Magic being Linux-based, and the intended media's filesystem being FAT, the Open Source project SYSLINUX will answer to this requirement. While most, if not all, Linux distros come with this already available, they have in most cases an old version (SYSLINUX 3.63), which doesn't work with Parted Magic. Use the last SYSLINUX version from the following URL:http://www.kernel.org/pub/linux/utils/boot/syslinux/ instead of the SYSLINUX version of your distibution. Windows users can get a copy of SYSLINUX from the same link or can use the SYSLINUX installed included in Parted Magic (/boot/syslinux/syslinux.exe).

5. To prepare to use SYSLINUX, find out what the OS-assigned name is for the USB drive attached to your system. In Windows, make note of the respective drive letter; and in Linux, use the command string 'fdisk -l' (or some other program) to list connected devices and partitions.

6. For this example, let's say that the USB drive is assigned by Windows the drive letter "X:", or alternatively, identified as "/dev/sdx1" in Linux. Use these commands to install the SYSLINUX boot loader on the target USB drive:

In Windows, open a command prompt, and type:

syslinux.exe -d \boot\syslinux -ma X:
(The -m and -a options are used together here to write a MBR to the USB drive, and to mark its partition as active. Effectively, flagging the drive with "boot".)

In Linux, and with the USB drive unmounted, type:

syslinux -d /boot/syslinux /dev/sdx1
(Replace "/dev/sdx1/", as appropriate, with the correct device ('sdx') and partition ('1').)

In Linux, make sure your USB drive is flagged "boot". Enable this flag by using options provided by 'parted',  'GParted', 'fdisk', ...

In Linux, write the Syslinux MBR to the USB drive (this is not needed when you have already a bootable MBR on the USB drive). A copy of mbr.bin is included in the USB version of Parted Magic. It's located in boot/syslinux. Change directory to the root of the USB drive that the Parted Magic files were copied to, and use this command:

cat  boot/syslinux/mbr.bin > /dev/sdx
(Replace "/dev/sdx/", as appropriate, with the correct device ('sdx'). Don't specify a partition!)

NOTE: If you are using any version of Ubuntu, your syslinux version is too old. Update it or Parted Magic won't boot. Ubuntu typically comes with very old versions of syslinux.

7.
Verify that a system file named "ldlinux.sys" is now located at /boot/syslinux/idlinux.sys in the root of the USB drive; this is the file SYSLINUX creates when the above command executes. (Windows users may need to change Explorer's 'View Options' to show "hidden files and folders" and "protected operating system files", in order to see the file.)

Tip: For reference, the specific version of the SYSLINUX boot loader installed on the USB drive can be obtained by the following:

From a Windows command prompt, issue the command:

type X:\boot\syslinux\ldlinux.sys
(Replace "X:", as appropriate, with the drive letter assigned to your USB drive.)

For Linux users, mount the USB drive, and then type:

head -n 2 /media/sdx1/boot/syslinux/ldlinux.sys
(Replace "/media/sdx1/", as appropriate, with the mount point used by your system.)

8. End of process; and the Parted Magic LiveUSB is ready to boot.