Doug’s Blog

Handily dispensing information to .00000001% of the world’s population

Archive for May, 2015

Fedora21 and Video Configuration

Tuesday, May 19th, 2015

Another Fedora upgrade, another few hours spent mucking about with xorg.conf and video settings!

So I have two workstations I was upgrading, one I chose to stick with nouveau and the other I used nvidia drivers.

The nouveau one, I had an older card, the GeForce GTX 275, and the nvidia drivers I downloaded did not work well, so it was easier to stick with nouveau. You can use lspci to see your card info:

/sbin/lspci | grep VGA

Fedora found my card and monitors, but one of them did not get the proper resolution. After a number of failed attempts at configuring xorg.conf, I ended up just using the following in my .xinitrc:

/bin/xrandr –addmode DVI-I-2 1920×1080
/bin/xrandr –output DVI-I-2 –mode 1920×1080

and that worked. You could also put that in a file like “/etc/X11/xinit/xinitrc.d/99-xrandr” like this, and make sure you “chmod a+x” on the file:

#!/bin/sh
/bin/xrandr –addmode DVI-I-2 1920×1080
/bin/xrandr –output DVI-I-2 –mode 1920×1080

For the nvidia install, I had to do the following steps

  • Download the driver from http://www.geforce.com/drivers
  • Drop out of the GUI with “init 3″ as root
  • Run the driver file, i.e. “sh ./NVIDIA-Linux-x86_64-340.76.run”
  • When you run the file, it will ask if you want to blacklist the nouveau stuff, and the answer is yes! It will create “/etc/modprobe.d/nvidia-installer-disable-nouveau.conf” with the following:

# generated by nvidia-installer
blacklist nouveau
options nouveau modeset=0

Then you need to edit your grub file “/boot/grub2/grub.cfg” and find your recent vmlinuz line and add this to the end of it:

rdblacklist=nouveau

Then you can reboot. You’ll need to muck with the xorg.conf, you can see my version here.

Another thing to note, you should make note of your IP address, if you wreck your video output and can’t get the GUI to show anymore, you can still SSH into the machine and change things and reboot. I got into a case where my box had DHCP so I didn’t know the IP anymore, and I did the following to get in and fix my xorg.conf:

  • Boot up the live CD
  • You want to mount your drive now, but first you need to find it via “pvs”
  • Pvs will show you the name to use for “lvdisplay fedora” as an example, you may need to change “fedora” to your drive name
  • Lvdisplay will show you the LVM partitions, you want to mount the root partition to get into /etc/X11, I had to do “mount /dev/fedora/lv_root /mnt”

Once mounted, you can tweak the grub or the xorg.conf, whichever caused you to lose the video settings!

Hope this helps someone!