Category: Unix-Linux Administration

Feb 12 2010

unix user account lock / unlock

passwd -l to lock it.

/usr/lbin/modprpw -l -k will unlock it.

Feb 10 2010

How to check the Disk devices attached to the Linux Server

How to check the Disk devices attached to the Linux Server

[oracle@RAC01 software]$ dmesg | grep Attached

Feb 05 2010

Linux DHCP to Static IP Address

———————Linux DHCP to Static IP Address

/etc/hosts – This is for Hostname and IP address
/etc/resolv.conf – This is for DNS
/etc/sysconfig/network – This is for Gateway change
/etc/sysconfig/network-scripts/ifcfg-eth0 – IP,Subnet and Type

1. Host Name and IP information change in /etc/hosts file
[root@RAC01 etc]# pwd
/etc
[root@RAC01 etc]# cat hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
192.168.5.80 rac01.localdomain rac01

2. Static IP address information update in Device file

[root@RAC01 network-scripts]# pwd
/etc/sysconfig/network-scripts
[root@RAC01 network-scripts]#
— Before Change
[root@RAC01 network-scripts]# cat ifcfg-eth0
# Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=00:0C:29:6C:66:60
ONBOOT=yes
DHCP_HOSTNAME=RAC01
[root@RAC01 network-scripts]#

— After Change
[root@RAC01 network-scripts]# cat ifcfg-eth0
# Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.5.80
NETMASK=255.255.248.0
HWADDR=00:0C:29:6C:66:60
ONBOOT=yes

3. DNS information update – Resolv.conf file – No Change required as it is in the same DNS

[root@RAC01 etc]# cat resolv.conf
; generated by /sbin/dhclient-script
nameserver 192.168.1.1
nameserver 192.168.2.1
[root@RAC01 etc]#

4. Gateway information
—Before Change
[root@RAC01 sysconfig]# pwd
/etc/sysconfig
[root@RAC01 sysconfig]# cat network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=RAC01
[root@RAC01 sysconfig]#

— After Change
[root@RAC01 sysconfig]# pwd
/etc/sysconfig
[root@RAC01 sysconfig]# cat network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=RAC01
GATEWAY=192.168.0.3
[root@RAC01 sysconfig]#

Feb 05 2010

Change the IP address in Linux Machine

You have to change the following files.

/etc/hosts – This is for Hostname and IP address
/etc/resolv.conf – This is for DNS
/etc/sysconfig/network – This is for Gateway change
/etc/sysconfig/network-scripts/ifcfg-eth0 – IP,Subnet and Type

/etc/hosts
/etc/nodenames
/etc/hostname.[device]
/etc/defaultrouter
/etc/defaultdomain
/etc/nodename

Jan 22 2010

Network Traffic -iptraf

You can install open source iptraf on your servers to know the Traffic of Each the Server.

IPTraf is distributed as open-source software under the terms of the GNU General Public License. See the COPYING file in the distribution for details.

IPTraf is in a compressed tar format. Ready-to-run executables are available in the iptraf-version.bin.i386.tar.gz files. The ready-to-run binary packages for for Intel machines running GNU libc 2.1

To install the software, you will need GNU zip (gzip) and the tar utility.

Click on the URL for download

iptraf

Jan 22 2010

Who Changed the password – Unix – Linux

How to find out who changed the password in Unix or Linux

We can check it in messages file in /var/log folder

Then Edit the file in those time and line and then before you will be able to know who logged into that server at what time from which IP address.

[root@TEST log]# pwd
/var/log
[root@TEST log]# cat messages |grep password
Jan 22 11:03:37 TEST passwd(pam_unix)[800]: password changed for oracle

Dec 25 2009

Command to list out all cronjobs which is not commented

UNIXSRV01# crontab -l | grep ^[^#]

Dec 21 2009

Hardware device information in Linux

Basically manufacturer of the Card and Serial Number and Name or identifier of the Device.
You can get the card details [and all other hardware details] with ‘lspci -vvv’ command. But this may not show the serial number. You may have to check the card physically, to get the serial number.

Nov 23 2009

Convert from ext3 to ext4

Convert from ext3 to ext4

WARNING! Once you run following commands, the filesystem will no longer be mountable using the ext3. Please note that ext4 may have some bugs so do not use for production servers (wait for sometime watch Linux kernel mailing list for ext4 bugs). It’s recommended that you keep /boot in a ext3 partition for sometime.
You need ext4 patch applied into kernel and compile kernel with ext4 support. Once done type the following command to convert an existing ext3 filesystem to use ext4, type:

# tune2fs -O extents,uninit_bg,dir_index /dev/dev-name
For example convert /dev/sdb1 to ext4, enter:

# cd /; umount /dev/sdb1
# tune2fs -O extents,uninit_bg,dir_index /dev/sdb1
Next run fsck, enter:

# fsck -pf /dev/sdb1
How do I mount ext4 partition?
mount -t ext4 /dev/sdb1 /path
mount -t ext4 /dev/sdb1 /share
mount -t ext4 /dev/disk/by-uuid/YOUR-PARTITION-UUID /share

Nov 23 2009

ext4 Linux File System

ext4 Linux File System
The ext4 filesystem has more features and generally better performance than ext3, which is showing its age in the Linux filesystem world.
Features include:
Delayed allocation & mballoc allocator for better on-disk allocation
* Sub-second timestamps
* Space preallocation
* Journal checksumming
* Large (>2T) file support
* Large (>16T) filesystem support
* Defragmentation support

Alibi3col theme by Themocracy