I am dumping the complete configuration output of my 2 RAID controllers using LSI's MegaCLI command. I would like to parse the text file and print out only the lines I am interested in. For example:
"Adapter"
"Product Name"
"RAID Level Size State"
"Number Of Drives"
"Physical Disk"
"Raw Size"
"Link Speed"
"Media Type"
"Drive Temperature"
However, given the fact that the file contains configuration data for 2 RAID controller cards in descending order, how would I best approach this task using ONLY BASH! Below is the output I am dealing with.
NOTE: I should mention that I plan on installing another RAID controller soon, so ideally I would want to use something like BASH's 'read' built-in to read in the file. That way, the script will automatically catch a newly installed RAID controllers config data.
==============================================================================
Adapter: 0
Product Name: Supermicro SMC2208
Memory: 1024MB
BBU: Absent
Serial No:
==============================================================================
Number of DISK GROUPS: 1
DISK GROUP: 0
Number of Spans: 1
SPAN: 0
Span Reference: 0x00
Number of PDs: 2
Number of VDs: 1
Number of dedicated Hotspares: 0
Virtual Drive Information:
Virtual Drive: 0 (Target Id: 0)
Name :
RAID Level : Primary-1, Secondary-0, RAID Level Qualifier-0
Size : 54.947 GB
Sector Size : 512
Mirror Data : 54.947 GB
State : Optimal
Strip Size : 64 KB
Number Of Drives : 2
Span Depth : 1
Default Cache Policy: WriteThrough, ReadAhead, Cached, No Write Cache if Bad BBU
Current Cache Policy: WriteThrough, ReadAhead, Cached, No Write Cache if Bad BBU
Default Access Policy: Read/Write
Current Access Policy: Read/Write
Disk Cache Policy : Enabled
Encryption Type : None
Bad Blocks Exist: No
PI type: No PI
Is VD Cached: No
Physical Disk Information:
Physical Disk: 0
Enclosure Device ID: 252
Slot Number: 0
Drive's postion: DiskGroup: 0, Span: 0, Arm: 0
Enclosure position: N/A
Device Id: 5
WWN: 5001517803d94502
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SATA
Raw Size: 55.899 GB [0x6fccf30 Sectors]
Non Coerced Size: 55.399 GB [0x6eccf30 Sectors]
Coerced Size: 54.947 GB [0x6de5000 Sectors]
Sector Size: 512
Firmware state: Online, Spun Up
Commissioned Spare : No
Emergency Spare : No
Device Firmware Level: 300i
Shield Counter: 0
Successful diagnostics completion on : N/A
SAS Address(0): 0x4433221103000000
Connected Port Number: 1(path0)
Inquiry Data: CVMP302300A6060AGN INTEL SSDSC2CT060A3 300i
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Needs EKM Attention: No
Foreign State: None
Device Speed: 6.0Gb/s
Link Speed: 6.0Gb/s
Media Type: Solid State Device
Drive Temperature : N/A
PI Eligibility: No
Drive is formatted for PI information: No
PI: No PI
Port-0 :
Port status: Active
Port's Linkspeed: 6.0Gb/s
Drive has flagged a S.M.A.R.T alert : No
Physical Disk: 1
Enclosure Device ID: 252
Slot Number: 1
Drive's postion: DiskGroup: 0, Span: 0, Arm: 1
Enclosure position: N/A
Device Id: 2
WWN: 5001517803d855bb
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SATA
Raw Size: 55.899 GB [0x6fccf30 Sectors]
Non Coerced Size: 55.399 GB [0x6eccf30 Sectors]
Coerced Size: 54.947 GB [0x6de5000 Sectors]
Sector Size: 512
Firmware state: Online, Spun Up
Commissioned Spare : No
Emergency Spare : No
Device Firmware Level: 300i
Shield Counter: 0
Successful diagnostics completion on : N/A
SAS Address(0): 0x4433221102000000
Connected Port Number: 0(path0)
Inquiry Data: CVMP3020013L060AGN INTEL SSDSC2CT060A3 300i
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Needs EKM Attention: No
Foreign State: None
Device Speed: 6.0Gb/s
Link Speed: 6.0Gb/s
Media Type: Solid State Device
Drive Temperature : N/A
PI Eligibility: No
Drive is formatted for PI information: No
PI: No PI
Port-0 :
Port status: Active
Port's Linkspeed: 6.0Gb/s
Drive has flagged a S.M.A.R.T alert : No
==============================================================================
Adapter: 1
Product Name: Supermicro SMC2208
Memory: 1024MB
BBU: Absent
Serial No:
==============================================================================
Number of DISK GROUPS: 1
DISK GROUP: 0
Number of Spans: 1
SPAN: 0
Span Reference: 0x00
Number of PDs: 2
Number of VDs: 1
Number of dedicated Hotspares: 0
Virtual Drive Information:
Virtual Drive: 0 (Target Id: 0)
Name :
RAID Level : Primary-1, Secondary-0, RAID Level Qualifier-0
Size : 54.947 GB
Sector Size : 512
Mirror Data : 54.947 GB
State : Optimal
Strip Size : 64 KB
Number Of Drives : 2
Span Depth : 1
Default Cache Policy: WriteThrough, ReadAhead, Cached, No Write Cache if Bad BBU
Current Cache Policy: WriteThrough, ReadAhead, Cached, No Write Cache if Bad BBU
Default Access Policy: Read/Write
Current Access Policy: Read/Write
Disk Cache Policy : Enabled
Encryption Type : None
Bad Blocks Exist: No
PI type: No PI
Is VD Cached: No
Physical Disk Information:
Physical Disk: 0
Enclosure Device ID: 252
Slot Number: 0
Drive's postion: DiskGroup: 0, Span: 0, Arm: 0
Enclosure position: N/A
Device Id: 5
WWN: 5001517803d94502
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SATA
Raw Size: 55.899 GB [0x6fccf30 Sectors]
Non Coerced Size: 55.399 GB [0x6eccf30 Sectors]
Coerced Size: 54.947 GB [0x6de5000 Sectors]
Sector Size: 512
Firmware state: Online, Spun Up
Commissioned Spare : No
Emergency Spare : No
Device Firmware Level: 300i
Shield Counter: 0
Successful diagnostics completion on : N/A
SAS Address(0): 0x4433221103000000
Connected Port Number: 1(path0)
Inquiry Data: CVMP302300A6060AGN INTEL SSDSC2CT060A3 300i
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Needs EKM Attention: No
Foreign State: None
Device Speed: 6.0Gb/s
Link Speed: 6.0Gb/s
Media Type: Solid State Device
Drive Temperature : N/A
PI Eligibility: No
Drive is formatted for PI information: No
PI: No PI
Port-0 :
Port status: Active
Port's Linkspeed: 6.0Gb/s
Drive has flagged a S.M.A.R.T alert : No
Physical Disk: 1
Enclosure Device ID: 252
Slot Number: 1
Drive's postion: DiskGroup: 0, Span: 0, Arm: 1
Enclosure position: N/A
Device Id: 2
WWN: 5001517803d855bb
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SATA
Raw Size: 55.899 GB [0x6fccf30 Sectors]
Non Coerced Size: 55.399 GB [0x6eccf30 Sectors]
Coerced Size: 54.947 GB [0x6de5000 Sectors]
Sector Size: 512
Firmware state: Online, Spun Up
Commissioned Spare : No
Emergency Spare : No
Device Firmware Level: 300i
Shield Counter: 0
Successful diagnostics completion on : N/A
SAS Address(0): 0x4433221102000000
Connected Port Number: 0(path0)
Inquiry Data: CVMP3020013L060AGN INTEL SSDSC2CT060A3 300i
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Needs EKM Attention: No
Foreign State: None
Device Speed: 6.0Gb/s
Link Speed: 6.0Gb/s
Media Type: Solid State Device
Drive Temperature : N/A
PI Eligibility: No
Drive is formatted for PI information: No
PI: No PI
Port-0 :
Port status: Active
Port's Linkspeed: 6.0Gb/s
Drive has flagged a S.M.A.R.T alert : No
Exit Code: 0x00
When you say "ONLY BASH", do you really mean it? bash by itself is pretty powerless; it really depends on having a collection of non-builtin commands available to do anything nontrivial. Also, do you really just want the selected lines, or do you want to reformat the info at all?
If you just want the lines (and maybe a little header info) and have egrep available, this is simple:
MegaCLI -whateveroptions | egrep '^(Adapter|Product Name|RAID Level Size State|Number Of Drives|Physical Disk|Raw Size|Link Speed|Media Type|Drive Temperature):`
If you really need 100% pure bash, you can do it with read, case, and echo:
MegaCLI -whateveroptions | while read line; do
case "$line" in
Adapter:* | \
Product Name:* | \
RAID Level Size State:* | \
Number Of Drives:* | \
Physical Disk:* | \
Raw Size:* | \
Link Speed:* | \
Media Type:* | \
Drive Temperature:* )
echo "$line" ;;
esac
done
If you get sick of parsing this stuff I would consider using a newer LSI controller and the StorCLI64 binary. StorCLI is somewhat similar to MegaCLI, but allows you to append " J" to every command to have the response returned in JSON.
Related
Looking for some help with making an output from a MegaCli command a bit more readable.
The output is:
PS C:\Users\Administrator> C:\Users\Administrator\Downloads\8-04-07_MegaCLI\Win_CliKL_8.04.07\MegaCliKL -LDInfo -Lall -aAll
Adapter 0 -- Virtual Drive Information:
Virtual Drive: 0 (Target Id: 0)
Name :OS
RAID Level : Primary-1, Secondary-0, RAID Level Qualifier-0
Size : 558.375 GB
Mirror Data : 558.375 GB
State : Optimal
Strip Size : 64 KB
Number Of Drives : 2
Span Depth : 1
Default Cache Policy: WriteBack, ReadAdaptive, Direct, No Write Cache if Bad BBU
Current Cache Policy: WriteBack, ReadAdaptive, Direct, No Write Cache if Bad BBU
Default Access Policy: Read/Write
Current Access Policy: Read/Write
Disk Cache Policy : Disk's Default
Encryption Type : None
Bad Blocks Exist: No
Is VD Cached: Yes
Cache Cade Type : Read Only
Virtual Drive: 1 (Target Id: 1)
Name :Storage
RAID Level : Primary-0, Secondary-0, RAID Level Qualifier-0
Size : 7.275 TB
Parity Size : 0
State : Optimal
Strip Size : 64 KB
Number Of Drives : 4
Span Depth : 1
Default Cache Policy: WriteBack, ReadAdaptive, Direct, No Write Cache if Bad BBU
Current Cache Policy: WriteBack, ReadAdaptive, Direct, No Write Cache if Bad BBU
Default Access Policy: Read/Write
Current Access Policy: Read/Write
Disk Cache Policy : Disk's Default
Encryption Type : None
Bad Blocks Exist: No
Is VD Cached: Yes
Cache Cade Type : Read Only
Exit Code: 0x00
The command I'm using is:
C:\Users\Administrator\Downloads\8-04-07_MegaCLI\Win_CliKL_8.04.07\MegaCliKL -LDInfo -Lall -aAll
How can I make that information a bit more readable?
I only actually need: Name, Raid Level, Size, Number of drives, State, and Span Depth.
It has to be doable in just powershell.
Thanks in advance for any help!
Zack
If "a bit more readable" means "reduce output merely to lines starting with listed items":
$MegaCliKL = & C:\Users\Administrator\Downloads\8-04-07_MegaCLI\Win_CliKL_8.04.07\MegaCliKL -LDInfo -Lall -aAll
$listedItems = '^\s*Name',
'Raid Level',
'Size',
'Number of drives',
'State',
'Span Depth' -join '|^\s*'
$MegaCliKL -match $listedItems |
ForEach-Object {
if ( $_ -match '^\s*Name' ) {''} # line separator
$_
}
Output:
Name :OS
RAID Level : Primary-1, Secondary-0, RAID Level Qualifier-0
Size : 558.375 GB
State : Optimal
Number Of Drives : 2
Span Depth : 1
Name :Storage
RAID Level : Primary-0, Secondary-0, RAID Level Qualifier-0
Size : 7.275 TB
State : Optimal
Number Of Drives : 4
Span Depth : 1
In embedded platform built by petalinux, during boot(from u-boot), the last print I see is(sometimes) mmcblk0boot1 print.
What are the good ways to debug/trace/fix the problem?
As you can see at the end of the log is the start of another boot
The attached log
=======================================================================
> U-Boot 2015.07 (Jul 22 2018 - 14:04:29 +0300)
> DRAM: ECC disabled 511 MiB
> MMC: Max clock 26000000, Min clock 0
> zynq_sdhci: 0
> SF: Detected S25FL128S_64K with page size 256 Bytes, erase size 64 KiB, total 16 MiB
> *** Warning - bad CRC, using default environment
> In: serial
> Out: serial
> Err: serial
> Net: Gem.e000b000
> U-BOOT for AAS_TOP_V0_00_12
> Hit any key to stop autoboot: 4 3 2 1 0
> Device: zynq_sdhci
> Manufacturer ID: fe
> OEM: 14e
> Name: MMC04
> Tran Speed: 26000000
> Rd Block Len: 512
> MMC version 4.4.1
> High Capacity: Yes
> Capacity: 3.5 GiB
> Bus Width: 4-bit
> Erase Group Size: 512 KiB
> HC WP Group Size: 4 MiB
> User Capacity: 3.5 GiB
> Boot Capacity: 16 MiB ENH
> RPMB Capacity: 128 KiB ENH
> reading image.ub
> 7775932 bytes read in 750 ms (9.9 MiB/s)
> ## Loading kernel from FIT Image at 01000000 ...
> Using 'conf#1' configuration
> Verifying Hash Integrity ... OK
> Trying 'kernel#1' kernel subimage
> Description: PetaLinux Kernel
> Type: Kernel Image
> Compression: gzip compressed
> Data Start: 0x010000f0
> Data Size: 7760664 Bytes = 7.4 MiB
> Architecture: ARM
> OS: Linux
> Load Address: 0x00008000
> Entry Point: 0x00008000
> Hash algo: crc32
> Hash value: 53e3bbd8
> Verifying Hash Integrity ... crc32+ OK
> ## Loading fdt from FIT Image at 01000000 ...
> Using 'conf#1' configuration
> Trying 'fdt#1' fdt subimage
> Description: Flattened Device Tree blob
> Type: Flat Device Tree
> Compression: uncompressed
> Data Start: 0x01766cec
> Data Size: 13972 Bytes = 13.6 KiB
> Architecture: ARM
> Hash algo: crc32
> Hash value: bdcc1805
> Verifying Hash Integrity ... crc32+ OK
> Booting using the fdt blob at 0x1766cec
> Uncompressing Kernel Image ... OK
> Loading Device Tree to 07ff9000, end 07fff693 ... OK
Starting kernel:
> Starting kernel ...
> Booting Linux on physical CPU 0x0
> Linux version 4.0.0-xilinx (alex#ubuntu) (gcc version 4.9.2
> (SourceryCodeBench Lite 2015.05-17) ) #3 SMP PREEMPT Sun Nov 12 10:10:19
> CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
> CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
> Machine model: MY_MACHINE
> bootconsole [earlycon0] enabled
> cma: Reserved 16 MiB at 0x1ec00000
> Memory policy: Data cache writealloc
> PERCPU: Embedded 11 pages/cpu #dfecf000 s12672 r8192 d24192 u45056
> Built 1 zonelists in Zone order, mobility grouping on. Total pages: 129794
> Kernel command line: console=ttyPS0,115200 earlyprintk
> PID hash table entries: 2048 (order: 1, 8192 bytes)
> Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
> Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
> Memory: 490876K/523264K available (4763K kernel code, 223K rwdata, 1708K
> rodata, 4376K init, 208K bss, 16004K reserved, 16384K cma-reserved, 0K
>highmem)
> Virtual kernel memory layout:
> vector : 0xffff0000 - 0xffff1000 ( 4 kB)
> fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
> vmalloc : 0xe0000000 - 0xff000000 ( 496 MB)
> lowmem : 0xc0000000 - 0xdff00000 ( 511 MB)
> pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
> modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
> .text : 0xc0008000 - 0xc0659f7c (6472 kB)
> .init : 0xc065a000 - 0xc0aa0000 (4376 kB)
> .data : 0xc0aa0000 - 0xc0ad7e60 ( 224 kB)
> .bss : 0xc0ad7e60 - 0xc0b0c174 ( 209 kB)
> Preemptible hierarchical RCU implementation.
> Additional per-CPU info printed with stalls.
> RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
> RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
> NR_IRQS:16 nr_irqs:16 16
> L2C: platform modifies aux control register: 0x72360000 -> 0x72760000
> L2C: DT/platform modifies aux control register: 0x72360000 -> 0x72760000
> L2C-310 erratum 769419 enabled
> L2C-310 enabling early BRESP for Cortex-A9
> L2C-310 full line of zeros enabled for Cortex-A9
> L2C-310 ID prefetch enabled, offset 1 lines
> L2C-310 dynamic clock gating enabled, standby mode enabled
> L2C-310 cache controller enabled, 8 ways, 512 kB
> L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x76760001
> slcr mapped to e0004000
> zynq_clock_init: clkc starts at e0004100
> Zynq clock init
> sched_clock: 64 bits at 333MHz, resolution 3ns, wraps every 3298534883328ns
> timer #0 at e0008000, irq=17
> Console: colour dummy device 80x30
> Calibrating delay loop... 1332.01 BogoMIPS (lpj=6660096)
> pid_max: default: 32768 minimum: 301
> Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
> Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
> CPU: Testing write buffer coherency: ok
> CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
> Setting up static identity map for 0x482348 - 0x4823a0
> CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
> Brought up 2 CPUs
> SMP: Total of 2 processors activated (2664.03 BogoMIPS).
> CPU: All CPU(s) started in SVC mode.
> devtmpfs: initialized
> VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
> pinctrl core: initialized pinctrl subsystem
> NET: Registered protocol family 16
> DMA: preallocated 256 KiB pool for atomic coherent allocations
> cpuidle: using governor ladder
> cpuidle: using governor menu
> hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
> hw-breakpoint: maximum watchpoint size is 4 bytes.
> zynq-ocm f800c000.ocmc: ZYNQ OCM pool: 256 KiB # 0xe0080000
> vgaarb: loaded
> SCSI subsystem initialized
> usbcore: registered new interface driver usbfs
> usbcore: registered new interface driver hub
> usbcore: registered new device driver usb
> media: Linux media interface: v0.10
> Linux video capture interface: v2.00
> pps_core: LinuxPPS API ver. 1 registered
> pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti
> <giometti#linux.it>
> PTP clock support registered
> EDAC MC: Ver: 3.0.0
> Advanced Linux Sound Architecture Driver Initialized.
> Switched to clocksource arm_global_timer
> NET: Registered protocol family 2
> TCP established hash table entries: 4096 (order: 2, 16384 bytes)
> TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
> TCP: Hash tables configured (established 4096 bind 4096)
> TCP: reno registered
> UDP hash table entries: 256 (order: 1, 8192 bytes)
> UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
> NET: Registered protocol family 1
> RPC: Registered named UNIX socket transport module.
> RPC: Registered udp transport module.
> RPC: Registered tcp transport module.
> RPC: Registered tcp NFSv4.1 backchannel transport module.
> hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters
> available
> futex hash table entries: 512 (order: 3, 32768 bytes)
> jffs2: version 2.2. (NAND) (SUMMARY) © 2001-2006 Red Hat, Inc.
> io scheduler noop registered
> io scheduler deadline registered
> io scheduler cfq registered (default)
> zynq-pinctrl 700.pinctrl: zynq pinctrl initialized
> dma-pl330 f8003000.dmac: Loaded driver for PL330 DMAC-241330
> dma-pl330 f8003000.dmac: DBUFF-128x8bytes Num_Chans-8 Num_Peri-4
> Num_Events-16
> e0000000.serial: ttyPS1 at MMIO 0xe0000000 (irq = 144, base_baud = 3125000)
> is a xuartps
> e0001000.serial: ttyPS0 at MMIO 0xe0001000 (irq = 145, base_baud = 3125000)
> is a xuartps
> �console [ttyPS0] enabled
> console [ttyPS0] enabled
> bootconsole [earlycon0] disabled
> bootconsole [earlycon0] disabled
> xdevcfg f8007000.devcfg: ioremap 0xf8007000 to e006c000
> [drm] Initialized drm 1.1.0 20060810
> brd: module loaded
> loop: module loaded
> CAN device driver interface
> libphy: MACB_mii_bus: probed
> macb e000b000.ethernet eth0: Cadence GEM rev 0x00020118 at 0xe000b000 irq
> 149 (00:0a:35:00:1e:53)
> macb e000b000.ethernet eth0: attached PHY driver [Marvell 88E1510]
> (mii_bus:phy_addr=e000b000.etherne:00, irq=-1)
> e1000e: Intel(R) PRO/1000 Network Driver - 2.3.2-k
> e1000e: Copyright(c) 1999 - 2014 Intel Corporation.
> ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
> ehci-pci: EHCI PCI platform driver
> usbcore: registered new interface driver usb-storage
> mousedev: PS/2 mouse device common for all mice
> i2c /dev entries driver
> at24 0-0050: 1024 byte 24c08 EEPROM, writable, 1 bytes/write
> cdns-i2c e0004000.i2c: 400 kHz mmio e0004000 irq 141
> Xilinx Zynq CpuIdle Driver started
> Driver 'mmcblk' needs updating - please use bus_type methods
> sdhci: Secure Digital Host Controller Interface driver
> sdhci: Copyright(c) Pierre Ossman
> sdhci-pltfm: SDHCI platform and OF driver helper
> sdhci-arasan e0101000.sdhci: No vmmc regulator found
> sdhci-arasan e0101000.sdhci: No vqmmc regulator found
> mmc0: SDHCI controller on e0101000.sdhci [e0101000.sdhci] using ADMA
> ledtrig-cpu: registered to indicate activity on CPUs
> usbcore: registered new interface driver usbhid
> usbhid: USB HID core driver
> TCP: cubic registered
> NET: Registered protocol family 17
> can: controller area network core (rev 20120528 abi 9)
> NET: Registered protocol family 29
> can: raw protocol (rev 20120528)
> can: broadcast manager protocol (rev 20120528 t)
> can: netlink gateway (rev 20130117) max_hops=1
> Registering SWP/SWPB emulation handler
> /home/alex/Petalinux/petalinux-v2015.4-final/components/linux-kernel/xlnx-
> 4.0/drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
> ALSA device list:
> No soundcards found.
> Freeing unused kernel memory: 4376K (c065a000 - c0aa0000)
> mmc0: MAN_BKOPS_EN bit is not set
> mmc0: new high speed MMC card at address 0001
>
> INIT: mmcblk0: mmc0:0001 MMC04G 3.52 GiB
> mmcblk0boot0: mmc0:0001 MMC04G partition 1 16.0 MiB
> mmcblk0boot1: mmc0:0001 MMC04G partition 2 16.0 MiB
> U-Boot 2015.07 (Jul 22 2018 - 14:04:29 +0300)
I have cPanel/WHM installed on a 40gb partition, however WHM shows that 8.9gb out of 9.9gb is in use. How do I correct this?
This is on an AWS EC2 instance. The root volume is configured to 40gb.
After running df -h :
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
9.9G 8.9G 574M 95% /
/dev/hda1 99M 26M 69M 28% /boot
tmpfs 1006M 0 1006M 0% /dev/shm
So that shows that the /dev/mapper/VolGroup00-LogVol00 is 9.9GB. However, if I run parted and print the configuration I can see that:
Model: QEMU HARDDISK (ide)
Disk /dev/hda: 42.9GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 32.3kB 107MB 107MB primary ext3 boot
2 107MB 21.5GB 21.4GB primary lvm
I need the whole 40GB for cPanel/WHM. Why would it limit its self to 1/4 of the disk?
After Running vgs
VG #PV #LV #SN Attr VSize VFree
VolGroup00 1 2 0 wz--n- 19.88G 0
pvs:
PV VG Fmt Attr PSize PFree
/dev/hda2 VolGroup00 lvm2 a-- 19.88G 0
lvs:
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
LogVol00 VolGroup00 -wi-ao 10.22G
LogVol01 VolGroup00 -wi-ao 9.66G
fdisk -l
Disk /dev/hda: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 2610 20860402+ 8e Linux LVM
Disk /dev/dm-0: 10.9 GB, 10972299264 bytes
255 heads, 63 sectors/track, 1333 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/dm-0 doesn't contain a valid partition table
Disk /dev/dm-1: 10.3 GB, 10368319488 bytes
255 heads, 63 sectors/track, 1260 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/dm-1 doesn't contain a valid partition table
Where are you checking disk usages in WHM ? Can you please let me know following command out put so that I can assist you on this.
df -h
I think there is free space on your server in LVM partition. Can you please check this with the following command and let me know
vgs
pvs
lvs
fdisk -l
And if you found any free space in your VolGroup, Then you will have to increase it through lvextend command, You can check it at http://www.24x7servermanagement.com/blog/how-to-increase-the-size-of-the-logical-volume/
I have a command that outputs hard drive status.
I am planning to run this in a script for monitoring purposes.
I would like to pull out certain rows and display them such as Slot Number, PD type Raw Size, Drive's position.
How would I do this. (I'm assuming that it would be some sort of awk statement.)
Output is as such (note that the "(\n)" denotes new lines not a formatting choice)
Enclosure Device ID: 252
Slot Number: 3
Drive's postion: DiskGroup: 1, Span: 0, Arm: 1
Enclosure position: 0
Device Id: 7
WWN: 5000C50034BB0CD8
Sequence Number: 2
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SAS
Raw Size: 2.728 TB [0x15d50a3b0 Sectors]
Non Coerced Size: 2.728 TB [0x15d40a3b0 Sectors]
Coerced Size: 2.727 TB [0x15d3ef000 Sectors]
Firmware state: Online, Spun Up
Device Firmware Level: 0003
Connected Port Number: 2(path0)
Inquiry Data: SEAGATE ST33000650SS 0003Z290VK2V
(\n)
(\n)
(\n)
Enclosure Device ID: 252
Slot Number: 4
Drive's postion: DiskGroup: 1, Span: 0, Arm: 1
Enclosure position: 0
Device Id: 8
WWN: 5000C50034BB0CD8
Sequence Number: 2
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SAS
Raw Size: 2.728 TB [0x15d50a3b0 Sectors]
(continues like this)
EDIT:
I would like to display them as
Slot Number: 3
Drive's postion: DiskGroup: 1, Span: 0, Arm: 1
Enclosure position: 0
Device Id: 7
PD Type: SAS
Raw Size: 2.728 TB [0x15d50a3b0 Sectors]ors]
Firmware state: Online, Spun Up
Device Firmware Level: 0003
(\n)
Slot Number: 4
Drive's postion: DiskGroup: 1, Span: 0, Arm: 1
Enclosure position: 0
Device Id: 8
PD Type: SAS
Raw Size: 2.728 TB [0x15d50a3b0 Sectors]ors]
Firmware state: Online, Spun Up
Device Firmware Level: 0003
If you just want to extract the lines of interest, you can use egrep:
cmd | egrep '^((Slot Number)|(PD Type)|(Raw Size)):' \
| sed 's/^Slot Number/\n&/'
I dont seem to have any caching enabled when checking in Opscenter or cfstats. Im running Cassandra 1.1.7 with Solandra on Debian. I have set the required global options in cassandra.yaml:
key_cache_size_in_mb: 800
key_cache_save_period: 14400
row_cache_size_in_mb: 800
row_cache_save_period: 15400
row_cache_provider: SerializingCacheProvider
Column Families were created as follows:
create column family example
with column_type = 'Standard'
and comparator = 'BytesType'
and default_validation_class = 'BytesType'
and key_validation_class = 'BytesType'
and read_repair_chance = 1.0
and dclocal_read_repair_chance = 0.0
and gc_grace = 864000
and min_compaction_threshold = 4
and max_compaction_threshold = 32
and replicate_on_write = true
and compaction_strategy = 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'
and caching = 'ALL';
Opscenter shows no data available on caching graphs and CFSTATS doesn't show any cache related fields:
Column Family: charsets
SSTable count: 1
Space used (live): 5558
Space used (total): 5558
Number of Keys (estimate): 128
Memtable Columns Count: 0
Memtable Data Size: 0
Memtable Switch Count: 0
Read Count: 61381
Read Latency: 0.123 ms.
Write Count: 0
Write Latency: NaN ms.
Pending Tasks: 0
Bloom Filter False Postives: 0
Bloom Filter False Ratio: 0.00000
Bloom Filter Space Used: 16
Compacted row minimum size: 1917
Compacted row maximum size: 2299
Compacted row mean size: 2299
Any help or suggestions are appreciated.
Sam
The caching stats have been moved from cfstats to info in Cassandra 1.1. If you run nodetool info you should see something like:
Key Cache : size 5552 (bytes), capacity 838860800 (bytes), 38 hits, 47 requests, 0.809 recent hit rate, 14400 save period in seconds
Row Cache : size 0 (bytes), capacity 838860800 (bytes), 0 hits, 0 requests, NaN recent hit rate, 15400 save period in seconds
This is because there are now global caches, rather than per-CF. It seems that Opscenter needs updating for this change - maybe there is a later version available that will work.