Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
grub/lilo high-res text mode trick



Not sure if this is useful to anyone, but I thought I'd post this here in case it is.


I do a lot of terminal line editing from the console of my workstation. Sometimes using text mode is faster and easier, instead of using the mouse to open up new terminal windows and position them easily.


If you don't know how to get to the text console on your Linux PC, hold down CTRL-ALT and hit one of the F1-F6 keys. These are virtual terminals that you can log in with your credentials and view or edit files, "quick and dirty" if you will.


I often find myself logging into the F1 terminal and running "top" to monitor my system's performance, then switching to the F2 terminal and starting a large file copy or something, then toggling back to the first one to monitor the increased load, etc.


the problem that I used to have was that in the standard low-resolution text mode that comes out of the box, if you are viewing or editing a large file, there is some needless scrolling; in other words, you can't see as much as if you were in the GUI and had maximized the terminal session window to see more text.


If you have a fairly modern video card, you can take advantage of a Vesa-VGA text high-res mode that is much better on the eyes than the 43x50 scrunched mode that sometimes comes up with high-res mode. This mode is actually a vga-complient mode, which equates to 1024x768 on your text console. Not all video cards support this, worst case senerio is that you just reboot and change the boot string back to what it was before and you'll be all set.


I'm using CentOS (a red-hat derivitive) but this should be portable to other linuxes as well. I think that SUSE linux 9 and 10 actually have this high-res text mode out of the box.


The solution: append to your grub.conf or lilo.conf file the string "vga=791" (without the quotes, of course).


If you have grub, it might look like the following:

# grub.conf generated by anaconda
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/sda2
#          initrd /initrd-version.img
title CentOS-4 i386 (2.6.9-34.ELsmp)
    root (hd0,0)
    kernel /vmlinuz-2.6.9-34.ELsmp ro root=LABEL=/ vga=791
    initrd /initrd-2.6.9-34.ELsmp.img
title CentOS-4 i386-up (2.6.9-34.EL)
    root (hd0,0)
    kernel /vmlinuz-2.6.9-34.EL ro root=LABEL=/
    initrd /initrd-2.6.9-34.EL.img


Notice above my entry for "CentOS-4 i386" ... the line starting with "kernel" is the line that you append the vga=791 entry to.


Lilo configuration would be similar; you just find your kernel that you use, and edit the "append=" line, as follows:

    append="devfs=mount acpi=off vga=791"


Again, in the above example, for my kernel named "linux", I've appended to the line that starts with append=.


With grub, save the file and then reboot your machine to try it. With lilo, one more step involved... run "lilo" as root or "sudo lilo" as yourself if you've set it up to update the lilo boot loader. Then reboot your machine and try it.


## o_O be careful o_O ## - if you modify anything else in the grub or lilo config files without knowing what you're doing, you could render your machine unable to boot. appending this line to your kernel boot parameters will not cause problems, but don't tell me I didn't warn you! Your flavor of Linux may be different... so be sure to create a boot disk before hand to ensure that this doesn't wack your system!!


CONCLUSION: After a reboot, if your video card supports it (sometimes an onboard video with only 1mb of ram would fail this mode, in which you would just have the same low-res mode that you had before trying this trick) you will be able to do the CTRL-ALT-F1 and see text in high-res. Go ahead and log-in, and edit a larger file and see how you can see more on the screen, but not be burdoned by the mouse in a GUI for a quick fix here and there. Good luck!! :)






Wow .. what a first day on the forums .. dude thats awesome!

Quote:Wow .. what a first day on the forums .. dude thats awesome!

B) Thanks man ... As time goes on and I get more aquainted with the group on here, I hope to be able to help some noobs with problems they're having!!


-- zepcom


Forum Jump:

Users browsing this thread: 1 Guest(s)