Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7739998
  • 博文数量: 637
  • 博客积分: 10265
  • 博客等级: 上将
  • 技术积分: 6165
  • 用 户 组: 普通用户
  • 注册时间: 2004-12-12 22:00
文章分类

全部博文(637)

文章存档

2011年(1)

2010年(1)

2009年(3)

2008年(12)

2007年(44)

2006年(156)

2005年(419)

2004年(1)

分类: LINUX

2005-04-02 01:14:54

Terminology

Machine #1, for these instructions, will be running Windows or Linux and will run a terminal program from which we will control the installation on Machine #2.

Machine #2, for these instructions, is the machine where we will be installing Linux to, but we will be controlling the install through the serial port.

Step 1. Attach the Null Modem Cable

The first step is to attach the null modem cable between the serial ports of Machine #1 and Machine #2.


Step 2. Set up the Terminal Program on Machine #1:

On the system you are controlling the install (Machine #1), type the following:

For Linux:
miterm -s 9600 -l /dev/ttyS0

If you want to capture output of the installation then use the script command:
script
miterm -s 9600 -l /dev/ttyS0
exit

Note: minicom, kermit, and others should work just as well as miterm.

For Windows:
HyperTerminal 9600, 8, N, 1

HyperTerminal can capture output if you need it to.

Other terminal programs will work as well.


Step 3. Begin the Linux Install on Machine #2:

At the RedHat Installer Boot Prompt, type one of the following lines:

linux console=ttyS0,9600
or
linux serial
or
linux console=tty0 console=ttyS0,9600

If you watch closely (and you have a monitor and video card on Machine #2) you will see a couple of lines show up on Machine #2, but all following lines will show up through the serial port to the terminal on Machine #1. This behavior is normal.

On a headless machine (a machine without a video card nor monitor), you can modify one of the boot disks found in the /images directory on the RedHat CD. Create the floppy, then find the file named syslinux.cfg and add the console=... parameters there. Then when you boot the headless machine on that floppy you will be able to control the install through the serial port.

You can make the serial port the permanent default console by reading up on serial-console.txt


Notes

The script program allows you to capture output from a program by logging everything to a log file. You finish running the script program by typing exit - you will then see a message stating that your log file has been saved.

Another way of running a program and controlling it through the serial port (useful for capturing screens when script and other programs are not available) is by redirecting both input and output. Here is an example of running the fdisk program on one machine, but controlling it through the serial port from another machine. You need to have the null modem cable attached and run the terminal program as mentioned above. Here is how to redirect input and output:

fdisk /dev/hda /dev/ttyS0 2>/dev/ttyS0


Headless server settings

/etc/inittab

7:2345:respawn:/sbin/agetty 115200 ttyS0 vt100

/etc/securetty

ttyS0

/etc/lilo.conf

append="console=ttyS0,115200 console=tty1"

/etc/sysconfig/kudzu

SAFE=yes


References:

/usr/src/linux/Documentation/serial-console.txt
/usr/src/linux/Documentation/kernel-parameters.txt
阅读(1124) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~