Server Information :
master                 :192.168.2.2
OS                        :Red Hat Enterprise Linux Server release 7.3 Beta (Maipo)
MASTER PARTITION:
  • /mnt/DATA
  • /mnt/archive
  • /mnt/backup
1.Configure the network on  Master:
[postgres@master ]$ cat /etc/redhat-release Red Hat Enterprise Linux Server release 7.3 Beta (Maipo)--Netcard Entrycd /etc/sysconfig/network-scripts/vi ifcfg-ens33BOOTPROTO=staticIPADDR=192.168.2.2NETMASK=255.255.255.0DEVICE="ens33"ONBOOT=yesvi /etc/sysconfig/networkNETWORKING=yesHOSTNAME=slave1GATEWAY=192.168.2.1## Configure DNS Server# vi /etc/resolv.confnameserver 8.8.8.8 # Replace with your nameserver ipnameserver 192.168.2.1  # Replace with your nameserver ip--Host Entryvi /etc/hosts192.168.2.2 master master.master--Restart the network services#systemctl restart network(OR)#service network restart
2.Disk Parition for data/archive/backup:
a)100GB data,50GB archive,40GB backup
For out of range error use “extended” option
[root@localhost ]# fdisk -lDisk /dev/sda: 214.7 GB, 214748364800 bytes, 419430400 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk label type: dosDisk identifier: 0x00022715 Device Boot  Start End  Blocks Id  System/dev/sda1 *2048  616447  307200 83  Linux/dev/sda2  616448 4812799 2098176 82  Linux swap / Solaris/dev/sda3 4812800 419430399 207308800 83  LinuxDisk /dev/sdb: 107.4 GB, 107374182400 bytes, 209715200 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/sdc: 53.7 GB, 53687091200 bytes, 104857600 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/sdd: 42.9 GB, 42949672960 bytes, 83886080 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytes
[root@localhost ]# fdisk /dev/sdbWelcome to fdisk (util-linux 2.23.2).Changes will remain in memory only, until you decide to write them.Be careful before using the write command.Device does not contain a recognized partition tableBuilding a new DOS disklabel with disk identifier 0x4f696ae8.Command (m for help): nPartition type: p primary (0 primary, 0 extended, 4 free) e extendedSelect (default p): pPartition number (1-4, default 1): 1First sector (2048-209715199, default 2048): Using default value 2048Last sector, +sectors or +size{K,M,G} (2048-209715199, default 209715199): Using default value 209715199Partition 1 of type Linux and of size 100 GiB is setCommand (m for help): wThe partition table has been altered!Calling ioctl() to re-read partition table.Syncing disks.
[root@localhost ]# fdisk -lDisk /dev/sda: 214.7 GB, 214748364800 bytes, 419430400 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk label type: dosDisk identifier: 0x00022715 Device Boot  Start End  Blocks Id  System/dev/sda1 *2048  616447  307200 83  Linux/dev/sda2  616448 4812799 2098176 82  Linux swap / Solaris/dev/sda3 4812800 419430399 207308800 83  LinuxDisk /dev/sdb: 107.4 GB, 107374182400 bytes, 209715200 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk label type: dosDisk identifier: 0x4f696ae8 Device Boot  Start End  Blocks Id  System/dev/sdb12048 209715199 104856576 83  LinuxDisk /dev/sdc: 53.7 GB, 53687091200 bytes, 104857600 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/sdd: 42.9 GB, 42949672960 bytes, 83886080 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytes
[root@localhost ]# fdisk -l /dev/sdb1Disk /dev/sdb1: 107.4 GB, 107373133824 bytes, 209713152 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytes[root@localhost ]# fdisk  /dev/sdbcfdisk: cannot open /dev/sdbc: No such file or directory
[root@localhost ]# fdisk  /dev/sdcWelcome to fdisk (util-linux 2.23.2).Changes will remain in memory only, until you decide to write them.Be careful before using the write command.Device does not contain a recognized partition tableBuilding a new DOS disklabel with disk identifier 0x4efbaaa0.Command (m for help): nPartition type: p primary (0 primary, 0 extended, 4 free) e extendedSelect (default p): pPartition number (1-4, default 1): 1First sector (2048-104857599, default 2048): Using default value 2048Last sector, +sectors or +size{K,M,G} (2048-104857599, default 104857599): Using default value 104857599Partition 1 of type Linux and of size 50 GiB is setCommand (m for help): w The partition table has been altered!Calling ioctl() to re-read partition table.Syncing disks.
[root@localhost ]# fdisk  /dev/sddWelcome to fdisk (util-linux 2.23.2).Changes will remain in memory only, until you decide to write them.Be careful before using the write command.Device does not contain a recognized partition tableBuilding a new DOS disklabel with disk identifier 0xaf00340d.Command (m for help): nPartition type: p primary (0 primary, 0 extended, 4 free) e extendedSelect (default p): pPartition number (1-4, default 1): 1First sector (2048-83886079, default 2048): Using default value 2048Last sector, +sectors or +size{K,M,G} (2048-83886079, default 83886079): Using default value 83886079Partition 1 of type Linux and of size 40 GiB is setCommand (m for help): wThe partition table has been altered!Calling ioctl() to re-read partition table.Syncing disks.
.:. restart the server using init 6,init 0 for shutdown
B)add the mount point:
As root user:
1. create a mount point for the data partition:
sudo mkdir  /mnt/DATA
2.This command will format the partition with ext4 FS
mkfs.ext4 /dev/sdc1
3.Mount the partition:
sudo mount /dev/sdb1 /mnt/DATA
sudo mount /dev/sdc1 /mnt/ARCHIVE
sudo mount /dev/sdd1 /mnt/BACKUP
(OR)
mount -t auto /dev/sdc1 /mnt/DATA4.Take ownership of the mount point:
sudo chown -R postgres: /mnt/DATA
sudo chown -R postgres: /mnt/ARCHIVE
sudo chown -R postgres: /mnt/BACKUP
5.Find out the UUID# for your data partition:
[root@localhost ]# sudo blkid/dev/sda1: UUID="15fe408e-72ef-47fe-b3f0-e33f032c1d9f" TYPE="xfs" /dev/sda2: UUID="03a8e0e8-ae89-4a1f-bafc-c03826de7ea5" TYPE="swap" /dev/sda3: UUID="f45ae60c-162f-4da2-aa33-f76723e0c5fe" TYPE="xfs" /dev/sdb1: UUID="46c3be28-2646-495e-9d1b-5f9be9d1e154" TYPE="ext4" /dev/sdc1: UUID="c5abf63e-a9ad-410c-a685-4407d9a12b93" TYPE="ext4" /dev/sdd1: UUID="961e84b2-dbe2-4f2c-ade7-72c2b2b5289d" TYPE="ext4" /dev/sr0: UUID="2016-08-17-06-07-50-00" LABEL="RHEL-7.3 Server.x86_64" TYPE="iso9660" PTTYPE="dos"
6.Open your fstab file and make an entry to auto-mount the data partition on boot:
                gksu gedit /etc/fstab (OR) vi /etc/fstab
(Note: you may need to substitute a different text editor if gedit not installed to your version of Mint.)
In gedit, add either of the two examples below (substitute your UUID# for the ones listed here):
A.For an Ext4 formatted partition, add these two lines to end of fstab file:
# Mount DATA partition under /DATAUUID=46c3be28-2646-495e-9d1b-5f9be9d1e154 /mnt//DATA ext4defaults0 2UUID=c5abf63e-a9ad-410c-a685-4407d9a12b93 /mnt//ARCHIVEext4defaults0 2UUID=961e84b2-dbe2-4f2c-ade7-72c2b2b5289d /mnt//BACKUP ext4defaults0 2
B.For an NTFS formatted partition, add these two lines to end of fstab file:
# Mount DATA partition under /DATAUUID=747D4C9C1EFAD1F2 /mnt/DATA ntfs-3g defaults,windows_names,locale=en_US.utf8 0 0
Save the changes to fstab and close the text editor or vim editor

0 comments:

Post a Comment

 
Top