Commit 95c3c87b authored by Miguel Esteva's avatar Miguel Esteva

Initial commit

parents
#!/bin/bash
version=$(cat /etc/redhat-release | sed 's/[^.0-9]*//g')
major_version=$(echo $version | cut -d. -f1)
# To stop filesystems on centos 6
if [[ $major_version -eq "6" ]]
then
echo "CentOS 6"
# Unmount wehisan
if [[ `mount | grep -c wehisan` -ne "0" ]]
then
echo "Unmounting /wehisan..."
sleep 2
umount /wehisan/*
fi
# Stop and unload CVFS
if [[ `pgrep fsmpm | wc -l` -ne 0 ]]
then
echo "Stopping CVFS..."
service cvfs fullstop
fi
# Make sure cvfs is stopped and that the kernel module is unloaded
if [[ `lsmod | grep -c cvfs` -ne 0 ]]
then
echo "CVFS is still loaded."
exit 1
fi
# Add the NFS fix
sed "s/\/stornext\/General /\/stornext\/General_real /" /etc/fstab -i
mkdir -p /stornext/General_real
echo "/stornext/General_real localhost(rw,no_root_squash)" > /etc/exports
# Fix rc.local
echo "# New mounts and fixes" >> /etc/rc.local
echo "service nfs start" >> /etc/rc.local
echo "mount localhost:/stornext/General_real /wehisan/general" >> /etc/rc.local
echo "mount localhost:/stornext/General_real/tempdata /wehisan/tmpgeneral" >> /etc/rc.local
echo "mount --bind /stornext/General_real/data /wehisan/general" >> /etc/rc.local
echo "mount --bind /stornext/General_real/tmpdata /wehisan/tmpgeneral" >> /etc/rc.local
sed -i "/mount --bind \/stornext\/General\/data \/wehisan\/general/d" /etc/rc.local
sed -i "/mount --bind \/stornext\/General\/tmpdata \/wehisan\/tmpgeneral/d" /etc/rc.local
# Install the RPMS
yum -y --nogpgcheck localinstall ./6/*.rpm
# Start cvfs
service cvfs start
# Start NFS
service nfs start
mount localhost:/stornext/General_real /wehisan/general
mount localhost:/stornext/General_real/tempdata /wehisan/tmpgeneral
# Mount wehisan
mount --bind /stornext/Archive/data /wehisan/archive
mount --bind /stornext/General_real/data /wehisan/general
mount --bind /stornext/General_real/tmpdata /wehisan/tmpgeneral
mount --bind /stornext/Home/data /wehisan/home
mount --bind /stornext/Bioinf/data /wehisan/bioinf
mount --bind /stornext/Genomics/data /wehisan/genomics
fi
# To stop filesystems on centos 7
if [[ $major_version -eq "7" ]]
then
echo "CentOS 7"
# Stop and unload CVFS
if [[ `pgrep fsmpm | wc -l` -ne 0 ]]
then
echo "Stopping CVFS..."
service cvfs fullstop
fi
# Make sure cvfs is stopped and that the kernel module is unloaded
if [[ `lsmod | grep -c cvfs` -ne 0 ]]
then
echo "CVFS is still loaded."
exit 1
fi
# Add NFS fix
sed "s/\/stornext\/System /\/stornext\/System_real /" /etc/fstab -i
mkdir -p /stornext/System_real
echo "/stornext/System_real localhost(rw,no_root_squash)" > /etc/exports
echo "# NFS fixes and new mounts" >> /etc/rc.local
echo "service nfs start" >> /etc/rc.local
echo "mount localhost:/stornext/System_real /stornext/System" >> /etc/rc.local
# Install the RPMS
yum -y --nogpgcheck localinstall ./7/*.rpm
# Start cvfs
service cvfs start
# Start NFS
service nfs start
mount localhost:/stornext/System_real /stornext/System
fi
#!/bin/bash
version=$(cat /etc/redhat-release | sed 's/[^.0-9]*//g')
major_version=$(echo $version | cut -d. -f1)
# To stop filesystems on centos 6
if [[ $major_version -eq "6" ]]
then
echo "CentOS 6"
# Unmount wehisan
if [[ `mount | grep -c wehisan` -ne "0" ]]
then
echo "Unmounting /wehisan..."
sleep 2
umount /wehisan/*
fi
# Stop and unload CVFS
if [[ `pgrep fsmpm | wc -l` -ne 0 ]]
then
echo "Stopping CVFS..."
service cvfs fullstop
fi
# Make sure cvfs is stopped and that the kernel module is unloaded
if [[ `lsmod | grep -c cvfs` -ne 0 ]]
then
echo "CVFS is still loaded."
exit 1
fi
# Add the NFS fix
sed "s/\/stornext\/General /\/stornext\/General_real /" /etc/fstab -i
mkdir -p /stornext/General_real
echo "/stornext/General_real localhost(rw,no_root_squash)" > /etc/exports
echo "service nfs start" >> /etc/rc.local
# Install the RPMS
yum -y --nogpgcheck localinstall ./6/*.rpm
# Start cvfs
service cvfs start
# Start NFS
service nfs start
# Fix rc.local
sed -i "s|mount --bind /stornext/General/data /wehisan/general||" /etc/rc.local
sed -i "s|mount --bind /stornext/General/tmpdata /wehisan/tmpgeneral|mount localhost:/stornext/General_real/tempdata /wehisan/tmpgeneral|" /etc/rc.local
# Mount wehisan
mount --bind /stornext/Archive/data /wehisan/archive
#mount --bind /stornext/General/data /wehisan/general
mount localhost:/stornext/General_real /wehisan/general
#mount --bind /stornext/General/tmpdata /wehisan/tmpgeneral
mount localhost:/stornext/General_real/tempdata /wehisan/tmpgeneral
mount --bind /stornext/Home/data /wehisan/home
mount --bind /stornext/Bioinf/data /wehisan/bioinf
mount --bind /stornext/Genomics/data /wehisan/genomics
fi
# To stop filesystems on centos 7
if [[ $major_version -eq "7" ]]
then
echo "CentOS 7"
# Stop and unload CVFS
if [[ `pgrep fsmpm | wc -l` -ne 0 ]]
then
echo "Stopping CVFS..."
service cvfs fullstop
fi
# Make sure cvfs is stopped and that the kernel module is unloaded
if [[ `lsmod | grep -c cvfs` -ne 0 ]]
then
echo "CVFS is still loaded."
exit 1
fi
# Add NFS fix
sed "s/\/stornext\/System /\/stornext\/System_real /" /etc/fstab -i
mkdir -p /stornext/System_real
echo "/stornext/System_real localhost(rw,no_root_squash)" > /etc/exports
echo "service nfs start" >> /etc/rc.local
echo "mount localhost:/stornext/System_real /stornext/System" >> /etc/rc.local
# Install the RPMS
yum -y --nogpgcheck localinstall ./7/*.rpm
# Start cvfs
service cvfs start
# Start NFS
service nfs start
mount localhost:/stornext/System_real /stornext/System
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment