Post install dcache headnode

From T2B Wiki
Revision as of 12:28, 26 August 2015 by Maintenance script (talk | contribs) (Created page with " === Prepare and format partitions === == ''Make sure postgres is not running'' == ==== Prostgres DB disk ==== Run the following lines <pre> dev=/dev/cciss/c0...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


Prepare and format partitions

Make sure postgres is not running

Prostgres DB disk

Run the following lines

dev=/dev/cciss/c0d1
dd if=/dev/zero of=$dev bs=1M count=1
/sbin/parted $dev mklabel gpt
end_in_MB=<tt>/sbin/parted $dev unit MB print |sed -nr '{ s#Disk[[:space:]]+/dev/cciss/c0d1+:[[:space:]]([0-9]+)MB#\1#p }'</tt>
/sbin/parted $dev mkpart xfs 1 $end_in_MB

dev=/dev/cciss/c0d1p1
sunit=256
data_disks=2
swidth=$(($sunit*$data_disks))
/sbin/mkfs.xfs -d sunit=$sunit,swidth=$swidth $dev


xlog disk

  • With fdisk do
fdisk /dev/cciss/c0d2
  • Press n to create a new partition and just accept the default values for beginning and end of the disk
  • Press w to write and wait till it is done
  • format the partition with ext2
mkfs.ext2 /dev/cciss/c0d2p1

Edit /etc/fstab

Make sure /etc/fstab looks likes that

[root@dcache3-shadow ~]# cat /etc/fstab 
LABEL=/                 /                       ext3    defaults        1 1
/dev/vg.01/usrvol       /usr                    ext3    defaults        1 2
/dev/vg.01/optvol       /opt                    ext3    defaults        1 2
/dev/vg.01/zvarvol      /var                    ext3    defaults        1 2
/dev/vg.01/tmpvol       /tmp                    ext3    defaults        1 2
LABEL=/boot             /boot                   ext2    defaults        1 2
/dev/cciss/c0d2p1       /xlog                   ext2    defaults,noatime 1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/dev/cciss/c0d0p3       swap                    swap    defaults        0 0
/dev/cciss/c0d1p1       /var/lib/pgsql          xfs     defaults        0 0

Notice lines beginning with /dev/cciss/c0d1p1 with xfs and /dev/cciss/c0d2p1 with ext2

Prepare the mounting step

  • backup /var/lib/pgsql
mkdir /root/backup-pgsql
mv /var/lib/pgsql /root/backup-pgsql
  • create the mount point for xlog
mkdir /xlog


Mount and symlinks

  • Mount all new partitions:
mkdir /var/lib/pgsql
mount -a
  • put back the backup files
mv /root/backup-pgsql/pgsql/* /var/lib/pgsql/
chown -R postgres.postgres /var/lib/pgsql/
  • Make a symlink to the new special location for xlog
cd /var/lib/pgsql/data/
mv pg_xlog /xlog/pg_xlog
ln -s /xlog/pg_xlog pg_xlog



Template:TracNotice