home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 8 / CDACTUAL8.iso / docs / mini / upgrade < prev    next >
Encoding:
Text File  |  1996-07-11  |  13.7 KB  |  314 lines

  1.   Upgrading Your linux Distribution mini-HOWTO
  2.   Greg Louis, glouis@dynamicro.on.ca
  3.   v1.1, 11 May 1996
  4.  
  5.   Hints and tips on upgrading from one linux distribution to another.
  6.  
  7.   1.  IMPORTANT!!! Disclaimer and Copyright
  8.  
  9.   The procedure to which this document attempts to be a guide is
  10.   inherently dangerous to the programs and data stored in your computer.
  11.   You carry out any such procedure entirely at your own risk.  The steps
  12.   described in this document worked for the author; there is no
  13.   guarantee that they will work for you, nor that you can attempt to
  14.   follow them without serious damage to your computer's programs and/or
  15.   data.  You are entirely on your own in any use you may make of the
  16.   information presented herein, and the author shall not be liable in
  17.   any way whatsoever for any damage or inconvenience of any kind that
  18.   you may suffer in so doing.
  19.  
  20.   This document is copyright 1996, Dynamicro Consulting Limited, and is
  21.   released under the terms of the GNU General Public License.  This
  22.   basically means that you may copy and modify it at will, but may not
  23.   prevent others from doing likewise.
  24.  
  25.   Comments and questions may be directed to the author.  Especially
  26.   welcome, for use in future revisions, are accounts of successful
  27.   upgrades of complex systems.
  28.  
  29.   2.  Introduction
  30.  
  31.   2.1.  How to slay and reincarnate your linux box!
  32.  
  33.   The purpose of this document is to offer tips to help you through the
  34.   destruction and reinstallation of a linux system.  It's not a
  35.   foolproof cookbook by any means; but I hope it will serve as some
  36.   indication of what you need to think about, and of the order in which
  37.   to do things.  It would have been a help to me, if someone else had
  38.   written something like this before I did my first upgrade; so I hope
  39.   it will be a help to you, if you have a linux machine to rebuild.
  40.  
  41.   Don't take it as gospel, though: your mileage will almost certainly
  42.   vary.  Even the directory names in this document may be different from
  43.   the ones you need to use; some people have /usr/home instead of /home,
  44.   for example; others call it /u, and some (delicate shudder :) even put
  45.   all their users directly under /usr itself!  I can't be specific about
  46.   your system, so I've just used the names the way they are in mine.
  47.  
  48.   You'll also notice that I use Slackware distributions, and that I
  49.   assume you've enough RAM and hard disk space to install linux kernel
  50.   source and build your own kernel.  If your system is different, some
  51.   of my recommendations won't apply; but I hope you'll still find the
  52.   general outline to be of assistance in your rebuild project.
  53.  
  54.   2.2.  Why would anyone want to do that?
  55.  
  56.   Good question!  If it can possibly be avoided, don't do it!  (That's
  57.   the single most important recommendation in this whole guide!!!)  But
  58.   there are times when you may have to.
  59.  
  60.   For example, I installed a 4Gb hard disk and then found out that
  61.   Slackware 2.0 vintage linux didn't know a hard disk could have more
  62.   than 2Gb, and it got horribly confused.  So I had to upgrade to the
  63.   then-current Slackware 2.3.  That upgrade was a gruelling experience,
  64.   and it's part of the reason I'm writing these notes.  I did just about
  65.   everything wrong, and only good luck and the fact that I had another
  66.   running linux box beside me saved me from disaster.
  67.  
  68.   As another example, I found that I just couldn't succeed in building a
  69.   working a.out linux kernel in the 1.3 series, using an out-of-the-box
  70.   Slackware 2.3 installation (another machine, not the one I botched
  71.   before).  I took the plunge, bought Slackware 3.0 on CDROM and
  72.   converted to ELF.  This time the reinstallation went better, thanks in
  73.   part to the previous bitter experience, and it served as the source of
  74.   most of the ideas I'm offering you here.
  75.  
  76.   2.3.  Do you have to ``destroy and reinstall?''
  77.  
  78.   It's safer, oddly enough.  If you install over top of an existing
  79.   linux system, chances are you'll have a mixture of old and new
  80.   binaries, old and new configuration files, and generally a mess to try
  81.   to administer.  Wiping the system clean, and then putting back only
  82.   what you know you need, is a drastic but effective way to get a clean
  83.   result.  (Of course we're talking about installing a whole new linux
  84.   distribution here, not about upgrading one or two packages!  The best
  85.   way to avoid having to do a full reinstallation is, precisely, to keep
  86.   the individual bits -- especially gcc and its libraries, and binutils
  87.   -- current.  If the stuff you use is reasonably up-to-date, and you
  88.   can keep it so by bringing in, and if need be compiling, new code from
  89.   time to time, then there's no need for a mass upgrade.)
  90.  
  91.   As Patrick Volkerding points out (he too recommends the wipe-it-clean
  92.   procedure for upgrades), installing ELF on top of a running a.out
  93.   system is a recipe for disaster; at least, if you know enough to try
  94.   it, you needn't read this guide!
  95.  
  96.   Even without that complication, though, you're better to build from
  97.   scratch.
  98.  
  99.   2.4.  How long will it take?
  100.  
  101.   Depends, of course, on how complex your system is.  But I figure that,
  102.   for the successful upgrade (the other one? -- don't ask! :) I spent
  103.   about ten hours making backups, six hours rebuilding the system to the
  104.   point where I could enable logins, and another half day or thereabouts
  105.   restoring the less-crucial stuff.  As time passes I keep discovering
  106.   little things that still aren't exactly as I want them -- I fix these
  107.   as they're encountered -- but in the main, twenty hours' work should
  108.   suffice for a reasonably complex rebuilding job.  Maybe less if you're
  109.   reinstalling from hard disk (I used CDROM) or more if you need to
  110.   install from floppies.  Maybe less if you've got a fast Pentium, more
  111.   if it's a 386.  You get the idea.
  112.  
  113.   So much for the introduction.  Here's how to set about it, once you've
  114.   decided it must be done.  Arm yourself with fortitude and Jolt or
  115.   whatever, and:
  116.  
  117.   3.  Write down everything you do.
  118.  
  119.   It's extremely valuable to have a record of what you've done in the
  120.   process of preparing for, and carrying out, the changeover.
  121.   Especially important is a list of the backups you'll be making in
  122.   preparation for the destruction of your existing system.
  123.  
  124.   4.  Make a full backup of the existing system.
  125.  
  126.   Generally speaking, backups tend to be written on media that are
  127.   sequentially accessed.  That being so, you won't want to use this
  128.   complete backup for restoring significant numbers of files; it's got
  129.   too many files on it that you don't want.  It's better to create small
  130.   backups of individual segments that you know you're going to restore
  131.   in their entirety.  I'll list a bunch of examples later.
  132.  
  133.   Why then should you start with a full backup?  Two basic reasons:
  134.   first, in the event of a catastrophic failure installing the new
  135.   system, you'll have a way to get back to the starting point with
  136.   minimum pain.  Second, no matter how carefully you prepare for the new
  137.   installation, there is a very large chance that one or two important
  138.   files will be overlooked.  In that case the clumsiness of restoring
  139.   those one or two files from the full backup set will be preferable to
  140.   the inconvenience of doing without them.
  141.  
  142.   5.  Back up /etc and its subdirectories on one or more floppies.
  143.  
  144.   This is the other extreme: you won't be restoring these files (for the
  145.   most part, anyway); you'll be comparing them with the new ones that
  146.   get created during installation.  Why?  Because the new ones may have
  147.   data that the old ones didn't, or may express the old data in new
  148.   ways.  Changes in protocols, addition of new tools, or implementation
  149.   of new features in existing tools may all dictate changes in the
  150.   formats of the configuration files and startup scripts that the /etc
  151.   tree contains, and you'll very likely have to edit your old data into
  152.   these files so as to preserve the new formats and take advantage of
  153.   the improvements.
  154.  
  155.   6.  Make separate backups of each group of files you want to preserve.
  156.  
  157.   This is the most variable part of the job, and all I can really do to
  158.   help is to describe what I did in my system, in the hope that it will
  159.   serve as a rough guide.  Basically, you want to look at every
  160.   directory that contains files that aren't part of your standard linux
  161.   installation, or files that are actually newer than the ones you'll
  162.   install when you do your new linux installation, and separate out only
  163.   those files that you want to carry over.
  164.  
  165.   In my case, I ended up making a .tgz file on the backup medium for
  166.   each of
  167.  
  168.   ╖  /usr/lib/rn
  169.  
  170.   ╖  /usr/lib/smail
  171.  
  172.   ╖  /usr/lib/trn (the rest of /usr/lib would be reinstalled)
  173.  
  174.   ╖  /usr/local/src
  175.  
  176.   ╖  /usr/local/bin
  177.  
  178.   ╖  /usr/local/lib
  179.  
  180.   ╖  /usr/local/lpfont
  181.  
  182.   ╖  /usr/local/man
  183.  
  184.   ╖  /usr/local/sbin
  185.  
  186.   ╖  /usr/local/thot (there were other /usr/local files I didn't need)
  187.  
  188.   ╖  /usr/openwin
  189.  
  190.   ╖  /usr/src/lilo-17 (because my new Slackware still had version 16)
  191.  
  192.   ╖  /usr/src/linux-1.2.13 (because I'd done some customizing)
  193.  
  194.   ╖  /usr/X11R6/lib/X11/app-defaults
  195.  
  196.   ╖  /usr/X11R6/lib/X11/initrc (the rest of Xfree86 was to be
  197.      reinstalled)
  198.  
  199.   ╖  /var/named
  200.  
  201.   ╖  /var/openwin
  202.  
  203.   ╖  /var/texfonts
  204.  
  205.   My machine was relatively easy in that there were no spool files to
  206.   worry about.  I don't run a news spool on this box, and since there
  207.   are only two users, it was easiest just to get all the mail read
  208.   before shutting down.  Otherwise, /var/spool directories would have
  209.   had to be backed up at the last minute.  (And, of course, the news
  210.   library and site directories!)
  211.  
  212.   7.  Prepare root and boot floppies for the new installation.
  213.  
  214.   Details of how to do this will be found in the installation guide for
  215.   your new distribution.
  216.  
  217.   8.  Format floppies for the temporary kernel and the final build.
  218.  
  219.   You'll need two, one floppy for each.
  220.  
  221.   After all that's done, you're ready for the Big Moment.  The next step
  222.   removes the system from production.
  223.  
  224.   9.  Inhibit logins and back up the /root and /home trees.
  225.  
  226.   This is the last thing to be done on the old system before you destroy
  227.   it, so as to carry forward the most current user and root information.
  228.  
  229.   10.  Boot from the new installation's boot and root floppies.
  230.  
  231.   11.  Delete the linux partitions with fdisk and recreate them.
  232.  
  233.   The installation guide will explain how to set about doing this, which
  234.   will destroy the old system.  From now on you're dependent on the
  235.   quality of the backups you made in the earlier steps!  You have been
  236.   warned!
  237.  
  238.   12.  Run the new linux installation.
  239.  
  240.   There are already several good documents describing how to do this, so
  241.   I'm not going into any detail.  Continue from here when the new system
  242.   can boot from its hard disk.
  243.  
  244.   Along the way, be sure to make a floppy that you can boot as well,
  245.   since the kernel that the linux setup installs has to be replaced and
  246.   accidents can happen during that process.  Be sure to install the
  247.   development packages and the kernel source.
  248.  
  249.   13.  With the new linux system booted from the hard disk, edit
  250.   /etc/fstab
  251.  
  252.   and add your swap partition.  Then run the command "swapon -a".  I
  253.   don't know why, but Slackware setup doesn't offer to do this for you
  254.   if your swap partition exists already.  Then, when you boot your new
  255.   system and the rc.S script tries to turn swapping on, it can't find
  256.   the partition in the fstab file and swapping doesn't get enabled.
  257.   This step fixes it.
  258.  
  259.   14.  Restore configuration data to the /etc directory and subdirecto¡
  260.   ries.
  261.  
  262.   As described above, you can't just copy all of the old files back into
  263.   /etc and expect things to work properly afterward.  Some files you can
  264.   do that with; for example, /etc/XF86Config (as long as you're using
  265.   the same version of Xfree86 -- and the same video hardware -- in the
  266.   new installation as you did in the old).  For the most part, though,
  267.   it's best to use diff to compare the old and new files before doing
  268.   any copying.  Watch out especially for significant changes in the
  269.   files in /etc/rc.d, which may require you to reestablish your old
  270.   configuration by hand editing, instead of by copying the old rc
  271.   scripts from your backup.  Once it's all done, reboot.
  272.  
  273.   15.  Configure and rebuild the linux kernel.
  274.  
  275.   Even if you don't absolutely have to do this in order to get a kernel
  276.   that supports your hardware, it's worth doing it in order to get a
  277.   kernel that doesn't contain masses of drivers for stuff your machine
  278.   doesn't have.  Install the rebuilt kernel on a floppy at first; once
  279.   that boots ok, install on the hard disk, run lilo if you're using it,
  280.   and reboot.
  281.  
  282.   16.  Restore the stuff from the backups you made earlier.
  283.  
  284.   Some of the binaries may need to be reinstalled from the source
  285.   directories; I had to do that with lilo, for example, since my version
  286.   was newer than the one on the Slackware installation and I hadn't
  287.   bothered to save the binary from /sbin.  You'll want to check through
  288.   your restored programs and confirm the existence and correctness of
  289.   configuration files, libraries and so on.  In some cases, you may have
  290.   to restore things in a specific order; you did make notes during
  291.   backup, didn't you? ;-)
  292.  
  293.   17.  Review security.
  294.  
  295.   Check file permissions and directory permissions to be sure that
  296.   access is neither too restricted nor too easy.  I find that Slackware
  297.   tends to lean toward a more open environment than I like, so I go
  298.   around changing 755's to 711's in the .../bin directories and stuff
  299.   like that.  Or even 700's in the .../sbin ones.  Especial care is
  300.   needed if you've carried over an ftp server; but then, if you were
  301.   running an ftp server, you probably thought of that already. :)
  302.  
  303.   18.  Enable logins.
  304.  
  305.   You're up and running.  Over the next little while, there'll probably
  306.   be details to clean up; but the bulk of the work is done.  Enjoy!
  307.  
  308.   19.  Sorry, but once again:
  309.  
  310.   USE THIS INFORMATION AT YOUR OWN RISK!
  311.  
  312.   (See the disclaimer at the start of this document.)
  313.  
  314.