Yes? Boot Linux from a FireWire Device

Source: Internet
Author: User
Article Title: OK? Boot Linux from the FireWire device. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Obtaining an external drive is an excellent way to inject vitality into older devices, or allows you to run Linux on a machine that cannot (or does not want to) change the built-in hard drive.
  
Suppose you want to use Linux in a dual-boot system, but the hard drive of your computer does not have any space available. One solution is to use the "active" Linux release, such as Knoppix, which can run directly from CD. If it is used occasionally, this method is indeed feasible, but it has many serious disadvantages:
  
-You still need permanent storage of some data files. If you only use very small files, you can use a floppy disk. For medium-size files, USB flash drives may be enough, but they are not ideal.
  
-When using an active CD, it is very difficult or even impossible to install your own application or customize existing applications.
  
-Using the active release reduces performance. The most significant difference is that when you start to detect all devices-but it also reduces performance during running (because everything must be loaded from the CD, this is usually much slower than loading from a hard drive ).
  
Naturally, there are other options. For example, you can buy another built-in drive and install Linux in it. However, it is common that the machine may not have any available drive bays (especially for a laptop, which usually only allows one built-in hard drive ).
  
Alternatively, you can use a larger drive to replace the current drive and install Linux in the additional space you get. However, this is a time-consuming option because it requires you to reinstall the existing OS on the new drive, reinstall and reconfigure all applications and restore all data.
  
A better solution is to purchase an external hard drive and install Linux in it. This allows you to connect to an external drive only when you want to use Linux without changing the existing hardware and software.
  
   Removable Drive options
The range of mobile devices that can install Linux includes from a floppy disk drive to a USB flash drive, to a USB/FireWire hard drive.
  
Although it is indeed possible to install Linux on a small capacity device, such as a 1.44 MB Floppy disk or 32 mb usb disk, these are usually (must) Dedicated Release versions that have been reduced, for example, used to save corrupted installation.
  
However, external hard drive provides the most flexibility for general Linux distributions at a reasonable cost.
  
External drives come from many different manufacturers (Maxtor, Western Digital, etc.) and can have different sizes. These drives all contain an external box with standard 3-1/2 inch or 2-1/2 inch IDE drives. These drives are usually connected to the computer via USB or IEEE1394 (FireWire.
  
USB has two major versions: 1.1 and 2.0. Version 1.1 supports a maximum transmission speed of 12 Mbit/s (megabits/s), while version 2.0 supports a maximum transmission speed of 480 Mbit/s. Although most 2.0-compatible drivers can be backward compatible with 1.1, it is generally better to avoid 1.1 unless there is no choice (because it is slow ).
  
The FireWire standard also defines many different possible speeds, but in fact, whenever people talk about FireWire, they refer to "FireWire400", which supports up to 400 Mbit/s of transmission.
  
From the speed point of view, there is no choice between USB 2.0 and FireWire: Although USB 2.0 reports a high speed, they are similar because of different protocols. If you have both computers, it may be better to use USB instead of FireWire (I will explain the reason later), but if you only have FireWire, you can only choose FireWire. To maximize flexibility, choose one from a large number of drives that support USB 2.0 and FireWire (for example, the drive I will use later in this article ).
  
For computers that do not have the required ports, PCI (for desktop computers), and PCMCIA (for laptops), FireWire and USB 2.0 cards can be bought cheaply: for example, the PCMCIA FireWire card I used later in this article was probably bought at 10 GBP (less than $20.
  
To complete this article, I purchased a 5-1/4 inch external drive box. This is a very flexible disk box that is not provided with any drive and can be mounted to any standard IDE device, including 3-1/2 inch hard drive and 5-1/4 inch IDE device, such as CD-RW/DVD-RW drives. The disk has a USB 2.0 and FireWire connection.
  
To connect the disk box to my IBM Thinkpad T30 laptop, I also purchased the PCMCIA FireWire card (the built-in USB port only supports USB 1.1 ).
  
Both the disk box and FireWire card are cheaper (50 GBP and 10 GBP respectively ).
  
For testing purposes, I connected the disk box to the 13 GB 3-1/2 inch IDE drive I prepared-I will buy a larger drive capacity for actual use, these drives are also very cheap now (about 50 GBP per GB !)
  
   Linux support
As you may expect, Linux supports these disk boxes very well. Any device that complies with the high-capacity storage device's Serial Bus Protocol can be easily used with Linux.
  
In general, to enable support for these devices, the kernel needs to support a lot of content (directly compile or pass through modules ).
  
For USB and FireWire devices, the supported devices are all implemented through SCSI simulation-that is, the devices are displayed to Linux as if they are SCSI disks. This is a common way to abstract storage devices in Linux (for example, ide cd/DVD drives are also typically connected using SCSI simulation ). Therefore, the following Kernel support is required:
-SCSI support
-SCSI Simulation
-SCSI disk support
  
In addition, the following support is required based on the connection method:
-For FireWire:
-IEEE1394 support
-Support for OHCI1394
-RAW1394 support
-SBP-2 support
-For USB:
-(Host) USB support
-OHCI support
-UHCI support
-Support for USB large-capacity Storage
  
Obviously, you must fully support other hardware (such as video cards). You may need some other modules based on your actual hardware situation.
  
For example, if I use a PCMCIA (carmtr) FireWire card, you need to add:
-PCMCIA support
-Cardbus support
  
   Install
Now that we have an external device, we will start to install Linux in it.
  
The easiest way to install Linux now (of course my opinion) is to connect all hardware (here, include inserting the PCMCIA FireWire card, connecting the FireWire cable to the PCMCIA card and drive, and enabling the power switch on the drive); then use the installation CD of your selected release to boot your computer.
  
The release I selected is Gentoo (see references for links), so I use the latest "Universal" x86 Live CD (2004.1 ). Other releases require more or fewer steps than described here.
  
Once you have installed the CD boot, it should have recognized your drive if you are lucky. The drive should be displayed as a disk under/dev/sdX, where X is a lowercase letter starting with ". In my system, the external drive is detected as/dev/sda, but if you have another SCSI disk (a simulated SCSI disk), this will change; in that case, it may be/dev/sdb or other letters. If the drive is not automatically detected, further steps may be required-for example, you may have to enable FireWire or PCMCIA using the boot option, or you may have to manually load some kernel modules or similar items (see references for a link to the troubleshooting guide ).
  
Once the drive has been identified, consider the rest of the installation, it should indeed run like a built-in hard drive; therefore, you should be able to partition it as needed and install Linux as usual.
  
However, please be careful when deciding to install the Boot Loader (usually GRUB or LILO)-I do not recommend installing it on the Master Boot Record (MBR) (This is usually the default. Instead, it should be installed in the root partition (or boot partition of the external drive if a separate Boot Loader is used.
  
Now we have installed Linux on the device, and we need to boot Linux. Here you can start with some tips.
  
   Guide
Before discussing how to boot a new drive, you need to understand some boot loader theories.
  
The boot loader is usually installed in the MBR of the first hard disk on the computer. When a boot loader is called (the BIOS automatically executes the code in MBR), it usually displays the menus of the OS that can be booted. Select a given OS boot.
  
Note the following two points for this scenario:
-The OS selection menu (usually) loads data from the disk.
-To boot the relevant OS, the boot loader needs to read the relevant kernel from the disk.
  
Because the above operation occurs before the OS is loaded, it means that all disk reads must be performed through the BIOS call method. This can cause serious problems: in order to directly boot the disk, your BIOS must support a disk connected through FireWire or USB. This can usually be seen as a BIOS option to boot from these types of disks. In fact, FireWire BIOS support is currently rare, but USB support is becoming quite common. Therefore, if you use USB in a relatively new computer, you should be able to boot the drive directly in Linux.
  
After GRUB is installed in the MBR of the external drive, I can direct the drive when it is connected via USB. The BIOS setup program is easy to enter when the disk to which the boot is connected. An external disk is displayed as a general hard drive: Move the disk so that it is positioned before the built-in drive in the boot sequence.
  
I can also install the boot loader in the MBR of the built-in drive and use it to boot the USB drive (when it is displayed as hd1 in GRUB ). If you use FireWire, it is possible that the BIOS cannot directly boot the drive, and some other operations are required.
  
Fortunately, due to the flexibility of Linux, if you cannot directly boot (using the PCMCIA FireWire card, this is definitely the case !), There will be quite a simple solution. You can perform initial boot steps from a supported device (such as a floppy drive, CD, USB key, or tiny partition on the master drive) and then perform other operations using an external drive.
  
   Build Boot Image
You can use either of the following methods:
? Phase I Guidance
The kernel directs and installs the root file system and continues initialization by calling the initialization script (usually/sbin/init.
? Two-phase (initrd) Guidance
Kernel boot, install the initial ram disk (initrd), perform further customizable initialization, then install the root file system and continue

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.