F8 is an excellent release!

Mike C mike.cohler at gmail.com
Sat Nov 24 17:49:50 UTC 2007


Timothy Murphy <tim <at> birdsnest.maths.tcd.ie> writes:

> This seems to me more or less useless advice
> unless you say what you consider the "important files",
> and how you "edit" them.
> Also you'd have to say what services you are running.
> A HOWTO that said that would indeed be useful.

OK I will summarise:

First make sure that if you have not got your /opt and /home on a separate 
partition then make one (or two partitions) and rsync the entire directory
structure for these two to non-root partitions.  If you wish you can use just 
one  partition, say /home and then make a symlink from /home/opt to /opt -
then all your user files in /home are not in the root partition, and any apps
and other file and programs can be put into /opt

Let's assume you are running F7 currently (but this works for any existing
version) you can copy the /etc /var and /root directories to /opt using a 
script.

An example is:
#!/bin/bash
#
# Back up /etc and /var 
  USE_AUTO_FS=0
  ME_HOST=`hostname`
  ME_HOST=${ME_HOST%%.*}
  BAKDIR="/opt/Local/backups"
  echo "Backing up $ME_HOST onto $BAKDIR"
  list="/etc /var /root"

  ToDir="$BAKDIR/"

  # echo "Doing ls in $ToDir"
  # ls $ToDir

  for i in $list
  do
      echo " Doing $i ..."
      rsync --delete -aH --exclude 'lost+found' --exclude
'/var/named/chroot/proc/*' --exclude '/var/cache/*' $i $ToDir
  done
  exit 0
 
Now make sure you know which partitions you have for / and /opt etc. Say 
/ is on sda5 and /home (and /opt) on sda7

Now you can do the clean install as follows:
(before you start you might want to run a complete backup of /opt and /home
also onto an external disc or rsync to another machine for safety)

Begin the install, and choose install rather than upgrade, by one of the
normal methods (DVD HD HTTP NFS etc)
When it gets to the disk partitioning do not let anaconda do it automatically
but choose custom disk partitioning.

For the list of partitions that comes up double click on sda5 which will be
listed as having a / label.  Choose to relabel is as / and ask to format
as ext3.

For sda7 relabel as /home (to match what you had before you began the install
but do NOT ask it to reformat. Do the same with any other partitions you wish
to preserve.

When it gets to the selection of packages you need to go through each package
group and specifically select or deselect every package you want in turn.
Make sure you don't miss the optional packages, and make sure you select
"customise now" before doing the selections.

When it gets to creating new users - decline. It will prompt again to ask 
if you are sure - and continue without creating new users.

Now let the install proceed - for modern systems with fast discs this is
usually between 25 and 45 minutes even for a large number of packages
selected to install.

Once the main install is done then at firstboot I switch selinux to disabled.
You have a free choice of course!

Now I let the system reboot and login as root.

The key files and changes that need to be copied into the new root partition
are as follows:

1) First do
cd /
then if your /home was a separate partition it should already be there and 
you can check by doing ls /home  -  if your /opt was a subdirectory in /home
then /home/opt should be visible when doing ls /home.

Now you can change the default /opt within the root partition to point
at the pre-existing partition by:
mv opt opt.DIST
ln -s /home/opt .

Now check that /opt is visible by 
ls /opt

2)
Next step is to put the user links back - the user files should all be
in /home but the password and group information is not in the root partition
yet.

So 
cd /etc
mkdir OLD
cp passwd OLD/
cp group OLD/
cp shadow OLD/
cp gshadow OLD/

chmod 600 shadow gshadow

The four lines before the chmod command make backup copies into a directory
you created called OLD in the /etc directory.
Now for each of these file you need to bring back the specific lines for each
previously defined user.
So in the case of the passwd file, first 
tail path-to-old-backup-of-etc/passwd
Now copy the user lines exactly and then
vim passwd
Now navigate to the end of the file and paste in the user lines from the 
backup passwd file, and save the new file.

Do the same for group, shadow and gshadow.

Now put the permissions back for the shadow files.
chmod 400 shadow gshadow

Now the user areas are in place and you can login as any of the old users.
However I do not login until I have put everything else in place.

3) Next re-instate the following files using the same technique as above
a) /etc/sysconfig/network-scripts/ifcfg-eth0 plus eth1, wlan0, ath0 etc
depending on what you had previously.
b) /etc/sysconfig/network reinstate from previous backup
c) /etc/sysconfig/desktop create and include the follwing lines if you use
KDE:
DESKTOP="KDE"
DISPLAYMANAGER="KDE"
d) /etc/hosts
e) /etc/resolv.conf (if you use dhcp then this is created when you start
the network automatically)
f) If you are running a dhcp server then re-instate or create a suitable
/etc/dhcpd.conf
g) If you are running a dns server then create/re-instate 
/var/named/chroot/etc/named.conf
/var/named/chroot/vae/named/yourzonefiles.zone

h) Useful to amend /etc/sysctl.conf to have kernel.sysrq=1
Then allows a boot in the event of emergency using alt-sysrq-b
i) Re-instate /etc/aliases
j) cd /etc/mail and re-instate 
/etc/mail/mailertable 
/etc/mail/local-host-names
also any other files associated with mail setup

k) re-instate /etc/ntp.conf

l) Put in place any personlised firewall (if you have one) and save it 
using
service iptables save

m) Select any services you want to add or remove 
eg 
service ntpd start
chkconfig ntpd on
(The latter ensures this starts at boot next time too)

Switch any services you don't need to off 
eg
service bluetooth stop
chkconfig bluetooth off
service yum-updatesd stop
service yum-updatesd off

n) I usually edit /etc/yum.conf and switch keepcache to 1 to keep the 
rpm files after updates, and change install_only to 4 so that 4 kernels
are kept at any time.

o) I now personalise the files in /etc/yum.repos.d/ to select local mirrors
I get the livna rpm and use rpm to install the livna repos
Wget the file livna-release-8.rpm from the livna web site and then
rpm -ivh livna-release-8.rpm
Now I can install livna rpms. 
I do the same for the flash-plugin repo from adobe.
p) Next I usually now install additional packages I need
eg
yum -y install crystal crystal-clear gkrellm kdeartwork-icons
yum -y install flash-plugin

For F8 I then remove pulseaudio
yum -y remove alsa-plugins-pulseaudio

Also I add in extra packages such as:
yum -y install compat-libstdc++-33 compat-libstdc++-296 system-config-bind

q) Now update everything
yum -y update

r) Now edit the kdmrc file at /etc/kde/kdm/kdmrc and change UseTheme=true
to UseTheme=false which then allows the kdm login manager to be changed (if
you use kde)

Basically the install is now complete and I re-boot at this stage, and
login to my normal user account.

At this point any personalisation for backgrounds can be changed and the 
login manager personalised in the KDE control centre.

Note that I also don;t use yum-updatesd but that is a personal choice.

OK that is a "brief" summary - for F8 each install plus post-insall
configuration according to the above takes me about 2 to 2.5 hours.

I hope this helps! (and please excuse any typos that crept in as I type this!)

Mike




More information about the fedora-list mailing list