October 2025
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

Categories

October 2025
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

maximum-number-of-file-descriptors-rhel-centos

cat /proc/sys/fs/file-max
589420
The output tells us it is set to 589420.
The vendor asked for this to be increased to 1639200. We can add change the value immediately by executing:
# sysctl -w fs.file-max=1639200
To make this a permanent setting applied everytime the system reboots an edit of /etc/sysctl.conf file is required. Add:
fs.file-max = 1639200
Save the changes to the file and execute sysctl -p, this will put the changes into effect.
# sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
fs.file-max = 1639200
Thats all there is to it!

Install vfabric-web-server & TcServer

mkdir tcserver
cd tcserver/
wget -q -O – http://repo.vmware.com/pub/rhel6/vfabric/5.2/vfabric-5.2-suite-installer | sh

yum search vfabric

[root@cluster1 vfabric-web-server]# yum search vfabric
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: centos.ipserverone.com
* extras: centos.ipserverone.com
* updates: centos.ipserverone.com
========================================================= N/S Matched: vfabric =========================================================
vfabric-5.2-repo.noarch : vFabric 5.2 repository configuration
vfabric-administration-server.noarch : VMware vFabric Administration Server
vfabric-agent.x86_64 : VMware vFabric Agent
vfabric-gemfire.noarch : VMware vFabric GemFire
vfabric-hyperic-agent.noarch : VMware vFabric Hyperic Agent
vfabric-hyperic-server.x86_64 : VMware vFabric Hyperic Server
vfabric-insight-agent.noarch : com.springsource.insight.dist.vfabric:agent-rpm
vfabric-insight-dashboard.noarch : com.springsource.insight.dist.vfabric:dashboard-rpm
vfabric-sqlfire.noarch : VMware vFabric SQLFire
vfabric-tc-server-standard.noarch : VMware vFabric tc Server Standard
vfabric-web-server.x86_64 : VMware vFabric Web Server
vfabric-web-server-debuginfo.x86_64 : VMware vFabric Web Server Debugging Symbols
vfabric-web-server-devel.x86_64 : VMware vFabric Web Server Libraries and Headers
vfabric-rabbitmq-java-client-bin.noarch : The RabbitMQ Java Client Library
vfabric-rabbitmq-server.x86_64 : The RabbitMQ server

Name and summary matches only, use “search all” for everything.

yum install vfabric-tc-server-standard.noarch   vfabric-web-server.x86_64  vfabric-web-server-debuginfo.x86_64 vfabric-web-server-devel.x86_64

cd /opt/vmware/

[root@cluster1 vmware]# ls
vfabric-tc-server-standard  vfabric-web-server
[root@cluster1 vmware]# ls -la
total 16
drwxr-xr-x. 4 root root    4096 Jun 23 15:59 .
drwxr-xr-x. 4 root root    4096 Jun 23 15:59 ..
drwxr-xr-x. 8 root vfabric 4096 Jun 23 19:44 vfabric-tc-server-standard
drwxr-xr-x. 4 root root    4096 Jun 23 15:59 vfabric-web-server
Lets create a tcserver instance

cd vfabric-tc-server-standard/
./tcruntime-instance.sh create -i /usr/tcserver/ –version 7.0.50.C.RELEASE –java-home /usr/java/jdk1.7.0_17/ –interactive  app1
./tcruntime-instance.sh create -i /usr/tcserver/ –version 7.0.50.C.RELEASE –java-home /usr/java/jdk1.7.0_17/ –interactive  app2

Lets create a webserver instance
mkdir /usr/webserver

[root@cluster1 vfabric-web-server]# ./newserver  –rootdir=/opt/vmware/vfabric-web-server –server=rmohan.com –serverdir=/usr/webserver/rmohan –mpm=worker    –httpdver=2.2.23.2-64
newserver.pl script – deploy a new httpd server instance
Copyright (c) 2012 VMware, Inc.  All rights reserved.
Enable SSL and create a default key [y/n]? y
Server hostname (e.g. www.example.com) [rmohan.com]?
Administrator email [webmaster@rmohan.com]?
Port for http:// traffic        [80]?
Port for https:// traffic       [443]?
Created vfhttpd system group

Created vfhttpd system user account
Creating new server instance /usr/webserver/rmohan
from the /opt/vmware/vfabric-web-server/httpd-2.2.23.2-64/_instance
template instance tree

Size of SSL RSA key, in bits [2048]?
Generating RSA private key, 2048 bit long modulus
…………………………………………………………………………………………………………+++
………………………….+++
e is 65537 (0x10001)

Created /usr/webserver/rmohan/ssl/rmohan.com.key

Choose a passphrase to encrypt the .pem backup copy of this key
writing RSA key
Enter PEM pass phrase:
Verifying – Enter PEM pass phrase:

Fill in information for this certificate.
(The Common Name (CN) below MUST match ServerName!):

You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ‘.’, the field will be left blank.
—–
Country Name (2 letter code) [AU]:SG
State or Province Name (full name) [Some-State]:SG
Locality Name (eg, city) []:SG
Organization Name (eg, company) [Internet Widgits Pty Ltd]:rmohan.com
Organizational Unit Name (eg, section) []:IT
Common (Server) Name (eg, www.example.com) []:rmohan.com
Email Address []:postmaster@rmohan.com

Please enter the following ‘extra’ attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
Signature ok
subject=/C=SG/ST=SG/L=SG/O=rmohan.com/OU=IT/CN=rmohan.com/emailAddress=postmaster@rmohan.com
Getting Private key

SSL files generated as /usr/webserver/rmohan/ssl/rmohan.com.*
.key – unencryped private key (perm 0600 for security).
.pem – des3 encrypted private key – back up this file!
.csr – certificate signing request – submit this to the CA.
.crt – self-signed certificate, replace with cert signed by the CA.
Be certain to record the passphrase to decrypt the .pem file.
Never transmit the .key file or cause it to be readable by others!

New server instance created in
/usr/webserver/rmohan

Modify /usr/webserver/rmohan/conf/httpd.conf
and /usr/webserver/rmohan/bin/httpdctl
to make additional adjustments.

[root@cluster1 vfabric-web-server]#

 

 

Image 1

LOG using Shell script

#!/bin/sh
LOGFILE=/tmp/apache.log
SCRIPT_DIR=~/bin

logmsg () {
echo $(date): $1 >> $LOGFILE
}

while read instance
do
if [ -x  “${SCRIPT_DIR}/$instance” ] ; then
logmsg “Recycle $instance…”
“${SCRIPT_DIR}/$instance” start >> $LOGFILE 2>&1
else
logmsg “Cannot find recycle script for $instance – not starting”
fi
done < “${SCRIPT_DIR}/active-servers”
logmsg “Start script execution complete”

websphere restart script

#!/bin/ksh

BASENAME=`basename $0`

WAZZZ_HOME=/usr/WebSphere/AppServer
JVVVM_BIN_DIR=$WAZZZ_HOME/profiles/node01/bin

die_usage()
{
echo “usage: $BASENAME: <jvm name> <timeout> <hard retries>”
exit $1
}

[[ $# -eq 3 ]] || die_usage 111

JVVVM_NAME=$1
TIMEOUT=$2
HARD_RETRIES=$3

JVVVM_LOG_DIR=$WAZZZ_HOME/profiles/node01/logs/$JVVVM_NAME
JVVVM_PID=

$JVVVM_BIN_DIR/serverStatus.sh -all | grep ” $JVVVM_NAME” | grep -v grep | grep -v $BASENAME > /dev/null 2>&1

if [[ $? -ne 0 ]]
then
echo “usage: $BASENAME: $JVVVM_NAME is not a recognized WAS 6 jvm.”
exit 111
fi

if [[ -e $JVVVM_LOG_DIR/${JVVVM_NAME}.pid ]]
then
# First lets verify that this PID is actually running
PS_PID=$(ps auxwww | grep ” $JVVVM_NAME” | grep -v grep | grep -v $BASENAME | awk -F” ” ‘{print $2}’ | head -1)

# Lets get the PID from the JVVVM’s pid file
FILE_PID=$(cat $JVVVM_LOG_DIR/${JVVVM_NAME}.pid)

if [[ $PS_PID -eq $FILE_PID ]]
then
JVVVM_PID=$FILE_PID
else
JVVVM_PID=$PS_PID
fi
fi

echo “INFO: $BASENAME: Stopping the $JVVVM_NAME JVM with process id: $JVVVM_PID”
# At this point the JVVVM should be running, lets kill it
# This is a timed stop.  It will run for the specified
# Timeout value before killing itself in disgust

echo “INFO: $BASENAME: Attempting graceful stop of $JVVVM_NAME…”
$JVVVM_BIN_DIR/stopServer.sh $JVVVM_NAME > /dev/null 2>&1 & {
sleep ${TIMEOUT} > /dev/null 2>&1
eval ‘kill -9 $! > /dev/null 2>&1’
}

#
# Do another quick check to see it is still running
#
ps auxwww| grep ” $JVVVM_NAME” | grep -v grep | grep -v $BASENAME > /dev/null 2>&1
IS_RUNNING=$?

if [[ $IS_RUNNING -eq 0 ]]
then
echo “WARN: $BASENAME: Graceful stop failed.  Entering hard kill loop…”
COUNT=1
while ((COUNT < HARD_RETRIES))
do
PIDID=$(ps auxwww | grep ” $JVVVM_NAME” | grep -v grep | grep -v $BASENAME | awk -F” ” ‘{print $2}’ | head -1)
echo “INFO: $BASENAME: Trying to hard stop the JVM process: ${PIDID} Count: ${COUNT}…”
kill -9 ${PIDID}
((COUNT = COUNT + 1))
sleep 7
done
fi

echo “INFO: $BASENAME: $JVVVM_NAME has been stopped.”

exit 0

exit status code

How to check the exit status code

When a command finishes execution, it returns an exit code. The exit code is not displayed on the screen by default. To examine the exit code, you need to examine a special variable, “$?

Say, you are searching for a string in a text file.

$ grep x1y2z3 somefile.txt
$

The standard output of the command returns null, which is a pretty good indication that the string cannot be found in the file.

But what if you embed the grep command in a script? How can you tell if the string is found or not?

Checking the exit code will tell you. Let’s first try it out interactively.

$ grep x1y2z3 somefile.txt
$ echo $?
1

Note that in bash, the exit status is 0 if the command succeeded, and 1 if failed. For grep, 0 means that the string was found, and 1 (or higher), otherwise.

To check the exit status in a script, you may use the following pattern:

somecommand  argument1 argument2
RETVAL=$?
[ $RETVAL -eq 0 ] && echo Success
[ $RETVAL -ne 0 ] && echo Failure

check if folder exists

Bash Script check if folder exists

This piece of snippet code below will check if a folder exists.

Linux OS that has NTFS driver installed, can easily to plug in and plug out NTFS formatted external drives.

Or look for ntfs-3g driver if NTFS is not supported.

And can easily be used by both Windows OS and Linux OS.

This piece of snippet code below will check if a folder exists and execute a command if a folder is found.

In Linux world, depends on the distro you are using.

If you insert an NTFS formatted external drive you need to mount the drive.

Once the external drive is inserted type: df -h

Then you will have this output or it might be different in your distro.

/dev/sdb1   1.9T

Then you can proceed to mount the drive like:

mount -t ntfs /dev/sdb1 /media/Week1  (Week1 is the folder name, can be change to any name)

Of course there are other methods, if the command above will not work.

Type “man mount” (don’t include quotes when typing on the terminal) if you want to dig further about mount command.

For example if you have four drives for Week1 to Week4 rotational backup (monthly backup one drive for each week).

For readability and clarity purposes, its better to have one folder specific for each week.

So in /media or whichever folder you mount the external drives. There will be Week1, Week2, Week3 or Week4 folders.

Of course backup can be done manually, but it will be awesome and if it could be done automatically.

Bash script and crontab will come to the rescue.

For Bash script to check which folder to use, this piece of snippet code below.

If there are four folders on /media and each external drive is mounted to an specific folder.

Once the drive is inserted, Linux OS will automatically activate the mount drive and the mounted folder.

Here’s the piece of snippet code below:

======================

#!/bin/sh

# Path to the mounted folders
W1=”/media/Week1″
W2=”/media/Week2″
W3=”/media/Week3″
W4=”/media/Week4″

# Check if folder exists
if [ -d “$W1” ]
then
 PathBackup=”$W1″

elif [ -d “$W2” ]
then
PathBackup=”$W2″

elif [ -d “$W3” ]
then
PathBackup=”$W3″

elif [ -d “$W4” ]
then
PathBackup=”$W4″

fi

# you can do a simple cp or copy command
# or any command that you want to run
# command below uses rysnc and pipe to gzip and date as filename
# the date used is the date that the script runs
rsync  -arv /home/backup/store/ | gzip > ‘$PathBackup’ `date ‘+%m-%d-%Y’`.zip

======================

And you can configure crontab to run the script at a specified date and time.

Type crontab -e and configure the settings as desired.

determine my user account’s OU in a Windows domain?

How can I determine my user account’s OU in a Windows domain?

set objSysInfo = CreateObject(“ADSystemInfo”)

set objUser = GetObject(“LDAP://” & objSysInfo.UserName)

wscript.echo “DN: ” & objUser.distinguishedName

gpresult /r

gpresult -v|more

Centos 7 kickstart.cfg for cobbler

lang en_GB.UTF-8
keyboard us
timezone Europe/Brussels –isUtc
auth –useshadow –enablemd5
selinux –enforcing
firewall –enabled –service=mdns
xconfig –startxonboot
part / –size 8192 –fstype ext4
services –enabled=NetworkManager –disabled=network,sshd
# Root password
rootpw –iscrypted $6$K2nKf02kVKG68960$OywvoaViphSITuro/liKvCj7Pm/CH/xqzz/lsoXyaKSR1lYf0vHAqSUc483a9MCCBkIwfr/hNMfqwxqVO0OEg1
repo –name=base –baseurl=http://ftp.redhat.com/redhat/rhel/rc/7/Client/x86_64/os/
%packages
@base
@core
@fonts
@gnome-desktop
@input-methods
@x11
#Live install tools
anaconda
system-config-keyboard
grub2
firefox
#Packages to remove for space constraints
-abrt-addon-pstoreoops
-abrt-addon-ccpp
-abrt-libs
-abrt
-abrt-addon-python
-abrt-tui
-abrt-gui-libs
-abrt-gui
-abrt-python
-abrt-addon-vmcore
-abrt-dbus
-abrt-console-notification
-gnome-abrt
-abrt-addon-xorg
-abrt-addon-kerneloops
-abrt-cli
-abrt-desktop
-empathy
-libpurple
-telepathy-haze
-libpinyin-data
-ibus-libpinyin
-libpinyin
-gnome-boxes
-libvirt-client
-libvirt-daemon
-libvirt-daemon-driver-interface
-libvirt-daemon-driver-network
-libvirt-daemon-driver-nodedev
-libvirt-daemon-driver-nwfilter
-libvirt-daemon-driver-qemu
-libvirt-daemon-driver-secret
-libvirt-daemon-driver-storage
-libvirt-daemon-kvm
-libvirt-glib
-libvirt-gobject
-gnome-getting-started-docs
-gnome-initial-setup
-cjkuni-uming-fonts
-wqy-zenhei-fonts
-gnome-weather
-qemu-kvm
-subscription-manager
-subscription-manager-firstboot
-subscription-manager-gui
-orca
%end
%post
# FIXME: it’d be better to get this installed from a package
cat > /etc/rc.d/init.d/livesys << EOF
#!/bin/bash
#
# live: Init script for live image
#
# chkconfig: 345 00 99
# description: Init script for live image.
### BEGIN INIT INFO
# X-Start-Before: display-manager
### END INIT INFO
. /etc/init.d/functions
if ! strstr “\`cat /proc/cmdline\`” rd.live.image || [ “\$1” != “start” ]; then
    exit 0
fi
if [ -e /.liveimg-configured ] ; then
    configdone=1
fi
exists() {
    which \$1 >/dev/null 2>&1 || return
    \$*
}
# Make sure we don’t mangle the hardware clock on shutdown
ln -sf /dev/null /etc/systemd/system/hwclock-save.service
livedir=”LiveOS”
for arg in \`cat /proc/cmdline\` ; do
  if [ “\${arg##rd.live.dir=}” != “\${arg}” ]; then
    livedir=\${arg##rd.live.dir=}
    return
  fi
  if [ “\${arg##live_dir=}” != “\${arg}” ]; then
    livedir=\${arg##live_dir=}
    return
  fi
done
# enable swaps unless requested otherwise
swaps=\`blkid -t TYPE=swap -o device\`
if ! strstr “\`cat /proc/cmdline\`” noswap && [ -n “\$swaps” ] ; then
  for s in \$swaps ; do
    action “Enabling swap partition \$s” swapon \$s
  done
fi
if ! strstr “\`cat /proc/cmdline\`” noswap && [ -f /run/initramfs/live/\${livedir}/swap.img ] ; then
  action “Enabling swap file” swapon /run/initramfs/live/\${livedir}/swap.img
fi
mountPersistentHome() {
  # support label/uuid
  if [ “\${homedev##LABEL=}” != “\${homedev}” -o “\${homedev##UUID=}” != “\${homedev}” ]; then
    homedev=\`/sbin/blkid -o device -t “\$homedev”\`
  fi
  # if we’re given a file rather than a blockdev, loopback it
  if [ “\${homedev##mtd}” != “\${homedev}” ]; then
    # mtd devs don’t have a block device but get magic-mounted with -t jffs2
    mountopts=”-t jffs2″
  elif [ ! -b “\$homedev” ]; then
    loopdev=\`losetup -f\`
    if [ “\${homedev##/run/initramfs/live}” != “\${homedev}” ]; then
      action “Remounting live store r/w” mount -o remount,rw /run/initramfs/live
    fi
    losetup \$loopdev \$homedev
    homedev=\$loopdev
  fi
  # if it’s encrypted, we need to unlock it
  if [ “\$(/sbin/blkid -s TYPE -o value \$homedev 2>/dev/null)” = “crypto_LUKS” ]; then
    echo
    echo “Setting up encrypted /home device”
    plymouth ask-for-password –command=”cryptsetup luksOpen \$homedev EncHome”
    homedev=/dev/mapper/EncHome
  fi
  # and finally do the mount
  mount \$mountopts \$homedev /home
  # if we have /home under what’s passed for persistent home, then
  # we should make that the real /home.  useful for mtd device on olpc
  if [ -d /home/home ]; then mount –bind /home/home /home ; fi
  [ -x /sbin/restorecon ] && /sbin/restorecon /home
  if [ -d /home/liveuser ]; then USERADDARGS=”-M” ; fi
}
findPersistentHome() {
  for arg in \`cat /proc/cmdline\` ; do
    if [ “\${arg##persistenthome=}” != “\${arg}” ]; then
      homedev=\${arg##persistenthome=}
      return
    fi
  done
}
if strstr “\`cat /proc/cmdline\`” persistenthome= ; then
  findPersistentHome
elif [ -e /run/initramfs/live/\${livedir}/home.img ]; then
  homedev=/run/initramfs/live/\${livedir}/home.img
fi
# if we have a persistent /home, then we want to go ahead and mount it
if ! strstr “\`cat /proc/cmdline\`” nopersistenthome && [ -n “\$homedev” ] ; then
  action “Mounting persistent /home” mountPersistentHome
fi
# make it so that we don’t do writing to the overlay for things which
# are just tmpdirs/caches
mount -t tmpfs -o mode=0755 varcacheyum /var/cache/yum
mount -t tmpfs vartmp /var/tmp
[ -x /sbin/restorecon ] && /sbin/restorecon /var/cache/yum /var/tmp >/dev/null 2>&1
if [ -n “\$configdone” ]; then
  exit 0
fi
# add fedora user with no passwd
action “Adding live user” useradd \$USERADDARGS -c “Live System User” liveuser
passwd -d liveuser > /dev/null
usermod -aG wheel liveuser > /dev/null
# Remove root password lock
passwd -d root > /dev/null
# turn off firstboot for livecd boots
systemctl –no-reload disable firstboot-text.service 2> /dev/null || :
systemctl –no-reload disable firstboot-graphical.service 2> /dev/null || :
systemctl stop firstboot-text.service 2> /dev/null || :
systemctl stop firstboot-graphical.service 2> /dev/null || :
# don’t use prelink on a running live image
sed -i ‘s/PRELINKING=yes/PRELINKING=no/’ /etc/sysconfig/prelink &>/dev/null || :
# turn off mdmonitor by default
systemctl –no-reload disable mdmonitor.service 2> /dev/null || :
systemctl –no-reload disable mdmonitor-takeover.service 2> /dev/null || :
systemctl stop mdmonitor.service 2> /dev/null || :
systemctl stop mdmonitor-takeover.service 2> /dev/null || :
# don’t enable the gnome-settings-daemon packagekit plugin
gsettings set org.gnome.settings-daemon.plugins.updates active ‘false’ || :
# don’t start cron/at as they tend to spawn things which are
# disk intensive that are painful on a live image
systemctl –no-reload disable crond.service 2> /dev/null || :
systemctl –no-reload disable atd.service 2> /dev/null || :
systemctl stop crond.service 2> /dev/null || :
systemctl stop atd.service 2> /dev/null || :
# Mark things as configured
touch /.liveimg-configured
# add static hostname to work around xauth bug
# https://bugzilla.redhat.com/show_bug.cgi?id=679486
echo “localhost” > /etc/hostname
EOF
# bah, hal starts way too late
cat > /etc/rc.d/init.d/livesys-late << EOF
#!/bin/bash
#
# live: Late init script for live image
#
# chkconfig: 345 99 01
# description: Late init script for live image.
. /etc/init.d/functions
if ! strstr “\`cat /proc/cmdline\`” rd.live.image || [ “\$1” != “start” ] || [ -e /.liveimg-late-configured ] ; then
    exit 0
fi
exists() {
    which \$1 >/dev/null 2>&1 || return
    \$*
}
touch /.liveimg-late-configured
# read some variables out of /proc/cmdline
for o in \`cat /proc/cmdline\` ; do
    case \$o in
    ks=*)
        ks=”–kickstart=\${o#ks=}”
        ;;
    xdriver=*)
        xdriver=”\${o#xdriver=}”
        ;;
    esac
done
# if liveinst or textinst is given, start anaconda
if strstr “\`cat /proc/cmdline\`” liveinst ; then
   plymouth –quit
   /usr/sbin/liveinst \$ks
fi
if strstr “\`cat /proc/cmdline\`” textinst ; then
   plymouth –quit
   /usr/sbin/liveinst –text \$ks
fi
# configure X, allowing user to override xdriver
if [ -n “\$xdriver” ]; then
   cat > /etc/X11/xorg.conf.d/00-xdriver.conf <<FOE
Section “Device”
   Identifier    “Videocard0”
   Driver    “\$xdriver”
EndSection
FOE
fi
EOF
chmod 755 /etc/rc.d/init.d/livesys
/sbin/restorecon /etc/rc.d/init.d/livesys
/sbin/chkconfig –add livesys
chmod 755 /etc/rc.d/init.d/livesys-late
/sbin/restorecon /etc/rc.d/init.d/livesys-late
/sbin/chkconfig –add livesys-late
# enable tmpfs for /tmp
systemctl enable tmp.mount
# work around for poor key import UI in PackageKit
rm -f /var/lib/rpm/__db*
releasever=$(rpm -q –qf ‘%{version}\n’ –whatprovides system-release)
basearch=$(uname -i)
rpm –import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
echo “Packages within this LiveCD”
rpm -qa
# Note that running rpm recreates the rpm db files which aren’t needed or wanted
rm -f /var/lib/rpm/__db*
# go ahead and pre-make the man -k cache (#455968)
/usr/bin/mandb
# save a little bit of space at least…
rm -f /boot/initramfs*
# make sure there aren’t core files lying around
rm -f /core*
# convince readahead not to collect
# FIXME: for systemd
cat >> /etc/rc.d/init.d/livesys << EOF
# disable updates plugin
cat >> /usr/share/glib-2.0/schemas/org.gnome.settings-daemon.plugins.updates.gschema.override << FOE
[org.gnome.settings-daemon.plugins.updates]
active=false
FOE
# Show the system-config-keyboard tool on the desktop
mkdir /home/liveuser/Desktop -p >/dev/null
cat /usr/share/applications/system-config-keyboard.desktop | sed ‘/NotShowIn/d’ > /home/liveuser/Desktop/system-config-keyboard.desktop 
cat /usr/share/applications/liveinst.desktop | sed ‘/NoDisplay/d’ > /home/liveuser/Desktop/liveinst.desktop 
chmod +x /home/liveuser/Desktop/*.desktop
chown -R liveuser:liveuser /home/liveuser
# Liveuser face
if [ -e /usr/share/icons/hicolor/96×96/apps/fedora-logo-icon.png ] ; then
    cp /usr/share/icons/hicolor/96×96/apps/fedora-logo-icon.png /home/liveuser/.face
    chown liveuser:liveuser /home/liveuser/.face
fi
# make the installer show up
if [ -f /usr/share/applications/liveinst.desktop ]; then
  # Show harddisk install in shell dash
  sed -i -e ‘s/NoDisplay=true/NoDisplay=false/’ /usr/share/applications/liveinst.desktop 
  # need to move it to anaconda.desktop to make shell happy
  #cp /usr/share/applications/liveinst.desktop /usr/share/applications/anaconda.desktop
fi
  cat >> /usr/share/glib-2.0/schemas/org.gnome.shell.gschema.override << FOE
[org.gnome.shell]
favorite-apps=[‘liveinst.desktop’,’firefox.desktop’, ‘evolution.desktop’, ’empathy.desktop’, ‘rhythmbox.desktop’, ‘shotwell.desktop’, ‘libreoffice-writer.desktop’, ‘nautilus.desktop’, ‘gnome-documents.desktop’, ‘anaconda.desktop’]
FOE
# set up auto-login
cat > /etc/gdm/custom.conf << FOE
[daemon]
AutomaticLoginEnable=True
AutomaticLogin=liveuser
FOE
# Turn off PackageKit-command-not-found while uninstalled
if [ -f /etc/PackageKit/CommandNotFound.conf ]; then
  sed -i -e ‘s/^SoftwareSourceSearch=true/SoftwareSourceSearch=false/’ /etc/PackageKit/CommandNotFound.conf
fi
# make sure to set the right permissions and selinux contexts
chown -R liveuser:liveuser /home/liveuser/
restorecon -R /home/liveuser/
# Fixing default locale to us
localectl set-keymap us
localectl set-x11-keymap us
EOF
# rebuild schema cache with any overrides we installed
glib-compile-schemas /usr/share/glib-2.0/schemas
%end

mount.nfs: rpc.statd is not running but is required for remote locking

I think i found the answer; even though chkconfig reported that
"rpcbind" was setup to start in run level 3, for some reason it was
not running.

After this was started; I was able to mount the NFS share.

# who -r
         run-level 3  2012-02-16 19:19


# chkconfig --list rpcbind
rpcbind         0:off   1:off   2:on    3:on    4:on    5:on    6:off


# service rpcbind status
rpcbind is stopped


# service rpcbind start
Starting rpcbind:                                          [  OK  ]

Thanks,


On 2/17/12, unix syzadmin <unixsyzadmin gmail com> wrote:
> Hi,
>
> I am getting the following error on RHEL6 for NFS mount. Please suggest.
>
> # more /etc/redhat-release
> Red Hat Enterprise Linux Server release 6.1 (Santiago)
>
> # uname -r
> 2.6.32-131.0.15.el6.x86_64
>
> # mount -t nfs nfs02:/share0217 /mnt
> mount.nfs: rpc.statd is not running but is required for remote locking.
> mount.nfs: Either use '-o nolock' to keep locks local, or start statd.
> mount.nfs: an incorrect mount option was specified
>
> Thanks.
>

 

Reasons ReFS

0216.5.jpg-550x0Resilient File System (ReFS) is a new file system introduced in Windows Server 2012. Initially, it is being targeted for implementation as a file system that is primarily used for file servers. However, starting as the file system for a file server is just the beginning. Like its predecessor, NTFS, ReFS will begin as a file server system, then become a mainstream file system. Before long, we will all be using ReFS on our boot partitions.

Resilient File System will likely replace NTFS completely within the next versions of Windows, and here are some reasons why you are going to really love the new file system.

Comparing ReFS and NTFS Features

Although ReFS is a different file system, there are similar features between ReFS and NTFS. The easiest way to compare those is to look at the feature list side by side. Consider the following feature sets:

NTFS Features

ReFS Features

Supports Case-sensitive filenames

Preserves Case of filenames

Supports Unicode in filenames

Preserves & Enforces ACL’s

Supports file-based Compression

Supports Disk Quotas

Supports Sparse files

Supports Reparse Points

Supports Object Identifiers

Supports Encrypted File System

Supports Named Streams

Supports Transactions

Supports Hard Links

Supports Extended Attributes

Supports Open By FileID

Supports USN Journal

Supports Case-sensitive filenames

Preserves Case of filenames

Supports Unicode in filenames

Preserves & Enforces ACL’s

Supports Sparse files

Supports Reparse Points

Supports Open By FileID

Supports USN Journal

 

 

Functionality

NTFS

ReFS

Named Streams

Yes

No

OBJECT IDs

Yes

No

File System Compression

Yes

No

File System Encryption

Yes

No

TRANSACTIONS

Yes

No

Sparse Files

Yes

No

Hard Links

Yes

No

Extended Attributes

Yes

No

Quota

Yes

No

Max size of a single file

(264-1) bytes

(264-1) bytes

Max size of a single volume

Roughly 256 TB

Roughly 4.7 ZB (zettabytes)

Max number of files in a directory

No actual limitation

2^64

Max number of directories in a volume

No actual limitation

2^64

Max file name length

32K unicode characters

32K unicode characters

Max path length

 32K

32K

Boot to file system

Yes

No

Supported on removable media

Yes

No

Deduplication

Yes

No

WDS

Yes

No

Note also that ReFS only uses a 64KB cluster size, which means a lot of wasted space for disks with lots of small files. Since ReFS uses a Copy on Write mechanism, there’s a greater chance of fragmentation.

Image 1

0216.5.jpg-550x0

Notice that key capabilities missing from ReFS as compared to NTFS are EFS encryption, quotas, and compression. BitLocker may be used for encrypting these volumes while EFS is not an option. Thus, when using ReFS, encryption doesn’t need to be part of the file system. BitLocker satisfies the need for encrypting data on the volume as it encrypts the contents of the entire disk. Quotas may be managed outside the file system rather than through the file system like NTFS. Not supporting Hard Links is a key reason why you wouldn’t use ReFS for a system disk; files in the system32 folder are really hard linked back into the WinSxS folder structure. You might think that ReFS would have data deduplication built-into the file system. The fact that it doesn’t may not prohibit other components or third-party solutions from interfacing with ReFS through the API set provided.

Command Line Directives for ReFS

For those that are script fanatics (you know who you are), I’ve written this section just for you. We all know that the need for scripting language happens all the time. Perhaps you’re just creating re-creatable virtual environments for one reason or another…and now you need to include the creation of some ReFS volumes. Below are some valuable commands including conventional and PowerShell examples.

Formatting a ReFS Volume

While this can be done from the UI quite easily by choosing ReFS as the file system in the drop down from the Format dialog, this is also easily done from the command line. Full format example below:

Command-Line

Format /fs:ReFS J:

PowerShell Equivalent

Format-Volume –DriveLetter J –FileSystem ReFS -Full

In fact, typical command line syntax and optional parameters apply. Therefore, if you want this to be a quick format, just append /q to the above command line. However, you have the option to enable Integrity Streams for the volume. Note the following command:

Command-Line

Format /fs:ReFS /q /i:enable J:

PowerShell Equivalent

Format-Volume –DriveLetter J –FileSystem ReFS –SetIntegrityStreams $true

The preceding command enables Integrity Streams on drive J: and performs a quick format. The /i option offers you the ability to enable|disable this feature for the volume. If you enable this option, all files created on the volume will be configured with integrity. You may turn this off for individual files or folders using the Integrity command. However, know that if a file is non-empty and has data streams created with Integrity Streams, you cannot disable the feature for that file. You cannot change the integrity status for a file once the file contains integrity data streams. You could copy the file to another partition, delete the original, and then copy it back without Integrity Streams.

 

 

Features of Microsoft’s ReFS

The main focus of new features is resilience, for example, automatically correcting data errors. Verifying with checksum before the write commits, and thus avoiding “torn writes”; it works by allocate-on-write, which never updates metadata in-place, but rather writes it to a different area of the disk, rather like “shadow paging”.

  • Making sure that internal structures are pliable to support large file system in the exabyte range.
  • Make it a rule never to take the file system offline. Instead isolate the fault while keeping the rest of the volume available. Windows 8 ReFS
  • Impliment Storage Spaces for ReFS.
  • Supporting very large file systems.  Maximum file size of: =2^64 bytes 
    18,446,744,073,709,600,000 bytes
    18,446,744,073 gigabytes
    18 exabytes.

The graphic to the right shows how ReFS, uses some of the same code as NTFS, namely file system read, write, open, close, and change notification.

But below this NTFS equivelent is a new architected engine that takes care of the MFT (Master File Table).

Who Will Benefit Most From ReFS?
ReFS will be most useful on fileservers especially those with disk intensive applications that require high-performance. Data storage companies who need even larger storage systems that are currently available with NTFS may turn to ReFS.