Linux Scroll

Just another WordPress.com site

Category Archives: linux

Sort by memory usage

# ps -eo pmem,pcpu,rss,vsize,args | sort -k 1 -r | more
%MEM %CPU RSS VSZ COMMAND
0.3 0.0 6984 8608 detect_group:btmp
0.3 0.0 6708 155144 python ./hpssd.py
0.3 0.0 6688 8352 detect_group:uroot_log
0.3 0.0 6344 7964 detect_group:nessus
0.3 0.0 6248 7952 detect_group:heartbeat

Advertisements

Corrupt label; wrong magic number

Error messages:

WARNING: /scsi_vhci/ssd@g50060e9015320e000001340c000062b2 (ssd21):
        Corrupt label; wrong magic number

Solution:

# format
Searching for disks...

AVAILABLE DISK SELECTIONS:
       0. c1t0d0 
          /pci@400/pci@0/pci@8/scsi@0/sd@0,0
       1. c1t1d0   solaris
          /pci@400/pci@0/pci@8/scsi@0/sd@1,0
       2. c3r60060E3015440D000001320C00006B86e0 
          /scsi_vhci/ssd@g50060e9015320e000001340c000062b2


Specify disk (enter its number): 2
selecting c3r60060E3015440D000001320C00006B86e0
[disk formatted]

Disk not labeled.  Label it now? y

FORMAT MENU:
        disk       - select a disk
        type       - select (define) a disk type
        partition  - select (define) a partition table
        current    - describe the current disk
        format     - format and analyze the disk
        repair     - repair a defective sector
        label      - write label to the disk
        analyze    - surface analysis
        defect     - defect list management
        backup     - search for backup labels
        verify     - read and display labels
        save       - save new disk/partition definitions
        inquiry    - show vendor, product and revision
        volname    - set 8-character volume name
        !     - execute , then return
        quit
format> quit

# init 6

Postfix – delete queue mail

# mailq
-Queue ID- –Size– —-Arrival Time—- -Sender/Recipient——-
C922E4AC239 486 Thu Nov 3 11:52:28 root@xxx.yahoo.com
(connect to smtp.xxxx.com[11.22.33.44]:25: Connection timed out)
receive@yahoo.com

# postsuper -d C922E4AC239
postsuper: Deleted: 1 message

# postsuper -d ALL
postsuper: Deleted: 1 message

Linux find WWN of a disk/LUN

Get the Fiber Channel addresses of the HBAs:

# systool -c fc_host -v
Class = "fc_host"

  Class Device = "host0"
  Class Device path = "/sys/devices/pci0000:00/0000:00:07.0/0000:06:00.0/host0/fc_host/host0"
    fabric_name         = "0x100000051e6fe203"
    issue_lip           = 
    max_npiv_vports     = "255"
    node_name           = "0x5001738002a106b5"
    npiv_vports_inuse   = "0"
    port_id             = "0x27c742"
    port_name           = "0x5001738002a106b4"
    port_state          = "Online"
    port_type           = "NPort (fabric via point-to-point)"
    speed               = "4 Gbit"
    supported_classes   = "Class 3"
    supported_speeds    = "1 Gbit, 2 Gbit, 4 Gbit, 8 Gbit"
    symbolic_name       = "QMH2562 FW:v4.04.05 DVR:v8.02.01.03.11.0-k9"
    system_hostname     = ""
    tgtid_bind_type     = "wwpn (World Wide Port Name)"
    uevent              =
    vport_create        = 
    vport_delete        = 

    Device = "host0"
    Device path = "/sys/devices/pci0000:00/0000:00:07.0/0000:06:00.0/host0"
      ct                  =
      els                 =
      fw_dump             =
      nvram               = "ISP "
      optrom              =
      optrom_ctl          = 
      sfp                 =
      uevent              = "DEVTYPE=scsi_host"
      vpd                 = "8"


  Class Device = "host1"
  Class Device path = "/sys/devices/pci0000:00/0000:00:07.0/0000:06:00.1/host1/fc_host/host1"
    fabric_name         = "0x100000052e6f1e03"
    issue_lip           = 
    max_npiv_vports     = "255"
    node_name           = "0x5001438003a406b7"
    npiv_vports_inuse   = "0"
    port_id             = "0x50c703"
    port_name           = "0x5001438003a406b6"
    port_state          = "Online"
    port_type           = "NPort (fabric via point-to-point)"
    speed               = "4 Gbit"
    supported_classes   = "Class 3"
    supported_speeds    = "1 Gbit, 2 Gbit, 4 Gbit, 8 Gbit"
    symbolic_name       = "QMH2562 FW:v4.04.05 DVR:v8.02.01.03.11.0-k9"
    system_hostname     = ""
    tgtid_bind_type     = "wwpn (World Wide Port Name)"
    uevent              =
    vport_create        = 
    vport_delete        = 

    Device = "host1"
    Device path = "/sys/devices/pci0000:00/0000:00:07.0/0000:06:00.1/host1"
      ct                  =
      els                 =
      fw_dump             =
      nvram               = "ISP "
      optrom              =
      optrom_ctl          = 
      sfp                 =
      uevent              = "DEVTYPE=scsi_host"
      vpd                 = "8"
 # systool -c fc_transport -v
Class = "fc_transport"

  Class Device = "0:0"
  Class Device path = "/sys/devices/pci0000:00/0000:00:07.0/0000:06:00.0/host0/rport-0:0-0/target0:0:0/fc_transport/target0:0:0"
    node_name           = "0x50060e9015320c49"
    port_id             = "0x23ee80"
    port_name           = "0x50060e9015320c49"
    uevent              =

    Device = "target0:0:0"
    Device path = "/sys/devices/pci0000:00/0000:00:07.0/0000:06:00.0/host0/rport-0:0-0/target0:0:0"
      uevent              = "DEVTYPE=scsi_target"

pvs

pvs – report information about physical volumes

# pvs
PV VG Fmt Attr PSize PFree
/dev/cciss/c0d0p5 sysvg lvm2 a- 103.68G 88.68G
/dev/disk/by-id/lvm2-pvuuid-cfP00I-eoJX-JxKl-2wLf-WviJ-eG0v-ye22Wk datavg lvm2 a- 100.00G 0

Cannot start cron, FIFO exists

! cannot start cron; FIFO exists Fri Oct 28 06:17:46 2011
! ******* CRON ABORTED ******** Fri Oct 28 06:17:46 2011

To fix, remove /etc/cron.d/FIFO and then start cron by running:
# /etc/init.d/cron start

Activate a lvm volume group

# vgdisplay /dev/vg02
vgdisplay: Volume group not activated.
vgdisplay: Cannot display volume group "/dev/vg02".
# vgchange -a y /dev/vg02
Activated volume group.
Volume group "/dev/vg02" has been successfully changed.
# vgdisplay /dev/vg02
--- Volume groups ---
VG Name                     /dev/vg02
VG Write Access             read/write
VG Status                   available
Max LV                      511
Cur LV                      15
Open LV                     15
Max PV                      511
Cur PV                      5
Act PV                      4
Max PE per PV               262144
VGDA                        8
PE Size (Mbytes)            64
Total PE                    178808
Alloc PE                    178800
Free PE                     8
Total PVG                   0
Total Spare PVs             0
Total Spare PVs in use      0
VG Version                  2.0
VG Max Size                 2p
VG Max Extents              33554432

To deactivate vg02:

# vgchange -a n /dev/vg02

gzip

# gzip -v9 *

nfsstat

nfsstat displays statistical information about NFS (Network File System) and RPC (Remote Procedure Call) for the filer.

# nfsstat

Server rpc:
Connection oriented:
calls      badcalls   nullrecv   badlen     xdrcall    dupchecks  dupreqs
5945       0          0          0          0          0          0
Connectionless:
calls      badcalls   nullrecv   badlen     xdrcall    dupchecks  dupreqs
636        0          0          0          0          0          0

Server nfs:
calls      badcalls
0          0
Version 2: (0 calls)
null     getattr  setattr  root     lookup   readlink read     wrcache
0 0%     0 0%     0 0%     0 0%     0 0%     0 0%     0 0%     0 0%
write    create   remove   rename   link     symlink  mkdir    rmdir
0 0%     0 0%     0 0%     0 0%     0 0%     0 0%     0 0%     0 0%
readdir  statfs
0 0%     0 0%
Version 3: (0 calls)
null        getattr     setattr     lookup      access      readlink
0 0%        0 0%        0 0%        0 0%        0 0%        0 0%
read        write       create      mkdir       symlink     mknod
0 0%        0 0%        0 0%        0 0%        0 0%        0 0%
remove      rmdir       rename      link        readdir     readdirplus
0 0%        0 0%        0 0%        0 0%        0 0%        0 0%
fsstat      fsinfo      pathconf    commit
0 0%        0 0%        0 0%        0 0%
Version 4: (0 calls)
null                compound
0 0%                0 0%
Version 4: (0 operations)
reserved            access              close               commit
0 0%                0 0%                0 0%                0 0%
create              delegpurge          delegreturn         getattr
0 0%                0 0%                0 0%                0 0%
getfh               link                lock                lockt
0 0%                0 0%                0 0%                0 0%
locku               lookup              lookupp             nverify
0 0%                0 0%                0 0%                0 0%
open                openattr            open_confirm        open_downgrade
0 0%                0 0%                0 0%                0 0%
putfh               putpubfh            putrootfh           read
0 0%                0 0%                0 0%                0 0%
readdir             readlink            remove              rename
0 0%                0 0%                0 0%                0 0%
renew               restorefh           savefh              secinfo
0 0%                0 0%                0 0%                0 0%
setattr             setclientid         setclientid_confirm verify
0 0%                0 0%                0 0%                0 0%
write               release_lockowner   illegal
0 0%                0 0%                0 0%

Server nfs_acl:
Version 2: (0 calls)
null        getacl      setacl      getattr     access      getxattrdir
0 0%        0 0%        0 0%        0 0%        0 0%        0 0%
Version 3: (0 calls)
null        getacl      setacl      getxattrdir
0 0%        0 0%        0 0%        0 0%

Client rpc:
Connection oriented:
calls      badcalls   badxids    timeouts   newcreds   badverfs   timers
7895495591 2596052    1858       6342       0          0          0
cantconn   nomem      interrupts
7019       0          1832
Connectionless:
calls      badcalls   retrans    badxids    timeouts   newcreds   badverfs
0          0          0          0          0          0          0
timers     nomem      cantsend
0          0          0

Client nfs:
calls      badcalls   clgets     cltoomany
7891150121 1953       7890467539 128
Version 2: (0 calls)
null     getattr  setattr  root     lookup   readlink read     wrcache
0 0%     0 0%     0 0%     0 0%     0 0%     0 0%     0 0%     0 0%
write    create   remove   rename   link     symlink  mkdir    rmdir
0 0%     0 0%     0 0%     0 0%     0 0%     0 0%     0 0%     0 0%
readdir  statfs
0 0%     0 0%
Version 3: (7891032924 calls)
null           getattr        setattr        lookup         access
0 0%           3883466486 49% 16582435 0%    1222234321 15% 503380484 6%
readlink       read           write          create         mkdir
0 0%           91433111 1%    996372088 12%  520045996 6%   27653730 0%
symlink        mknod          remove         rmdir          rename
0 0%           18 0%          516661710 6%   23481878 0%    12748796 0%
link           readdir        readdirplus    fsstat         fsinfo
1314 0%        1391214 0%     48244736 0%    4370658 0%     3 0%
pathconf       commit
22963946 0%    0 0%
Version 4: (0 calls)
null                compound
0 0%                0 0%
Version 4: (0 operations)
reserved            access              close               commit
0 0%                0 0%                0 0%                0 0%
create              delegpurge          delegreturn         getattr
0 0%                0 0%                0 0%                0 0%
getfh               link                lock                lockt
0 0%                0 0%                0 0%                0 0%
locku               lookup              lookupp             nverify
0 0%                0 0%                0 0%                0 0%
open                openattr            open_confirm        open_downgrade
0 0%                0 0%                0 0%                0 0%
putfh               putpubfh            putrootfh           read
0 0%                0 0%                0 0%                0 0%
readdir             readlink            remove              rename
0 0%                0 0%                0 0%                0 0%
renew               restorefh           savefh              secinfo
0 0%                0 0%                0 0%                0 0%
setattr             setclientid         setclientid_confirm verify
0 0%                0 0%                0 0%                0 0%
write
0 0%

Client nfs_acl:
Version 2: (0 calls)
null        getacl      setacl      getattr     access      getxattrdir
0 0%        0 0%        0 0%        0 0%        0 0%        0 0%
Version 3: (3 calls)
null        getacl      setacl      getxattrdir
0 0%        2 66%       0 0%        1 33%

ECC chipkill x4 error

EDAC k8 MC3: general bus error: participating processor(local node origin), time-out(no timeout) memory transaction type(generic read), mem or i/o(mem access), cache level(generic)
EDAC MC3: CE page 0x7fcd99, offset 0x5f0, grain 8, syndrome 0x4f34, row 0, channel 1, label “”: k8_edac
EDAC k8 MC3: extended error code: ECC chipkill x4 error

# grep “[0-9]” /sys/devices/system/edac/mc/mc*/csrow*/ch*_ce_count
/sys/devices/system/edac/mc/mc0/csrow0/ch0_ce_count:0
/sys/devices/system/edac/mc/mc0/csrow0/ch1_ce_count:0
/sys/devices/system/edac/mc/mc0/csrow1/ch0_ce_count:0
/sys/devices/system/edac/mc/mc0/csrow1/ch1_ce_count:0
/sys/devices/system/edac/mc/mc0/csrow2/ch0_ce_count:0
/sys/devices/system/edac/mc/mc0/csrow2/ch1_ce_count:0
/sys/devices/system/edac/mc/mc0/csrow3/ch0_ce_count:0
/sys/devices/system/edac/mc/mc0/csrow3/ch1_ce_count:0
/sys/devices/system/edac/mc/mc1/csrow0/ch0_ce_count:0
/sys/devices/system/edac/mc/mc1/csrow0/ch1_ce_count:0
/sys/devices/system/edac/mc/mc1/csrow1/ch0_ce_count:0
/sys/devices/system/edac/mc/mc1/csrow1/ch1_ce_count:0
/sys/devices/system/edac/mc/mc1/csrow2/ch0_ce_count:0
/sys/devices/system/edac/mc/mc1/csrow2/ch1_ce_count:0
/sys/devices/system/edac/mc/mc1/csrow3/ch0_ce_count:0
/sys/devices/system/edac/mc/mc1/csrow3/ch1_ce_count:0
/sys/devices/system/edac/mc/mc2/csrow0/ch0_ce_count:0
/sys/devices/system/edac/mc/mc2/csrow0/ch1_ce_count:0
/sys/devices/system/edac/mc/mc2/csrow1/ch0_ce_count:0
/sys/devices/system/edac/mc/mc2/csrow1/ch1_ce_count:0
/sys/devices/system/edac/mc/mc2/csrow2/ch0_ce_count:0
/sys/devices/system/edac/mc/mc2/csrow2/ch1_ce_count:0
/sys/devices/system/edac/mc/mc2/csrow3/ch0_ce_count:0
/sys/devices/system/edac/mc/mc2/csrow3/ch1_ce_count:0
/sys/devices/system/edac/mc/mc3/csrow0/ch0_ce_count:0
/sys/devices/system/edac/mc/mc3/csrow0/ch1_ce_count:1093
/sys/devices/system/edac/mc/mc3/csrow1/ch0_ce_count:0
/sys/devices/system/edac/mc/mc3/csrow1/ch1_ce_count:0
/sys/devices/system/edac/mc/mc3/csrow2/ch0_ce_count:0
/sys/devices/system/edac/mc/mc3/csrow2/ch1_ce_count:0
/sys/devices/system/edac/mc/mc3/csrow3/ch0_ce_count:0
/sys/devices/system/edac/mc/mc3/csrow3/ch1_ce_count:0