Build your own Ubuntu-LIVE-CD

Source: Internet
Author: User
To avoid writing an operating system from the beginning, we certainly adopt a ready-made operating system as the bottom line. Of course, we can use LFS to make us feel better, but it is rare for people who can implement LFS. What's more, LFS is simply challenging my patience. Like LFS, we need a creation base. First, create a variable. The benefit of creating this variable is obvious, even if you don't need it ~ /Diy_Ubuntu directory, you can follow this article to continue.

To avoid writing an operating system from the beginning, we certainly adopt a ready-made operating system as the bottom line.

Of course, we can use LFS to make us feel better, but it is rare for people who can implement LFS. What's more, LFS is simply challenging my patience.

Like LFS, we need a creation base. First, create a variable. The benefit of creating this variable is obvious, even if you don't need it ~ /Diy_Ubuntu directory, you can follow this article to continue.

$ Export WORK = ~ /Diy_ubuntu

$ Mkdir-p $ WORK

Then we mounted the CD image file to/mnt.

$ Sudo mount-t iso9660-o loop dapper-live-i386.iso/mnt

$ Cd $ WORK

Copy a file and a CD File

$ Mkdir ubuntu-livecd

$ Cp-a/mnt/. ubuntu-livecd

$ Chmod-R u + w ubuntu-livecd

$ Sudo umount/mnt

Because the CD contains a lot of free software under windows, we can delete unnecessary files. Of course you can keep it.

$ Rm-rf $ WORK/ubuntu-livecd/programs

After mounting the compressed files on the CD, you can see a complete linux operating system directory in the $ WORK/old directory.

$ Mkdir $ WORK/old

$ Sudo mount-t squashfs-o loop, ro $ WORK/ubuntu-livecd/casper/filesystem. squashfs $ WORK/old

We created a 2 GB file system and formatted the file as a device file. As a result, the system gave a warning. Ignore it and choose yes.

$ Sudo dd if =/dev/zero of = $ WORK/ubuntu-fs.ext2 bs = 1 M count = 2147

$ Sudo mke2fs $ WORK/ubuntu-fs.ext2.

Then we mount the empty file system.

$ Mkdir $ WORK/new

$ Sudo mount-o loop $ working/ubuntu-fs.ext2 $ WORK/new

Copy the file of the linux operating system. Because the linux File we obtained in advance is compressed, We decompress it.

$ Sudo cp-a $ WORK/old/. $ WORK/new

Of course, $ WORK/old is useless now. Discard it

$ Sudo umount $ WORK/old

First, go to the operating system we just obtained.

$ Sudo cp/etc/resolv. conf $ WORK/new/etc/

$ Sudo mount-t proc-o bind/proc $ WORK/new/proc

$ Sudo chroot $ WORK/new/bin/bash

Now you are in the system, super DIY-ubuntu, and what you want to do.

# Vi/etc/apt/sources. list # select the appropriate source

# Apt-get update

# Apt-get dist-upgrade

# Apt-get install the software you want to install

# Apt-get clean

...... # More configurations

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.