Question 2: How do I increase/decrease the number of virtual terminals in Linux?
Answer:
Virtual terminals rock. If you use X exclusively, you probably don't much care for this question, but read it anyway as it may include some information that applies in your situation.
If you want the short answer, skip down to the Short Answer section.
On my system I keep 11 terminals active (F1 through F11) with the twelfth being dedicated to X. In addition to those I use the thirteenth terminal for logging (see the next question/answer).
The first process spawned on any (standard) un*x system is usually called "init". init is the parent of all processes (pid 0) and, under Linux, has the role of reading /etc/inittab and spawning off the appropriate processes to get your system into a usable state (and then keeping it there). For this discussion we are only interested in the spawning of getty's, which are the programs that give you your login prompt. If you read the inittab file you will notice a section that looks somewhat like this
1:2345:respawn:/sbin/getty 38400 tty1
2:23:respawn:/sbin/getty 38400 tty2
3:23:respawn:/sbin/getty 38400 tty3
4:23:respawn:/sbin/getty 38400 tty4
I'll go ahead and break the first line down
1 - id of the virtual terminal (vt) [1].
2345 - in which runlevels this getty should be spawned. 1 and
six are usually reserved for reboot and shutdown. Each
distribution uses its runlevels differently. Check the
inittab documentation for more information.
respawn - tells init that if this process ever dies[2] to spawn a
new copy.
/sbin/getty - full path of the getty to run on this vt.
38400 - bps rate of the terminal. This doesn't mean a whole lot
for local terminals but needs to be set for serial
devices (dial-in or dumb term). Mingetty will not have
this option.
tty1 - the name of the device in /dev/ to which the getty
should attach.
So now that I've filled you full of seemingly worthless information (and possibly misinformation), you're ready for the...
Short Answer:
Just add more lines of the same form as above. For example, if you currently have four terminals (as in the example above) to add a fifth you'd just add a line as
5:23:respawn:/sbin/getty 38400 tty5
Then make sure the /dev/tty5 device node exists. If not, you can either use the MAKEDEV command to create it or do it directly with mknod
cd /dev
mknod tty5 c 4 5
Similarly, to remove getty's you can either delete the lines you don't need or set the second field to only spawn the getty in certain runlevels and then run in something different. In the example above, if I ran in X only mode (runlevel 5), only the first vt would be available.
Now you need to make your changes take effect. A common misconception is that you need to reboot after changing the inittab to make the changes take effect. Hey! This is Linux. Just type "init q" and init will reread its config file (inittab) and spawn/kill to applicable processes.
Note that each getty eats up a certain (small) amount of RAM. If you aren't using them, you may as well stop them (you should probably keep at least two around).
[1] Virtual terminals are also called virtual consoles and the latter may actually be more accurate, but I typed "virtual terminal" first and I'm too lazy to change it
[2] "dies" is a bit oversimplified, but it will do.