LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-04-2006, 07:38 AM   #1
Kymbo
LQ Newbie
 
Registered: Sep 2006
Posts: 1

Rep: Reputation: 0
Question Redirect /dev/ttyS0 input/output to tty2


I have a secure Linux appliance that I am trying to virtualize on VMware ESX Server. All interaction and configuration of the appliance is undertaken by connecting to the appliance's serial port. All virtual ttys have been commented out on the appliance's /etc/inittab but I have uncommented tty1 and can now login to a bash shell as root. I want to be able to redirect all appliance serial output and input on /dev/ttyS0 to tty2 on boot so that configuring the appliance at any time post boot would be as easy as ALT-F2. I've renamed /dev/ttyS0 and then created a symbolic link /dev/ttyS0 -> /dev/tty2. This works but is pretty gross I reckon so are there any other more elegant ways to get ttyS0 i/o onto tty2 ?

Last edited by Kymbo; 09-04-2006 at 01:38 PM.
 
Old 09-07-2006, 10:07 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Do "ls -l /dev/tty2 /dev/ttyS0". Normally it would show something like:
crw------- 1 root root 4, 2 Jul 20 11:20 /dev/tty2
crw-rw---- 1 root uucp 4, 64 Jul 20 07:19 /dev/ttyS0

Since you've already made /dev/ttyS0 into a symlink it won't be.

The numbers for "device" files are major/minor rather than bytes as for other files.

So in the above 4 is the major for both /dev/tty2 and /dev/ttyS0. 2 is the minor for the former and 64 is the minor for the latter.

You can remove your symlink then use mknod to create a ttyS0 file with the same major/minor as tty2:

mknod /dev/ttyS0 c 4 2

All writes to and reads from /dev/ttyS0 will go to the same physical device as pointed to by /dev/tty2 because it is the major/minor rather than the name that determines the device.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
/dev/st0 : Input/Output error sharonenoch Linux - Hardware 1 02-10-2006 12:44 PM
cat /dev/ttyS0: Input/output error lionking_x Linux - Hardware 3 01-06-2006 11:16 PM
/dev/hdc : Input/output error tulip4heaven Linux - Software 3 04-27-2005 12:03 PM
input/output dev/hda error meira Red Hat 2 09-01-2004 08:31 AM
/dev/hdd input/output error... Linux~Powered Linux - Software 8 02-17-2004 12:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration