Showing posts with label NFS. Show all posts
Showing posts with label NFS. Show all posts

Retrieve directory data underneath NFS mounted directory

Jephe Wu - http://linuxtechres.blogspot.com 

Problem:  we need to retrieve data from certain directory before we did NFS mount on the same directory,however, we cannot umount it since it's production environment
Concept:  use mount --bind / to another directory to retrieve data without umounting NFS 
Steps:


1. check the existing files under /u05, for testing purpose, I have copied some archive log files from /u03 to /u05.
root@linuxtechres:/u05# ll
total 420
-rw-r----- 1 root root 229888 Oct 15 10:48 1_21996_817700775.arc
-rw-r----- 1 root root 180736 Oct 15 10:48 1_22005_817700775.arc

2. NFS mount /u05 which is using Netapp NFS storage for controlfile 
root@linuxtechres:/# mount /u05
root@linuxtechres:/# cd /u05
root@linuxtechres:/u05# ll
total 4
drwxr-xr-x 3 oracle dba 4096 Jun 28 09:51 control

3. Now we need to retrieve the original files under /u05 
root@linuxtechres:/u05# mkdir /tmp/recover
root@linuxtechres:/u05# mount --bind / /tmp/recover   # use / since original /u05 content is under / partition

4. check mounted directory 
root@linuxtechres:/u05# cd /tmp/recover/
root@linuxtechres:/tmp/recover# ls
appdata boot home lost+found mnt proc selinux sys u01 u04 var
backup dev lib media net root srv tftpboot u02 u05
bin etc lib64 misc opt sbin stage tmp u03 usr

root@linuxtechres:/tmp/recover# cd u05
root@linuxtechres:/tmp/recover/u05# ll
total 420
-rw-r----- 1 root root 229888 Oct 15 10:48 1_21996_817700775.arc
-rw-r----- 1 root root 180736 Oct 15 10:48 1_22005_817700775.arc

5. compare file md5sum
root@linuxtechres:/tmp/recover/u05# md5sum 1_21996_817700775.arc
f0af8a88658071aab2babab74c614159 1_21996_817700775.arc

root@linuxtechres:/tmp/recover/u05# md5sum /u03/oraarch/JEPHE/1_21996_817700775.arc
f0af8a88658071aab2babab74c614159 /u03/oraarch/JEPHE/1_21996_817700775.arc

6. umount /tmp/recover after recovery
root@linuxtechres:/tmp/recover/u05# mount | grep recover
/ on /tmp/recover type none (rw,bind)
root@linuxtechres:/tmp/recover/u05# cd /
root@linuxtechres:/# umount /tmp/recover
root@linuxtechres:/# mount | grep recover


Note: you may also use debugfs to retrieve data 

NFS client mount options for Oracle and Netapp

Jephe Wu - http://linuxtechres.blogspot.com

Environment: Linux x86_64, Oracle 11g 64bit SI(Single Instance) or RAC,  use Netapp as storage for Oracle binary, datafile, rman backup and expdp
Kernel 2.6, OL 5.8 and OL 6.3

Objective: the recommended NFS mounting options


Steps:

Please refer to Mount Options for Oracle files when used with NFS on NAS devices [ID 359515.1]

ORA-27054: NFS file system where the file is created or resides is not mounted with correct options [ID 781349.1]

and Netapp doc ID:
What are the mount options for databases on NetApp NFS?


Mount options for binary (exact order is important!)
RAC: rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,vers=3,timeo=600, actimeo=0
Netapp RAC: rw,bg,hard,rsize=32768,wsize=32768,vers=3,actimeo=0, nointr, suid, timeo=600, tcp

SI:    rw,bg,hard,rsize=32768,wsize=32768,vers=3,nointr,timeo=600,tcp
Netapp SI: rw,bg,hard,rsize=32768,wsize=32768,vers=3,nointr,timeo=600, tcp


For datafiles:
RAC: rw,bg,hard,nointr,rsize=32768, wsize=32768,tcp,actimeo=0, vers=3,timeo=600
Netapp RAC: rw,bg,hard,rsize=32768,wsize=32768,vers=3, actimeo=0, nointr, suid, timeo=600, tcp

SI:    rw,bg,hard,rsize=32768,wsize=32768,vers=3,nointr,timeo=600,tcp
Netapp SI: rw,bg,hard,rsize=32768,wsize=32768,vers=3,nointr, timeo=600, tcp

Mount options for CRS voting disk and OCR [RAC]
RAC: rw,bg,hard,nointr,rsize=32768, wsize=32768,tcp,noac,vers=3,timeo=600,actimeo=0
Netapp RAC: rw,bg,hard,rsize=32768,wsize=32768,vers=3,actimeo=0, nointr, suid, timeo=600, tcp

Note: 
For RMAN backup sets, image copies, and Data Pump dump files, the "NOAC" mount option should not be specified - that is because RMAN and Data Pump do not check this option and specifying this can adversely affect performance.

Due to Unpublished bug 5856342, it is necessary to use the following init.ora parameter when using NAS with all versions of RAC on Linux (x86 & X86-64 platforms) until 10.2.0.4. This bug is fixed and included in 10.2.0.4 patchset.
filesystemio_options = DIRECTIO

NOTE:  As per Bug 11812928, the 'intr' & 'nointr' are deprecated in UEK kernels, as well as Oracle Linux 6. It is harmless to still include it, you will get a notice..

NFS: ignoring mount option: nointr.



Variable Details: 

OptionDescription
hard Generate a hard mount of the NFS file system. If the connection to the server is lost temporarily, Oracle continues to retry the connection until the NAS device responds. 
bgTry to connect in the background if connection fails. 
proto=tcp(or tcp on Linux)Use the TCP protocol rather than UDP. TCP is more reliable than UDP. 
vers=3(or nfsvers=3 on Linux)Use NFS version 3. Oracle recommends that you use NFS version 3 where available, unless the performance of version 2 is higher. 
suid Allow clients to run executables with SUID enabled. This option is required for Oracle software mount points. 
rsize, wsize The number of bytes used when reading or writing to the NAS device. A value of 8192 is often recommended for NFS version 2 and 32768 is often recommended for NFS version 3. 
nointr (or intr)Do not allow (or allow) keyboard interrupts to kill a process that is hung while waiting for a response on a hard-mounted file system. 
noac
actimeo=0
Disable attribute caching. (a combination of sync and actimeo=0)
disable attribute caching on the client





How to use HP ILO to do NFS diskless installation of RHEL 5.1 remotely

Objective: install RHEL 5.1 OS for one of HP server in datacenter remotely from office with DVD ISO file and NFS method, it won't require you to have any disk from office.


Steps:

  • download RHEL 5.1 DVD ISO file, put it on the one of datacenter NFS server, can be different network segment from the destination server. (In this case, during installation, you might need to set default gateway properly so that the destination sever can talk to this NFS server)
  • configuring NFS server export, in /etc/exports, put this:
/sourcefile/rh51 *(ro)

  • put rhel-5.1-server-i386-dvd.iso to /sourcefile/rh51 folder
  • mount this iso somewhere to copy out boot.iso to your local Windows PC in office which will be used for HP ILO virtual CDROM media image for booting up RHEL installation
  • startup NFS server - service portmap start; service nfs start
  • use IE to access HP ILO address
  • go to virtual media to mount this boot.iso image
  • use virtual power to reset the server
  • press enter to boot up OS installation virtual boot.iso disk
  • untick high performance mouse, and close the virutal media window to make USB mouse to work
  • continue to install until finish
  • that's it, done.