Showing posts with label systems administration. Show all posts
Showing posts with label systems administration. Show all posts

Monday, June 29, 2015

The Boring Topic of Designing a Backup System For Your Studio

[This post was prompted by the occasion of helping a friend try to recover the data from her failed disk server. So the annoying details of this problem, and the necessity of dealing with these issues, is on my mind.]

As part of a series on designing, building and running a small computer animation studio, we are going to have to discuss backups. I will try and break it into small pieces because, frankly, it is a real bore. When we started using computers we did not do so for the joy of making backups which is like taking out the garbage, its not our first choice of how to spend our time. Furthermore, it turns out that there are choices to be made here, and real design issues. I am sorry about that. It just is.

When people started using computers, probably no one told them that they were now expected to be responsible adults about how they cared for their data or run the risk of losing it.   But all of us who have been using computers for a while know this only too well.  You can learn from our mistakes and save yourself a lot of trouble.  

When you drive a car, you are expected to learn how to drive safely. When you work at a real corporation or a University, then it is likely that your professional work is already being carefully backed up and protected, at least to some extent.   But the rest of us, at small companies or on our own, have to put our own system in place.

Keep in mind that hard drives, big or small, solid state or otherwise, are not intended to be perfect.  They have a known failure rate, and even though the manufacturer knows that some of their disks will fail, they only know this on the level of probability.  Disks are made in batches and the failure rate of disks within a batch are estimated as that is part of creating a warranty for the drives.   But disk failure is not the only cause of data loss.  

So here are some basic definitions and principles. In later posts we will go over some of the design choices you may have to make, are likely to have to make, when you design your studio.

For those of you who think I am less creative because I worry about such things, please go fuck yourself. Thank you.

1. The place where you do your professional work might be called your office, or it might be called a studio. A studio can be for one person or 1,000 people. The work might be your personal artwork, or your personal financial records or it might be a very expensive collaborative technology and creative project with a $100M budget.

2. All of these offices and studios need to have given some thought to how much protection they need to give their data in case of disaster, what is the likelihood of disaster, how much it is worth to them to lose one days work, one month's work, one year's work, etc.

3. The goal of a so-called backup system is to provide a level of protection for your data if disaster strikes for any reason, whether by computer malfunction, act of God, or human error.

4. No backup system is perfect, but different backup systems provide different levels of security at different costs, where costs means varying amounts of capital, costs going forward, attention that must be paid to maintaining the system, technical expertise and so forth.

5. A simple backup system well executed is better than a technically complex system that is over the head or beyond the needs of the intended user. An expensive or technically complex backup system that is not well implemented or maintained may be worse than no backup system at all.

6. A backup system is holistic. Together it provides a level of protection.  If some of the pieces work and some do not, you may still have a level of protection.  Thats the plan.   But it is better if all the pieces work generally speaking of course.

7. Backup systems are usually layered, that is, you have more than one protection so that if one fails you do not lose all data, but can fall back to another level. Generally this is implemented as a system to improve the reliability of the main file servers combined with discrete backups saved in a vault from earlier periods.

8. Backup systems are probabilistic. There is a probability of disaster, a probability that any one backup will not be readable. No backup system is perfect, but a good backup system will make the probablility of losing all your data much less likely.

9. Backup systems must be tested before they are used or you run the risk of not finding out that there was a problem until it is too late. This is an extremely common occurrence.

10. No one but you can judge whether this effort, these costs, and so forth are worthwhile. Only you know what this data is worth.

and finally,

11. I have found over the years that I never had too many backups.

In a later post we will go over some fundamental design choices and the kind of risks you will need to protect against.




Tuesday, December 30, 2014

Google Chrome Now Works with Centos Linux


I have used Centos Linux for all my professional software development in the last five years or so and I have been very happy with it. For those who are sensitive to the different camps of Linux self-Balkanization, this is in the same lineage as Redhat and Fedora.  It is supposedly the most used variant of Linux for commercial and enterprise-related activities.

But one problem with it is that it was very difficult to get Google Chrome to run under Centos even though it seemed to work fine with Ubuntu.

Anyway, this has been fixed, and it is necessary to run a script which has been created by Richard Lloyd, and you may read about the situation and the fix here.

This is known to work under Centos 6.5 which is the version I am running.

Thank you, Mr. Lloyd.



Monday, March 10, 2014

We Are Experiencing Technical Difficulties

We are experiencing temporary technical difficulties.  The car battery is dead, the computer died and the bicycle needs a pump.   We will resume this blog shortly.


Sunday, February 23, 2014

The Infinite Mystery of NVIDIA Linux Device Drivers 2/2


In our previous post we outlined what you have to do to install the NVIDIA graphics device driver under Centos / Redhat Linux 6.5 and similar systems.

In this post we go over each item in boring detail.

I am pretty sure there is a mistake in here somewhere (builds confidence, doesn't it?) because I distinctly recall doing an /sbin/telinit 3 and 5 at some point in the process, but obviously I have edited this out of my longer term memory.  But have no fears, if this doesn't work exactly I am sure you will get the general idea and improvise as necessary.  You have my greatest faith in your abilities.

Remember, before you begin you are expected to sacrifice a goat at least and say the proper prayers spreading the prayer cloth and so forth.

1. Are you already running the NVIDIA driver? How can you tell for sure?

The way I do this is by running "nvidia-settings" from the shell. If a window comes up, everything is installed and working. If it can't find it or it doesn't run, you do not have the driver installed and should proceed.

    nvidia-settings

2. Install the development tools.

Become su and run the command

    yum groupinstall "Development Tools" --skip-broken

Notice the quotes and capitalization. Say yes when it asks you if its ok. Then go get coffee and come back in 15 minutes.

3. Figure out the model of your graphics card.

As su, use the command

    /sbin/lspci -nn | grep VGA

The reported line will have the model of the card. It will probably begin with the word "Geforce" or "Quadro".

4. Figure out if your Linux is 32 or 64 bit

Run the command

    uname -m

and it will tell you.

5. Download the driver from Nvidia.

With your browser of choice, navigate to www.nvidia.com and click on "Drivers". You should find a menu which will ask you which OS you are running (e.g. Mac, Windows, Linux 32, Linux 64), which series of graphics card (e.g. 9 series, 8 series, 200 series, 600 series, etc) and the specific model.  Fill these in and hit search and it will find your driver. A 9xxx card is the 9 series, but a 4xx card is a 400 series.  If you do not find the model of your card then you gave it the wrong series and you should try again.

Click yes or agree on the license agreement and save the driver some place you can find it again. Get another cup of coffee and go play with your dog or something. Come back in a few minutes.

6. Put that driver someplace easy to get to, like /tmp and make it executable.

I used to skip this step but it was too much work. Copy the file you just downloaded to someplace easy to type, like /tmp. Then make it executable with the command

    cp NV* /tmp
    chmod 755 NV*

Ok, now we get to the weirder stuff.

7. Change /etc/inittab to bring the system up at level 3

    su
    cd /etc
    cp inittab inittab.orig
    vi inittab

and change the "5" in the last line to "3".

8. Blacklist Nouveau, Part 1

    su
    cd /etc/modprobe.d
    cp blacklist.conf blacklist.conf.orig
    vi blacklist.conf

and add three lines to the bottom of the file which say

    # get rid of nouveau driver
    blacklist nouveau
    options nouveau modeset=0

and save the file.

9. Blacklist Nouveau, Part 2

    su
    cd /boot/grub
    cp grub.conf grub.conf.orig
    vi grub.conf

and add the word "rdblacklist=nouveau" to the end of the lines that specify the kernel to boot. These are the longest lines in the file and begin with the phrase "kernel /vmlinux-blah-blah-blah".

Dont fuck this up or you wont be able to reboot the system without some major help.

10. Reboot the system

11. Log in as root

12. Verify the location of the system kernel libraries

    cd /usr/src/kernels
    ls

You should see some horrible name that starts with 2.6. You either want to remember that name, or if you are like me, you want to save it as a shell variable. I use csh or tcsh, if you don't then you will have to figure out how your shell does this.

    cd 2.6<esc>
    set kernelpath=`pwd`

Notice the funny direction of the quotes on that set command.

13. Install the Nvidia driver

You should still be root. Change directory to /tmp or where you put the nvidia driver and say

    cd /tmp
    ./NV<esc> --kernel-source-path=$kernelpath

You will need to use the mouse, agree to the license agreement, and watch with your breath held while it jumps through hoops. When it asks you if it can create a new X11.conf say yes. When it asks you if it can install 32 bit compatibility say yes.

If it completes without complaining much we are almost done.

14. Restore the /etc/inittab runlevel to 5

Still as root say

    cd /etc
    cp inittab.orig inittab

It will ask you if its ok to overwrite a file, say yes.

15. Reboot the system

Hopefully the system will come up and the window system will come up, and you will log in.

16. As su, run "nvidia-xconfig"

    su
    nvidia-xconfig

17. Run "nvidia-settings" and save your work.

Say

    nvidia-settings

and goof around with the different options and screens and set things to your liking. Or just say ok and quit.

That is it.

You are done.

The Infinite Mystery of NVIDIA Linux Device Drivers 1/2


We are now going to do a series of boring technical notes that nevertheless fulfill a more noble purpose.

Those of us who are interested in doing or fostering independent production with computers and computer animation have a lot to be grateful for with Linux, particularly with Centos/Redhat Linux. It is stable, scalable, various applications work with it and it is remarkably Unix-like for something that isn't Unix.

And it has so far avoided the insane Linux-of-the-day bullshit of Ubuntu, praise Allah.

But we do not live in a perfect world and a well-tempered Linux is going to be running the NVIDIA device driver with a solid, respectable NVIDIA graphics card and we are going to discuss why and then dive into the crazy shit you have to do to make it all work.

The only manufacturer out there that really supports Linux is NVIDIA, in spite of what you may have heard of Linus fingering NVIDIA. His frustration is real, but it is bullshit. For a variety of reasons NVIDIA is not able to put their device drivers in the open source because it contains proprietary information they just do not want to give their competitors. So that means that certain purists can not include it with the standard distributions. That means you have to install it yourself.

With Centos / Redhat, one also has the option of using the so-called "nouveau" driver which supposedly supports NVIDIA. I have crashed my system so many times using the nouveau driver that I do not recommend you use it for serious work. Since I also do things like CUDA/GPU development, it isnt a serious option anyway.

So we are going to install the NVIDIA driver, and it is a little wacky to do so. There are three fundamental reasons why installing the driver is so convoluted and they are (a) you can not install a graphics driver if you have graphics running, (b) in particular you have to get rid of the nouveau driver and its non-trivial to do so, and finally (c) you have to be able to "compile" the NVIDIA driver against your current Linux and that means having the development environment loaded.

There is one more reason too that this note was written. There is so much craziness on the Internet about what to do with graphics drivers that I am adding my own opinion to the mix, along with clear instructions.

In order to follow these steps, you need to know how to do basic Unix/Linux things like ls, cd, chmod and so forth, have the su/root password, be able to use a text editor like vi that can work without X running, have access to the Internet, be able to use a web browser to download files, and be able to follow instructions.

In this post, I am just going to outline what you will have to do to install the driver. In the next post, I will fill in the details of how to actually do these things.

So hold on everybody, here we go!

1. Are you already running the NVIDIA driver? How can you tell for sure?
2. Install the development tools.
3. Figure out the model of your graphics card.
4. Figure out if your Linux is 32 or 64 bit
5. Download the driver from NVIDIA.
6. Put that driver someplace easy to get to, like /tmp and make it executable.

Now we get into the more tricky stuff.

7. Change /etc/inittab to bring the system up at level 3
8. Blacklist Nouveau, Part 1
9. Blacklist Nouveau, Part 2
10. Reboot
11. Log in as root
12. Verify the location of the system kernel libraries
13. Install the Nvidia driver (say yes to compatibility mode if you are asked)
14. Restore the /etc/inittab runlevel to 5
15. Reboot the system

We are almost done, hang in there!

16. As su, run "nvidia-xconfig"
17. Run "nvidia-settings" and save your work.

My goodness, that was annoying wasn't it?

The next post will have the mere details of how you actually do these things. The only thing really, really arcane is the blacklist of Nouveau.