Updating the OS

All work on the OS should be done on the test usno cluster at the NRAO in Socorro, NM. This way it can be tested before copied to the real USNO cluster in DC.


USNO Server

Updating the OS

These docs are not finished and should not be used yet. For one thing they don't talk about if the OS image is NFS mounted, local disk, ramdisk, etc.

You may want to use the --bwlimit=50 option to rsync to limit the bandwidth it uses when copying. This is especially usefull when copying files during non-maint times.

export OSVER=<os_version> where <os_version> is like rhel6.3
export LOGIN=<username>

rsync the necessary repos
mkdir -p /export/home/usno-serv/updates/yum/$OSVER/x86_64
cd /export/home/usno-serv/updates/yum/$OSVER/x86_64
rsync -vaz --delete ${LOGIN}@ssh.aoc.nrao.edu:/home/os/redhat/updates/yum/$OSVER/x86_64/addons .
rsync -vaz --delete ${LOGIN}@ssh.aoc.nrao.edu:/home/os/redhat/updates/yum/$OSVER/x86_64/updates .
rsync -vaz --delete ${LOGIN}@ssh.aoc.nrao.edu:/home/os/redhat/updates/yum/$OSVER/x86_64/kernel .
ADD LINE for PULLER update exclude kernel
ADD LINE for PULLER update include kernel into kernel area

edit /etc/yum.repos.d/update.repo
[updates] name=update to the latest baseurl=file:///update/updates enabled=1

Make a symlink for simplicity
ln -s /export/home/usno-serv/updates/yum/$OSVER/x86_64 /update

install
yum -y --noplugins --disablerepo=* --enablerepo=updates update
yum -y --noplugins --disablerepo=* localinstall /update/addons/*.rpm

new_kernel_version="`rpm -p -q --qf='%{VERSION}-%{RELEASE}.%{ARCH}\n' /update/kernel/kernel-2*`"
OLD_KERNEL_VERSION=`uname -r`
cp /etc/grub.conf /etc/grub.conf.$$
rpm -Uvh --nosignature /update/kernel/kernel-headers-${new_kernel_version}*.rpm
rpm -Uvh --nosignature /update/kernel/kernel-doc-${new_kernel_version}*.rpm
rpm -ivh --nosignature /update/kernel/kernel-${new_kernel_version}*.rpm /update/kernel/kernel-devel-${new_kernel_version}*.rpm /update/kernel/kernel-firmware-${new_kernel_version}*.rpm
sed -e "s/${OLD_KERNEL_VERSION}/${new_kernel_version}/g" /etc/grub.conf.$$ > /etc/grub.conf
rm /etc/grub.conf.$$

rm -f /etc/yum.repos.d/update.repo
rm -f /update


Upgrading to a new minor version of the OS

These docs are not finished and should not be used yet. For one thing they don't talk about if the OS image is NFS mounted, local disk, ramdisk, etc.

You may want to use the --bwlimit=50 option to rsync to limit the bandwidth it uses when copying. The is especially usefull when copying files during non-maint times.

export OSVER=<os_version> where <os_version> is like rhel6.4
export OLDOSVER=<os_version> where <os_version> is like rhel6.3
export LOGIN=<username>

rsync the necessary repos
mkdir -p /export/home/usno-serv/updates/yum/$OSVER/x86_64
cd /export/home/usno-serv/updates/yum/$OSVER/x86_64
rsync -vaz --delete ${LOGIN}@ssh.aoc.nrao.edu:/home/os/redhat/updates/yum/$OLDOSVER/x86_64/installs_to_* .
rsync -vaz --delete ${LOGIN}@ssh.aoc.nrao.edu:/home/os/redhat/updates/yum/$OLDOSVER/x86_64/updates_to_* .
rsync -vaz --delete ${LOGIN}@ssh.aoc.nrao.edu:/home/os/redhat/updates/yum/$OSVER/x86_64/addons .
rsync -vaz --delete ${LOGIN}@ssh.aoc.nrao.edu:/home/os/redhat/updates/yum/$OSVER/x86_64/updates .
rsync -vaz --delete ${LOGIN}@ssh.aoc.nrao.edu:/home/os/redhat/updates/yum/$OSVER/x86_64/kernel .

edit /etc/yum.repos.d/update.repo
Be sure to change update_to_6.4 to the correct directory
[updates_to_latest] name=updates applied to the current OS to make it the next version baseurl=file:///update/updates_to_6.4 enabled=1 [updates] name=update to the latest baseurl=file:///update/updates enabled=1

ln -s /export/home/usno-serv/updates/yum/$OSVER/x86_64 /update

install
yum -y --noplugins --disablerepo=* --enablerepo=updates_to_latest update
yum -y --noplugins --disablerepo=* localinstall /update/installs_to_6.4/*.rpm
yum -y --noplugins --disablerepo=* --enablerepo=updates update
yum -y --noplugins --disablerepo=* localinstall /update/addons/*.rpm

new_kernel_version="`rpm -p -q --qf='%{VERSION}-%{RELEASE}.%{ARCH}\n' /update/kernel/kernel-2*`"
OLD_KERNEL_VERSION=`uname -r`
cp /etc/grub.conf /etc/grub.conf.$$
rpm -Uvh /update/kernel/kernel-headers*
rpm -ivh /update/kernel/kernel-d* /update/kernel/kernel-2*
sed -e "s/${OLD_KERNEL_VERSION}/${new_kernel_version}/g" /etc/grub.conf.$$ > /etc/grub.conf
rm /etc/grub.conf.$$

sed -i -e "s|/$OLDOSVER/|/$OSVER/|g" /etc/init.d/autoyum
sed -i -e "s|/$OLDOSVER/|/$OSVER/|g" /etc/yum.repos.d/autoyum_`arch`.repo
sed -i -e "s|/$OLDOSVER/|/$OSVER/|g" /etc/yum.repos.d/casa.repo

rm -f /etc/yum.repos.d/update.repo
rm -f /update

Installing RPMs

Since we seperate / from /usr we need to recombine them before installing any RPMs. I do this with an NFS mount and then chroot.

Copy the RPM to the diskless area
cp <filename>.rpm /opt/services/build/os-image/root/
mount usno-serv-1:/export/home/usno-serv/client_fs/usr /opt/services/build/os-image/usr
chroot /opt/services/build/os-image
  mount -t proc none /proc
  mkdir /tmp
  rpm -Uvh /root/*.rpm
  rm -rf /tmp
  umount /proc
  exit
umount /opt/services/build/os-image/usr
rm -f /opt/services/build/os-image/root/*.rpm


Topic revision: r10 - 2015-12-17, JamesRobnett
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding NRAO Public Wiki? Send feedback