How to boot PortableLinux from a USB mobile hard disk

Source: Internet
Author: User
Article Title: Guide PortableLinux from a USB mobile hard drive. 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.

The corresponding kernel is also changed from 2.4.20 to 2.6.21.

The tools borrowed in the middle have also been replaced by the current qemu from VMWare.

Of course, it is not ruled out that there are excellent release versions and updated kernel source code and tools that can no longer be DIY by yourself. The following is just a talk about my own hands-on experience:

First, you must have a USB mobile hard drive that can be partitioned and installed with linux. In theory, FLASH drives can also be used, SD, XD, and other FLASH cards + card readers, however, the FLASH chip speed is relatively slow, and the practical level is far from that of mobile hard disks. It should also be mentioned that the mobile hard drive should support USB 2.0, and the motherboard should also be used. The speed of USB 1.1 and is also very low. Theoretically, the mobile hard drive using the IEEE 1394 FireWire interface is faster, but I have no conditions to try it.

First of all, the USB/IDE Conversion Board of the mobile hard disk is also a little exquisite. Among the several mobile hard disk transfer boards I have tried, the mobile hard disk boxes marked with IBM are the worst, even in Windows, hard disks are often offline. Generally, it is good to use the mobile hard disk box with the entire bottom board mounted to the hard disk. It is best to enable the power supply through a single port.

Next, prepare a Linux installation CD for the release version. Of course, the ISO file is also generated. Here we assume that we start from the Windows environment. If we are using linux, it may not be that troublesome.

3. Prepare a set of available virtual machine environments. If you do not care about piracy or you have already paid for it legally, VMWare is the first choice, this is almost the performance of the X86 platform's Virtual Machine software. The virtual speed is almost. If you must use the software legally, use qemu, find the download path by yourself.

Fourth, connect the mobile hard disk to the Windows host and correctly recognize it. Here, we assume that the current host has only one internal hard disk, and the mobile hard disk is the only mobile storage device connected. Correctly configure the Virtual Machine and set the device file of the mobile hard disk (in Windows, the device file of the second hard disk is \\. \ PhysicalDrive1) completely handed over to the virtual machine as the main hard disk. Under VMWare, you can create a vmdk file through the wizard, but only specify that the virtual hard disk is the mobile hard disk on the host machine, this can be implemented in the GUI. In Qemu, the command to specify a mobile hard disk as a virtual machine is:

Qemu.exe-boot d-L.-m 256-hda \. \ PhysicalDrive1-cdrom d: \ CDIMGS \ FC-i386-CD1.ISO-localtime

I don't want to talk too much about the use of virtual machines here, otherwise it will become an experience of virtual machine operations. Here I will only give a small note that if you use qemu, installing kqemu can improve the performance to a considerable extent.

All in all, we create a virtual machine that uses a USB hard disk as the primary hard disk and boot it from a CD or from a CD image file, we successfully installed a set of Linux releases running on virtual machines. Here we only use FC 5 Linux as an instance. In fact, the release versions are similar.

Fifth, ensure that the Linux system running on the virtual machine after installation has a complete kernel development environment and kernel source code. Here we need to talk about the use of virtual machines. No matter what method is used, you may need to install the development environment and download the latest version of the kernel source code, the VM can be correctly configured for direct online download, or the FTP, Samba, or even a CD image can be used after the host is downloaded to allow the VM to finally configure and compile the kernel.

Sixth, start to configure a new kernel. The important thing is to make the Kernel support the USB mobile storage driver. It cannot be built into the kernel, but compiled into the kernel driver module, because the storage driver is modularized and required during boot time, the kernel must also support the memory image disk (initrd) for boot ). Therefore, the kernel to be configured includes:

The file system must support at least ext3 and ext2. If there is initrd, It is configured as a module.

At least the SCSI drivers must be supported: scsi and scsi-sd, which are dependent on VMWare's virtual Buslogic SCSI controller and USB Storage driver. The two drivers are configured as modules:

To a few must support the USB driver: usb support, usb-storage is the usb storage driver. There are also required uhci_hcd (based on intel series chips and VIA series USB 1.0/1.1 bus controllers) and ohci_hcd (based on AMD, nForce, ALI and other compatible Chip USB 1.0/1.1 bus controllers), ehci_hcd (Extended USB 2.0 Bus Controller ). Configure the module mode.

At least the required Block devices: LoopBack Device Support. The module mode and kernel mode are all supported. The kernel version 2.4 uses the Loop Device to store the initrd image. Ram disk support. This is required and must be compiled in the kernel. The most important thing is the Initrd support, which needs to be compiled into the kernel. In Kernel configuration 2.6, intitrd-Initial RAM filesystem and RAM disk (initramfs/initrd) support is placed under the General setup of the kernel.

Other parts can be customized as needed. After the kernel is configured, it is nothing more than compiling the kernel and kernel module, installing and copying the kernel module, and installing a new kernel. These are similar to the customized Linux kernel. Install the new kernel on the current system and add it to the GRUB option (Here we assume that GRUB is used as the Boot loader. For LILO and syslinux, ).

[1] [2] [3] [4] [5] Next page

Related Article

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.