Archive for the ‘Redhat’ Category


Plain and simple of how to extend a volumn group in RHEL

Amusing you already added a Virtual disk and its presented to the server . If not check my this post.

[root@aurhel05 ~]# fdisk /dev/sdb

The number of cylinders for this disk is set to 3916.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/sdb: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System

Command (m for help): n
Command action
e   extended
p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-3916, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-3916, default 3916):
Using default value 3916

Command (m for help): p

Disk /dev/sdb: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        3916    31455238+  83  Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@aurhel05 ~]# fdisk -l

Disk /dev/sda: 32.2 GB, 32259548160 bytes
255 heads, 63 sectors/track, 3922 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         131     1052226   83  Linux
/dev/sda2             132         784     5245222+  83  Linux
/dev/sda3             785        1437     5245222+  83  Linux
/dev/sda4            1438        3918    19928632+   5  Extended
/dev/sda5            1438        1698     2096451   83  Linux
/dev/sda6            1699        1959     2096451   82  Linux swap / Solaris
/dev/sda7            1960        2220     2096451   82  Linux swap / Solaris
/dev/sda8            2221        2481     2096451   83  Linux
/dev/sda9            2482        2612     1052226   83  Linux
/dev/sda10           2613        3918    10490413+  83  Linux

Disk /dev/sdb: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        3916    31455238+  83  Linux

[root@aurhel05 ~]# mkfs.ext3 /dev/sdb1

mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
3932160 inodes, 7863809 blocks
393190 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
240 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 25 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

Extending the Volume VolGroup00-mysqldb by another 30GB :

1. Create a physical volume from a free disk or partition (e.g. /dev/sdb1 as a partition)
# pvcreate /dev/sdb1

2. Extend the volume group
# vgextend VolGroup00 /dev/sdb1

3. Extend the logical volume
# lvextend -L +30G /dev/mapper/VolGroup00-mysqldb

4. Extend an ext2/3/4 filesystem on the logical volume.
# resize2fs /dev/mapper/VolGroup00-mysqldb

 

Advertisements

Squirelmail Inbox error

Posted: February 24, 2016 in Redhat, Uncategorized

Problem:

After signing in , I was getting the following error for one of the inbox ..

ERROR: Could not complete request.
Query: SELECT “INBOX”
Reason Given: Internal error occured. Refer to server log for more information. [2016-02-21 13:25:45]

 

Solution :

  • Was checking the /var/log/maillog and got the following information –>  [Feb 24 16:05:18 griffin imap(appts.XXX): File isn’t in mbox format: /var/mail/appts.XXX]
  • Then open the file with any text editor like vi /var/mail/appts.XXX
    then Delete the garbage lines(one or two) at the beginning and save the file.

    Restart the service and everything shloud be OK now.

Canot Start Sendmail

Posted: March 17, 2015 in Redhat
Tags:

While trying to start sendmail it complains with the following error.

[root@augs-suatacd mail]# /etc/init.d/sendmail restart

Shutting down sm-client: [FAILED]
Shutting down sendmail: [FAILED]
Starting sendmail: 451 4.0.0 /etc/mail/sendmail.cf: line 87: fileclass: cannot open ‘/etc/mail/local-host-names’: World writable directory
451 4.0.0 /etc/mail/sendmail.cf: line 596: fileclass: cannot open ‘/etc/mail/trusted-users’: World writable directory
[FAILED]
Starting sm-client: /etc/mail/submit.cf: line 552: fileclass: cannot open ‘/etc/mail/trusted-users’: World writable directory
[FAILED]

Solution : 

Replacing line Fw/etc/mail/ local-host-names with line Fw-o /etc/mail/local-host-names in sendmail.cf, and Ft/etc/mail/trusted-users with line Ft-o /etc/mail/trusted-users in submit.cf and sendmail.cf.

Then restart Sendmail . Hope it will work.

Ashraf


This content is password protected. To view it please enter your password below:

Understanding the default output of “DIG”

Posted: October 14, 2011 in Redhat
Tags:

The most typical, simplest query is for a single host. By default, however, dig is pretty verbose. You probably don’t need all the information in the default output, but it’s probably worth knowing what it is. Below is an annotated query.

$ dig www.isc.org

That’s the command-line invocation of dig I used.

; <<>> DiG 9.2.3 <<>> www.isc.org
;; global options:  printcmd

The opening section of dig’s output tells us a little about itself (version 9.2.3) and the global options that are set (in this case, printcmd). This part of the output can be quelled by using the +nocmd option, but only if it’s the very first argument on the command line (even preceeding the host you’re querying).

;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 43071
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 3

Here, dig tells us some technical details about the answer received from the DNS server. This section of the output can be toggled using the +[no]comments option—but beware that disabling the comments also turns off many section headers.

;; QUESTION SECTION:
;www.isc.org.                   IN      A

In the question section, dig reminds us of our query. The default query is for an Internet address (A). You can turn this output on or off using the +[no]question option.

;; ANSWER SECTION:
www.isc.org.            600     IN      A       204.152.184.88

Finally, we get our answer: the address of http://www.isc.org is 204.152.184.88. I don’t know why you’d ever want to turn off the answer, but you can toggle this section of the output using the +[no]answer option.

;; AUTHORITY SECTION:
isc.org.                2351    IN      NS      ns-int.isc.org.
isc.org.                2351    IN      NS      ns1.gnac.com.
isc.org.                2351    IN      NS      ns-ext.isc.org.

The authority section tells us what DNS servers can provide an authoritative answer to our query. In this example, isc.org has three name servers. You can toggle this section of the output using the +[no]authority option.

;; ADDITIONAL SECTION:
ns1.gnac.com.           171551  IN      A       209.182.216.75
ns-int.isc.org.         2351    IN      A       204.152.184.65
ns-int.isc.org.         2351    IN      AAAA    2001:4f8:0:2::15

The additional section typically includes the IP addresses of the DNS servers listed in the authority section. This section of the output can be toggled with the +[no]additional option.

;; Query time: 2046 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Fri Aug 27 08:22:26 2004
;; MSG SIZE  rcvd: 173

The final section of the default output contains statistics about the query; it can be toggled with the +[no]stats option.

 

Ref : http://www.madboa.com/geek/dig/


Was trying to kickstart a RHEL5 this morning from CDROM in a VM but it was comming up with the following error

“Could not find kernel image : linux ”

Solution :

with some time spent  I came accross with the following solution for temporary . Hope this helps.

vmlinuz initrd=initrd.img ks=cdrom:/rhel5-liab-server-x86_64.cfg cdrom


Nice Script to display Date and time .
Ref : http://bashscript.blogspot.com/

#!/bin/bash
# SCRIPT: digclock.sh
# USAGE:  ./digiclock &
# PURPOSE: Displays time and date in the top right corner of the
#          screen using tput command.
# To stop this digclock use command "kill pid"
################################################################

####################### VARIABLE DECLARATION ###################

 # To place the clock on the appropriate column, subtract the
 # length of $Time and $Date, which is 22, from the total number
 # of columns

  Columns=$(tput cols)
  Startpoint=$(($Columns-22))

 # If you're in an X Window System terminal,you can resize the
 # window, and the clock will adjust its position because it is
 # displayed at the last column minus 22 characters.

  Color1=`tput setab 2`        # Green background color for time
  Color2=`tput setab 6`        # Cyan  background color for date
  Normal=`tput sgr0`           # back to normal screen colors

####################### MAIN PROGRAM ###########################

# The script is executed inside a while without conditions

while :
do
  Time=`date +%r`
  Date=`date +"%d-%m-%Y"`
  tput sc                   #Save the cursor position&attributes
  tput cup 0 $Startpoint

 # You can also use bellow one liner
 # tput cup 0 $((`tput cols`-22))
 # But it is not efficient to calculate cursor position for each
 # iteration. That's why I placed variable assignment before
 # beginning of the loop.

 # print time and date in the top right corner of the screen.

  echo -n $Color1$Time $Color2$Date$Normal

 # restore the cursor to whatever was its previous position

  tput rc

 # Delay for 1 second

  sleep 1

done