特殊:Badtitle/NS100:Installation/FromKnoppix
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/Installation/FromKnoppix }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/af | • {{#if: UbuntuHelp:Installation/FromKnoppix|Afrikaans| [[::Installation/FromKnoppix/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/ar | • {{#if: UbuntuHelp:Installation/FromKnoppix|العربية| [[::Installation/FromKnoppix/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/az | • {{#if: UbuntuHelp:Installation/FromKnoppix|azərbaycanca| [[::Installation/FromKnoppix/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/bcc | • {{#if: UbuntuHelp:Installation/FromKnoppix|جهلسری بلوچی| [[::Installation/FromKnoppix/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/bg | • {{#if: UbuntuHelp:Installation/FromKnoppix|български| [[::Installation/FromKnoppix/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/br | • {{#if: UbuntuHelp:Installation/FromKnoppix|brezhoneg| [[::Installation/FromKnoppix/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/ca | • {{#if: UbuntuHelp:Installation/FromKnoppix|català| [[::Installation/FromKnoppix/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/cs | • {{#if: UbuntuHelp:Installation/FromKnoppix|čeština| [[::Installation/FromKnoppix/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/de | • {{#if: UbuntuHelp:Installation/FromKnoppix|Deutsch| [[::Installation/FromKnoppix/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/el | • {{#if: UbuntuHelp:Installation/FromKnoppix|Ελληνικά| [[::Installation/FromKnoppix/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/es | • {{#if: UbuntuHelp:Installation/FromKnoppix|español| [[::Installation/FromKnoppix/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/fa | • {{#if: UbuntuHelp:Installation/FromKnoppix|فارسی| [[::Installation/FromKnoppix/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/fi | • {{#if: UbuntuHelp:Installation/FromKnoppix|suomi| [[::Installation/FromKnoppix/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/fr | • {{#if: UbuntuHelp:Installation/FromKnoppix|français| [[::Installation/FromKnoppix/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/gu | • {{#if: UbuntuHelp:Installation/FromKnoppix|ગુજરાતી| [[::Installation/FromKnoppix/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/he | • {{#if: UbuntuHelp:Installation/FromKnoppix|עברית| [[::Installation/FromKnoppix/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/hu | • {{#if: UbuntuHelp:Installation/FromKnoppix|magyar| [[::Installation/FromKnoppix/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/id | • {{#if: UbuntuHelp:Installation/FromKnoppix|Bahasa Indonesia| [[::Installation/FromKnoppix/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/it | • {{#if: UbuntuHelp:Installation/FromKnoppix|italiano| [[::Installation/FromKnoppix/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/ja | • {{#if: UbuntuHelp:Installation/FromKnoppix|日本語| [[::Installation/FromKnoppix/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/ko | • {{#if: UbuntuHelp:Installation/FromKnoppix|한국어| [[::Installation/FromKnoppix/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/ksh | • {{#if: UbuntuHelp:Installation/FromKnoppix|Ripoarisch| [[::Installation/FromKnoppix/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/mr | • {{#if: UbuntuHelp:Installation/FromKnoppix|मराठी| [[::Installation/FromKnoppix/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/ms | • {{#if: UbuntuHelp:Installation/FromKnoppix|Bahasa Melayu| [[::Installation/FromKnoppix/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/nl | • {{#if: UbuntuHelp:Installation/FromKnoppix|Nederlands| [[::Installation/FromKnoppix/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/no | • {{#if: UbuntuHelp:Installation/FromKnoppix|norsk| [[::Installation/FromKnoppix/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/oc | • {{#if: UbuntuHelp:Installation/FromKnoppix|occitan| [[::Installation/FromKnoppix/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/pl | • {{#if: UbuntuHelp:Installation/FromKnoppix|polski| [[::Installation/FromKnoppix/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/pt | • {{#if: UbuntuHelp:Installation/FromKnoppix|português| [[::Installation/FromKnoppix/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/ro | • {{#if: UbuntuHelp:Installation/FromKnoppix|română| [[::Installation/FromKnoppix/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/ru | • {{#if: UbuntuHelp:Installation/FromKnoppix|русский| [[::Installation/FromKnoppix/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/si | • {{#if: UbuntuHelp:Installation/FromKnoppix|සිංහල| [[::Installation/FromKnoppix/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/sq | • {{#if: UbuntuHelp:Installation/FromKnoppix|shqip| [[::Installation/FromKnoppix/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/sr | • {{#if: UbuntuHelp:Installation/FromKnoppix|српски / srpski| [[::Installation/FromKnoppix/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/sv | • {{#if: UbuntuHelp:Installation/FromKnoppix|svenska| [[::Installation/FromKnoppix/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/th | • {{#if: UbuntuHelp:Installation/FromKnoppix|ไทย| [[::Installation/FromKnoppix/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/tr | • {{#if: UbuntuHelp:Installation/FromKnoppix|Türkçe| [[::Installation/FromKnoppix/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/vi | • {{#if: UbuntuHelp:Installation/FromKnoppix|Tiếng Việt| [[::Installation/FromKnoppix/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/yue | • {{#if: UbuntuHelp:Installation/FromKnoppix|粵語| [[::Installation/FromKnoppix/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/zh | • {{#if: UbuntuHelp:Installation/FromKnoppix|中文| [[::Installation/FromKnoppix/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/zh-hans | • {{#if: UbuntuHelp:Installation/FromKnoppix|中文(简体)| [[::Installation/FromKnoppix/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/FromKnoppix | UbuntuHelp:Installation/FromKnoppix | {{#if: | :}}Installation/FromKnoppix}}/zh-hant | • {{#if: UbuntuHelp:Installation/FromKnoppix|中文(繁體)| [[::Installation/FromKnoppix/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:Installation/FromKnoppix|:Installation/FromKnoppix|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :Installation/FromKnoppix/zh | | {{#ifexist: Installation/FromKnoppix/zh | | {{#ifeq: {{#titleparts:Installation/FromKnoppix|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:Installation/FromKnoppix|1|-1|}} | zh | | }}
<<Include(Tag/ContentCleanup)>> <<Include(Tag/StyleCleanup)>>
Introduction & warning
This page describes how to install Ubuntu Linux on a machine using a Knoppix LiveCD and a network connection. There's no need for the Ubuntu install disk.
To start, boot off the Knoppix CD and open a terminal window. Use su
to give yourself root privileges. Knoppix won't ask for a password.
Set up the install partition
Create the partition where you want to install Ubuntu. Use qtparted
to make your life easier. In this document, I'm installing Ubuntu onto /dev/hda3
. Don't forget you also need to create a swap partition if you don't already have one. After partitioning, it's a good idea to reboot the system to force the partition tables to be reloaded.
Format your filesystems. Use either mke2fs -j /dev/hda3
or mkreiserfs /dev/hda3
depending on whether you want ext3 or ReiserFS.
Now, mount your install environment. In this example, we're going to install the new ubuntu system onto /dev/hda3
mounted on /mnt/ubuntu
.
# mkdir /mnt/ubuntu # mount /dev/hda3 /mnt/ubuntu
Get debootstrap scripts
Knoppix includes debootstrap, but doesn't have the ubuntu scripts. The only way I know of to get these scripts is to get them from the debootstrap source archive.
1) Grab the latest debootstrap_*.tar.gz from http://archive.ubuntu.com/ubuntu/pool/main/d/debootstrap/ Save the archive into the /home/knoppix/tmp directory because /tmp is probably too small.
2) Uncompress and extract the archive, then cd
into the newly created directory and build the program:
# cd /ramdisk/home/knoppix/tmp # tar zxvf debootstrap_*.tar.gz # cd debootstrap-* # make # chmod +x debootstrap
Run debootstrap
You should run the debootstrap you just built, which requires a slightly odd invocation:
# DEBOOTSTRAP_DIR=`pwd` ./debootstrap --arch i386 dapper /mnt/ubuntu http://archive.ubuntu.com/ubuntu dapper
NOTE: to install gutsy intead of dapper I had to move DEBOOTSTRAP_DIR/scripts/ubuntu/gutsy to DEBOOTSTRAP_DIR first and then of course replace "dapper" by "gutsy" in the previous command. The Ubuntu debootstrap will now run the Ubuntu scripts. If your network is unreliable, you may need to run debootstrap multiple times to get all the files. It resumes where it left off. Near the end of debootstrap's copious output, you should see "Base system installed successfully". If not, remove everything in /mnt/ubuntu apart from the lost+found directory and try again.
Set up the host name
Of course, you should replace HOSTNAME
in the command below with the desired name for your machine. You need to remove /mnt/ubuntu/etc/hostname
first, because it will be a symbolic link to Knoppix's /etc/hostname
by default due to a bug in debootstrap.
# rm -f /mnt/ubuntu/etc/hostname # echo HOSTNAME > /mnt/ubuntu/etc/hostname
NOTE: That was not the case with debootstrap 1.0.7, maybe the bug was fixed.
Set up fstab
1) Create your fstab
. Knoppix has already created one that is appropriate for your system, but you do need to make some changes.
# cp /etc/fstab /mnt/ubuntu/etc/fstab # kate /mnt/ubuntu/etc/fstab
- Change the mount points on the partition(s) you set up in step 1
- Change their options to
defaults
- Change
/mnt/auto/floppy
to/mnt/floppy
. Do the same for/mnt/cdrom
. - Add
sync
to the options for/mnt/floppy
- Remove the
/dev/pts
line -- not needed?
Here is a decent /etc/fstab
:
proc /proc proc defaults 0 0 /dev/hda3 / ext3 defaults 0 1 /dev/hda5 none swap defaults 0 0 /dev/fd0 /mnt/floppy auto user,noauto,sync,exec,umask=000 0 0 /dev/cdrom /mnt/cdrom auto user,noauto,exec,ro 0 0
Set up Networking
Start with Knoppix's network/interfaces and resolv.conf files, then modify them to suit your needs.
# cp /etc/network/interfaces /mnt/ubuntu/etc/network/ # cp /etc/resolv.conf /mnt/ubuntu/etc/ # kate /mnt/ubuntu/etc/network/interfaces
Here is a typical interfaces file
# The loopback network interface auto lo iface lo inet loopback # A dynamic ethernet interface auto eth0 iface eth0 inet dhcp
You also need to set up the hosts file to include your machine name. Change "Knoppix" to your machine name. Feel free to delete all the IPV6 stuff.
# cp /etc/hosts /mnt/ubuntu/etc/ # kate /mnt/ubuntu/etc/hosts
Here is my /etc/hosts for lea.rinspin.com.
127.0.0.1 localhost 127.0.0.1 lea.rinspin.com lea
Enter the install environment
# chroot /mnt/ubuntu # mount /proc
You don't need to worry about the root partition because you mounted that in the first step. You'll need to mount /proc and any other partitions that you set earlier.
Set up base system
Set up the keyboard.
# dpkg-reconfigure console-data
Set up timezones, users, and apt. This is a lengthy process that will try to launch GDM at the end. Of course, GDM can't run because Knoppix already has the screen, but the screen may flash as they fight. NOTE: it's probably more correct to skip to the next step and install the kernel and bootloader now. Then, reboot into the newly installed system and run base-config. I haven't tried this yet. FOLLOW UP: Installing the kernel and bootloader then following up with the base-config works. /etc/network/interfaces and /etc/apt/sources.list must be setup correctly. Also consider using ubuntu apt repository mirrors http://wiki.ubuntulinux.org/Archive
# /usr/sbin/base-config new
In dapper, base-config was removed. The main steps you need to run instead of base-config are:
# tzconfig # dpkg-reconfigure --default-priority passwd # <edit /etc/apt/sources.lst>
Set up locales. You might want to skip this step if you only want to use English on this machine.
# dpkg-reconfigure locales
Install the kernel and bootloader
The default bootloader for Ubuntu is grub.
# apt-get install linux-image-386 # apt-get install grub
Now configure grub to boot off hda3. Because Linux starts numbering at hda1, but grub starts at hda0, you must subtract 1 from the partition number. (hd0,2) is equivalent to hda3, and (hd1,0) is equivalent to hdb1. I'm not sure why grub can't find stage1 in /lib/grub, where the grub package installs it. Until I know more, the easy way to fix this is to simply copy everything to /boot/grub, where grub is looking for it.
# mkdir /boot/grub # cp /lib/grub/i386-pc/* /boot/grub # nano /boot/grub/grub.conf
Here's a sample /boot/grub/menu.lst that you can use.
default 0 timeout 4 title=Ubuntu root (hd0,2) kernel /vmlinuz root=/dev/hda3 initrd /initrd.img title=Windows root (hd0,0) makeactive chainloader +1 title=Memtest86 root (hd0,2) kernel /boot/memtest86+.bin
Remember to make a symbolic link from /boot/grub/grub.conf to /boot/grub/menu.lst (that is what grub looks for at boot time...)
ln -s /boot/grub/grub.conf /boot/grub/menu.lst
Run grub to install the bootsector in the MBR.
# grub --no-floppy grub> root (hd0,2) grub> setup (hd0) grub> quit
Grub usage notes and example
The 'root' option in Grub establishes the reference point for subsequent paths and filenames in Grub only. It has nothing in particular to do with the 'root' option that is passed to the kernel. To illustrate this point, here is a somewhat arcane example: Consider the case that
- the kernel and initrd images are located on /dev/hdb3 (third partition of the second drive), which will ultimately be mounted as /boot
- the Grub configuration files and stages are in the 'grub' subdirectory of /dev/hdb3
- the BIOS is set to load a MBR from /dev/hdc
- the kernel is to mount /dev/hdb1 as /
You would then use the following grub.conf
title=FunkyUbuntu root (hd1,2) <--- refers to /dev/hdb3 kernel /vmlinuz root=/dev/hdb1 <--- refers to what you would think of as /boot/vmlinuz initrd /initrd.img <--- refers to what you would think of as /boot/initrd.img
and these Grub commands
grub> root (hd1,2) <--- means that grub/menu.lst is relative to /dev/hdb3 grub> setup (hd2) <--- will install MBR on /dev/hdc grub> quit
Restart into Ubuntu
Now unmount the drives, exit the subshell, and reboot! Your Ubuntu system should be ready to go.
# exit <-- exits the chroot subshell # umount /mnt/ubuntu # shutdown -r now
Troubleshooting
This page was created with the excellent help found at http://archive.ubuntulinux.org/ubuntu/dists/warty/main/installer-i386/current/doc/manual/en/apcs03.html . Another page that might prove helpful is http://www.inittab.de/manuals/debootstrap.html .