|
Blue Forest http://www.lslnet.com at 3:18 p.m. on August 18, 2006
RedHat 7.3 Live in CDROM HowTo
The idea is this :
Cdrom guide the use and operation of Linux, the key is to solve the following problems :
1 : how to use the system when the file system /dev, /var, /tmp which can be written.
Second : how to change the order of guidance system
Basic steps :
(0) prepared environment
. Prepare a PC
Large hard disk
Disc Recorder
Windows Memory
Outline below
/dev/hda1 Linux boot performance of ext2
/dev/hda2 Linux root performance of ext2
/dev/hda3 Linux swap
/dev/hda4 Extendend
/dev/hda5 Linux root over the performance of ext2 at least 650M
. Install main installation.
/dev/hda1 Boot in the district.
/dev/hda2 Root in the area.
/dev/hda3 Swap in the district.
The necessary tools, such as mkisofs and cdrecord other.
. Install test installation
/dev/hda5 In a district.
Swap use /dev/hda3.
Placed only need to install the software CDROM.
: We can master boot sector, it is guided by the main inst the linux
. Two guide allocation
Restart the computer, this time into the main install, implement the following steps :
#mkdir /mnt/lfs
#mount T performance of ext2 /dev/hda5 /mnt/lfs
# Vi /etc/lilo
# /sbin/lilo
——————————————————————
/etc/lilo.conf Document reads as follows :
Prompt
Timeout=50
Default=linux
Boot=/dev/had
Map=/boot/map
Install=/boot/boot.b
Message=/boot/message
Linear
Image=/boot/vmlinuz-2.4.18-3
Label=main_inst
Initrd=/boot/initrd-2.4.18-3.img
Read-only
Append= "ramdisk=20480"
Root=/dev/hda2 "--main install the root area
Image =/mnt/lfs/boot/vmlinuz-2.4.18-3
Label=test_inst
Read-only
Append= "ramdisk=32768"
Root=/dev/hda5 &--test install the root area
————————————————————————————
. Adjusted test install environment
Channel, install choice test;
Since the confirmation test to install guide and were all normal;
Then need to be done :
Deletion of unnecessary software.
User application software installation,
Re-editing kernel. Etc.
(A) The allocation of test install environment
. Channel, the main choice install and implement
#mount T performance of ext2 /dev/hda5 /mnt/lfs
. /var Configuration, system /dev to ramdisk
#vi /mnt/lfs/etc/rc.d/rc.iso
_______________________________
Creating /mnt/lfs/etc/rc.d/rc.iso
# /var
Mke2fs-q -i /dev/ram1 16384 1024
Mount /dev/ram1 /var -o defaults, rw
Cp - /lib/var /
# /dev
Mke2fs-q -i /dev/ram2 16384 1024
Mount /dev/ram2 /dev -o rw
Cp - /lib/dev /
(/dev Because inode to establish such a restriction on the number of documents under particularly dev)
____________________________________________________
. Editor /mnt/lfs/etc/rc.sysnit
A) A ban on re-mount spaces rw root file system
# Read-write Remount the root filesystem.
# State=`awk '/ (^\/dev\/root| \/) / (print $ 4)' /proc/mounts`
#[ "$state"> "Rw", named \]
$ # Action "Remounting root filesystem in read-write mode :" mount - n -o remount, rw /
B) Call rc.iso footsteps
In
# Set the path
PATH=/bin:/sbin:/usr/bin:/usr/sbin
Export PATH
HOSTNAME=`/bin/hostname`
Section, the following additions
# To boot from cdrom
. /etc/rc.d/rc.iso
C) Prohibition of activating exchange Division
# Now turn on in case we swap to swap files.
#swapon -
$ #action "Enabling swap space :" /bin/true
D) prohibition fsck
In this position
Then if [-f] /fsckoptions
Fsckoptions=`cat /fsckoptions`
Else
Fsckoptions=
Fi
Increasing sentences, to control execution of fsck
Fastboot=yes
Fsckoptions=
E) Prohibition of other file system mount
# Mount all other filesystems (except for NFS and /proc, which is already
# Mounted). Contrary to standard usage.
# Filesystems are NOT unmounted in single user mode.
$ #action "Mounting local filesystems :" mount - t nonfs, smbfs, ncpfs O no_netdev
F) prohibits the implementation of document inspection system
# Create the crash indicator flag to warn on crashes, offer timeout with fsck
# Touch /.autofsck
. Editor /etc/rc.d/init.d/random
Read sentences
Random_seed=/var/lib/random-seed
For
Random_seed=/var/run/random-see
. The creation and implementation of the following steps, it created a /var, /tmp, /dev templates, creating links /etc/mtab
#cd /mnt/lfs
# Vi create_iso.sh
# Sh create_iso.sh
————————————————————————
#!/bin/sh
Echo tmp
Rm -fR /mnt/lfs/tmp
Ln-s var/tmp /mnt/lfs/tmp
###
Echo mtab
Touch /mnt/lfs/proc/mounts
Rm /mnt/lfs/etc/mtab
Ln-s /proc/mounts /mnt/lfs/etc/mtab
###
Echo dev
Mkdir /mnt/lfs/lib/dev
Cp - /mnt/lfs/dev /mnt/lfs/lib
###
Echo var
Mv /mnt/lfs/var/lib /mnt/lfs/lib/var-lib
Mv /mnt/lfs/var /mnt/lfs/lib
Mkdir /mnt/lfs/var
Ln-s /lib/var-lib /mnt/lfs/lib/var/lib
For i in `find /mnt/lfs/lib/var/log type /dev/null f`; do cat "; $i; Done.
Rm `find /mnt/lfs/lib/var/lock type f`
Rm `find /mnt/lfs/lib/var/run type f`
______________________________________________
. Confirmation test install the correct environment
Channel, install choice test
Then this should be like a cdrom install similar.
If there is something not working, or to re-orient and install main choice after the repair complex;
Install or test the implementation of the following orders can be complicated repair :
Mount -o remount, rw /
(2) create boot image
. Channel, the main install option
. The software can produce a start
# Mkbootdisk --mkinitrdargs --with=ide-cd `uname -r`
. According to the paper the following steps taken boot.img
# Dd if=/dev/fd0 of=/tmp/cdrom.img bs=1440k count=1
# Mkdir /mnt/bootfd
-o Loop # mount - t msdos /tmp/cdrom.img /mnt/bootfd
# Zcat /mnt/bootfd/initrd.img "; /tmp/initrd-cdrom
# Mkdir /mnt/initrd
# Mount -o loop /tmp/initrd-cdrom /mnt/initrd
. Boot.img test copies of the document to install the kernel
Cp /mnt/lfs/boot/zImage /mnt/bootfd
: According to the actual situation, there may be a need to amend the name zImage
. Cdrom drive module which to copy cdrom.img
#cd /mnt/initrd/lib
#cp /lib/modules/2.4.18-3/kernel/drivers/cdrom/cdrom.o.
#cp /lib/modules/2.4.18-3/kernel/drivers/ide/ide-cd.o.
#cp /lib/modules/2.4.18-3/kernel/fs/nls/nls_iso8859-1.o.
. Document editing linuxrc
# Vi /mnt/initrd/linuxrc
----------------------------------
#!/bin/nash
Echo "Loading cdrom module"
Insmod /lib/cdrom.o
Echo "Loading ide-cd module"
Insmod /lib/ide-cd.o
Echo "Loading nls_iso8859-1 module"
Insmod /lib/nls_iso8859-1.o
Echo Mounting /proc filesystem
Mount-t proc /proc /proc
Echo Creating root device
Mkrootdev /dev/root
Echo 0x0100 "; /proc/sys/kernel/real-root-dev
Echo Mounting root filesystem
Mount-t iso9660 /dev/root /sysroot --ro
Umount /proc
Pivot_root /sysroot /sysroot/initrd
---------------------------------------------
. The document editing boot.img syslinux.cfg
# Cd /mnt/bootfd
# Vi syslinux.cfg
_____________________________________
Default Linux
Label Linux
Kernel zImage
Append initrd=initrd.img root=/dev/hdc rmdisk=32768
———————————————————————
Root= behind is the name of CD-ROM equipment :
. Initrd compressed and copied boot.img
# Umount /mnt/initrd
# Gzip -9 "/tmp/initrd-cdrom"; /mnt/bootfd/initrd.img
. Copy boot image documents
# Umount /mnt/bootfd
# Mv /tmp/cdrom.img /mnt/lfs/boot.img
(C) the creation and testing of iso image
. Continue to work in the main install
. Iso image creation
# Cd /root/lfs & ensure adequate storage space iso image
#mkisofs R-b-c boot.catalog -o boot.iso /mnt/lfs boot.img
. Check the correctness of iso image
A) Adoption of loop equipment mount CD-Image File
# Mkdir /mnt/iso
Boot.iso /mnt/iso -o loop # mount - t iso9660
B) Check the contents of the correct boot.iso
C) umount boot.iso
Umount /mnt/iso
(D) Disk
1) to Mastering Linux
Please refer to the installation of recording equipment CD-Writing HOWTO.
Order line :
Cdrecord-V speed=<desired writing speed>; dev=<path to your writers generic scsi device>; boot.iso
2) If using Windows to recording
Iso image to be ftp windos platform, and then use the appropriate procedures for recording
Other issues
1 : dev File System
I was ramdisk approach to the completion of the building. This requires large enough to support the Kernel Configuration ramdik.
Another approach is to use DEVFS dev directory and the file system to complete, and I am not. .
Two other documents :
Suggested that the system will start when "mount other filesystem fail" this issue can Notes /etc/rc.d/init.d/netfs documents :
$ Action "Mounting other filesystem :" mount - t nonfs, smbfs, ncpfs solution.
But if Zhushidiao then Telnet will not link
3 : continue to 'downsizing'
I am just not equipped with x window should be able to continue to reduce other software.
4 : for CDs
Use the guide, cdrom launched, it is not replaced. Japanese information in his letter, tmpfs use of the system, the entire root system into memory. This is the time through the boot using init option start of this document.
5 : a global issue
Different hard disks, CD-ROM, motherboards, NIC
Brief :
Http://www.linuxaid.com.cn/articles/7/1/710687494.shtml
Issued on the production of its own version of Linux, which is better analysis of documents on the boot.img
Http://tldp.org/HOWTO/Diskless-root-NFS-HOWTO.html
Produced live in a chapter on the cdrom. Especially on the principle
Http://tldp.org/HOWTO/Bootdisk-HOWTO/index.html
On linux, the authority boot process
Http://www15.big.or.jp/~yamamori/sun/cdlinux/
Cdrom directly with the operation of the game, the Japanese. Initrd.Img more detailed configuration |
RedHat 7.3 Live in CDROM HowTo
Brothers successful? |
RedHat 7.3 Live in CDROM HowTo
Become. I posted, and hope that we can help to put the issue behind my article, give ideas.
The problem is particularly NIC
Thank you |
RedHat 7.3 Live in CDROM HowTo
Great job!
Up |
| |