Skip to main content

Linux Commands






Few commands learned on SuSE Linux

List version of SuSE Linux:

# cat /etc/SuSE-release

Restart network:

# /sbin/rcnetwork restart

Network config files under : /etc/sysconfig/network/ directory (ifcfg-<interface name> files)

Routes in /etc/sysconfig/network/routes file

Status of the Network: ifstatus <network interface name>

Bring down netowork – ifdown <network interface name>

Bring up network – ifup <network interface name>

YaST – configuration tool for SuSE – pretty much all the system configuration can be done from this tool







Generic LVM commands in Linux:

List the physical disks installed:

# fdisk –l

Create Physical Volume (initialize physical disk for LVM)

# pvcreate /dev/sdc [or any free device name]

Create Volume group

# vgcreate myvg /dev/sdc

Create Logical Volume:

# lvcreate –L 3G –n mylv myvg

Display Commands

# pvdisplay

# vgdisplay

# lvdisplay

Create ext3 filesystem:

# mkfs.ext3 mylv





[
This filesystem will be automatically checked every 31 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
]
Check file system:

# e2fsck –f /dev/myvg/mylv

Extend LV:

# lvextend –L2G /dev/myvg/mylv

Resize the file system that is using the LV:

# resize2fs /dev/myvg/mylv


  Remove LV:



# lvremove /dev/myvg/mylv


Change LV properties:


# lvchange


To deactivate a LV:


# lvchange -an /dev/myvg/mylv


Display all the LVs in a Volume Group (more verbose information):


# vgdisplay -v myvg


Rescan for new disks:
echo "- - -" > /sys/class/scsi_host/host0/scan

Popular posts from this blog

Commands to restart RMC connection (t...

Commands to restart RMC connection (to HMC from LPAR) It has become very common with the IBM HMC to LPAR (logical/micro partition) communication to drop for unknown reasons.  Most of the time this is not a problem unless there is a need to do a dynamic logical partition operation (or DLAPR operation to add/remove resources on the fly).  This will become evident during the DLPAR operation when HMC complains about having no RMC connection to LPAR in operation.  When this happens run the following commands on the LPAR in question before reattemping the operation.  The DLPAR operation will still work with out this connection, but the LPAR needs a restart to see the change in the resources.  Restart the RMC connection on the LPAR: # /usr/sbin/rsct/install/bin/recfgct # /usr/sbin/rsct/bin/rmcctrl -p Verify the connection by running: lsrsrc IBM.ManagementServer This will show the HMC IP/hostname and the LPAR information.

Network throughput test between 2 AIX servers

The easiest way to test throughput between 2 AIX servers is to do a FTP test, generating data transfer with ‘dd’ command.  This will provide the throughput/speed for the specified amount of data transfer: #src-system> ftp dst-system … … ftp>  put "|dd if=/dev/zero bs=32k count=10000" /dev/null 200 PORT command successful. 150 Opening data connection for /dev/null. 10000+0 records in 10000+0 records out 226 Transfer complete. 327680000 bytes sent in 1.406 seconds (2.277e+05 Kbytes/s) local: |dd if=/dev/zero bs=32k count=10000 remote: /dev/null ftp>bye   This is the same test IBM recommends in the redbook and also during a support call

HP-UX tape configuration

Here are few commands to configure tape drives in HP-UX 1.  Scan for new devices: # ioscan –fnC tape 2.  List tape drives currently recognized by the OS (without performing an actual hardware scan) # ioscan –fnkC tape 3.  remove all the special files used by the tape drives # rmsf  /dev/rmt/* 4.  Recreate the specil files for the tape drives # insf –C tape –e 5.  Remove a tape drive (that has a NO_HW state) # rmsf –H 0/7/1/0.1.24.255.5.5.0 Find the WWN for the HBAs: # ioscan –fnkC fc # fcmsutil /dev/fcd0 Find the WWN for the tape drives connected to the HBA: # fcmsutil /dev/fcd0 get remote all   **These are just a handful of commands to deal with the tape drives.  Not to be used as a procedure