Install out-of-the-box Ubuntu configuration on an external usb hard disk

Source: Internet
Author: User
Install out-of-the-box Ubuntu configuration on an external usb hard drive-general Linux technology-Linux technology and application information. For more information, see the following. In a mobile linux environment, you can install linux on a mobile hard disk and find a machine in the data center or laboratory to run your program.

Because I have a free ubuntu disk, I plan to install this system on my 40 Gb mobile hard disk. I used to use fedora before. I am not very familiar with the debian system, it is estimated that everything is similar. By the way, let's make a comparison.

Plug in the usb hard disk into the computer, insert the CD into the optical drive, shut down and restart, and enter the installation interface from the CD. Step by step, you can do it. My usb hard disk is allocated 15 GB, the ubuntu partitioning tool automatically divides the root partition and swap partition in the idle partition, which is quite practical and suitable for beginners, and then installs the system on the usb, basically, you have not selected anything. You can choose not to install the network first, and install it in the last step. When installing grub, select/dev/sdaX, and X is your linux partition. Then restart.

Continue to start from the CD. In boot: rescue mode, go to the installation page again. After selecting the language, select the Mount partition, because I use usb, my linux partition is the first partition of the usb hard disk, that is, sda1, And the ide hard disk has been automatically mounted. Therefore, when selecting a partition, you can only select/dev/discs/disc1/part1, you need to modify the statement as needed, select execute a shell, and start the shell to enter the critical stage.

1. Modify the module File of mkinitrd to tell the kernel what driver should be loaded at startup. Because the usb hard disk we use must tell the kernel and usb driver, or we cannot unlock the kernel;

Chroot/target
Switch the current working directory to the linux partition of the usb hard disk. All subsequent operations will be performed on this partition, rather than the temporary ram partition created by the rescue system.
Then start the editor nano and vi. You can check which one you like, but my nano doesn't get up. It's strange that I only use vi.
Vi/etc/mkinitrd/modules
Add the following
Ehci_hcd
Uhci_hcd
Ohci_hcd
Usb-storage

Uhci_hcd and ohci_hcd are USB 1.1 drivers.
Ehci_hcd is a USB-based driver.
If the machines used support USB, The uhci and ohci can not be loaded.
Note that xxx_hcd is underlined. Do not make a mistake. This is the reason why I have made a few mistakes. Tears and lessons. If we don't use vi, it's easy to look at help. However, when we enter vi, the arrow keys on the keyboard become useless, and hljk is both left and right, which is awkward, it is really a torment for me to use emacs.

2. Modify the module loading wait time so that the usb driver module has enough time to load and then enter the system. Otherwise, an error occurs.
Vi/etc/mkinitrd. conf
Find the line with DELAY = 0 and change it to DELAY = 10. It will be fine if it is 10 or more. If it is less than 10, it is said that there is a problem. I have never tried it. If you are interested, try it.

3. Compile the new Boot Image

Mount-tproc none/proc
I don't know what this is. I will tell you if I don't have this command.
Mkinitrd-o/boot/initrd. img- -Usb
A new image will be generated based on your configuration. You can start it later.
If you do not know the kerenl version, check ls/lib/modules.

4. Update grub Configuration
Vi/boot/grub/menu. lst

Change the default configuration to the following:

Title Ubuntu, kernel 2.6.10-5-386-usb
Root (hd0, 0)
Kernel/boot/vmlinuz-2.6.10-5-386 root =/dev/sda1 ro quiet splash
Initrd/boot/initrd. img-2.6.10-5-386-usb
Savedefault
Boot

Hd0 is the first hard disk. It seems that no matter whether the ide hard disk is started, usb is the first hard disk by default. Because usb is started, the motherboard may be different, which may lead to some differences, I have read other people's post is hd1, but it won't work for me here. 0 is the first partition, corresponding to sda1

Save and restart. Then, set the bios boot sequence. Start with usb as the first boot. Save the configuration and start it. Go to the usb and select the modified entry on the grub page, wait for 1 minute to enter the system.

If the failure is found, repeat to check whether the above steps are correct.

I have not tried usb falsh disc, and it is probably the same.
For fedora core, The mkinitrd command is somewhat different, and the process is simpler. You do not need to modify the configuration file. After installing the system, enter in rescue mode. After mounting the usb hard disk:
Mkinitrd -- preload = ehci_hcd -- preload = usb-storage -- preload = scsi_mode -- preload = sd_mode/boot/initrd-usb.gz 2.6.11-1.1369-FC4
Then modify grub. I have not tried fedora core. It is dangerous and not guaranteed.

After Ubuntu is installed, the hardware driver is complete. You can simply configure the video card and wireless network card to use it. I thought how much time I wasted on configuring a wireless connection under FC4. The video card is estimated to use xorg vesa. Generally, the 2d driver is enough. opengl is not recommended.

Next, apt-get downloads the software. Later, it's busy. It's time to worry about FC. It's time to install all the software, so it won't be difficult in the future.

In comparison, Ubuntu is suitable for beginners. Many things are installed by default, and the general application is enough. FC is more suitable for experienced ones. Many new software will soon have an rpm package, deb is relatively small. The Enlightenment DR17 yum library was created in December October 1, and the apt library was created in December 9.15.
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.