root@ubuntu:/etc/apt#

root@ubuntu:/etc/apt# cat sources.list

#

deb [trusted=yes] file:/cdrom/dists/stable/main/binary-ppc64el ./




https://access.redhat.com/documentation/en-us/red_hat_virtualization/4.2/html/release_notes/sect-subscriptions


http://www.cbs1.com.my/WebLITE/Applications/news/uploaded/docs/Linux%20on%20Power%20Update%20and%20Strategy%20V1.0.pdf


https://www.ibm.com/developerworks/community/blogs/mhhaque/entry/How_Install_RHVM_Red_Hat_oVirt_Virtualization_Manager_on_Power_System_VM_or_LPAR?lang=en


https://www.ibm.com/developerworks/library/l-rhv-environment-trs/



https://www.ibm.com/developerworks/linux/library/l-openpower-firmware-ipmi/index.html




This article describes the capabilities and features of OpenPOWER hardware and reliability, availability, and serviceability (RAS) components. This article also describes different OpenPOWER firmware features that use Intelligent Platform Management Interface (IPMI).

Firmware plays a critical role in the initialization and booting processes in servers. IBM Power Systems servers are developed based on the IBM® POWER® processor architecture and can be categorized into the following types:

  • IBM PowerVM®) based systems where the IBM POWER Hypervisor™ firmware is the hypervisor
  • IBM Power® non-virtualization based systems that are running under Open Power Abstraction Layer (OPAL) firmware

Based on the management controller, there are two types of Power non-virtualization systems:

  • Flexible service processor (FSP) based systems, where FSP is an IBM PowerPC® fourth-generation processor that manages the system.
  • Baseboard management controller (BMC) or OpenPOWER based system, where BMC is an ASPEED Technology (AST) 2400/2500 system on chip (SOC) that manages the system.

This article focuses on OpenPOWER BMC-based Power non-virtualization systems that are running in the OPAL mode. The firmware for the OpenPOWER systems is a combination of the BMC firmware component and the host firmware component.

  • BMC firmware stack is used to manage the server mostly for out-of-band or remote system operations such as power control operations, firmware flashing, field-replaceable unit (FRU) inventory information, local area network (LAN) configuration, and sensor readings.
  • OpenPOWER host firmware is a system initialization and boot time firmware for Power Systems servers. It contains the following subcomponents:
    • Self-boot engine
    • Hostboot (system initialization firmware for POWER)
    • Skiboot (OPAL boot and runtime firmware for POWER)
    • Skiroot kernel
    • Petitboot (kexec based bootloader)
    • On Chip Controller (OCC) firmware
    • Op-build (buildroot overlay for OpenPOWER)

The host firmware is the main boot firmware that stores in the processor NOR (PNOR) flash chip, and is used to initialize the host processor and make the system boot until runtime state after which the boot process is taken over by the Linux® operating system. OpenPOWER systems firmware has the following boot sequence after you power on the system:

  1. The hostboot firmware initializes the processor and memory subsystem.
  2. The Skiboot firmware (OPAL) initializes Peripheral Component Interconnect (PCI) and the devices that are outside the chip subsystem.
  3. The hostboot and Skiboot firmware generates a flatten-device-tree. 
    Device tree is a binary tree structure, where all the devices are nodes, and different features of the devices are property value pairs that are exposed to the Linux kernel to configure different device drivers.
  4. After the host firmware (OPAL) completes the booting and generation of the device tree, Skiroot is loaded. Skiroot is a combination of the Linux kernel and boot loader (petitboot). Petitboot is a kexec-based boot loader that can detect and load the boot devices. Skiboot (OPAL) firmware also contains an OPAL application programming interface (API) which are runtime hardware abstraction calls used by the Linux operating system to interact with low-level hardware.

The important OpenPOWER firmware IPMI features that are used to monitor, control, and debug the OpenPOWER system are described here.

  • System power control
  • Sensors
  • Thermal and Power management
  • System event log (SEL)
  • Field-replaceable unit (FRU) data
  • Boot progress codes
  • Serial-over LAN (SOL) console
  • System time and boot management
  • Firmware update procedure
  • Virtual Universal Asynchronous Receiver/Transmitter (VUART) to video graphics array (VGA) rendering
  • IPMI lock and unlock feature
  • IPMI PNOR reprovision feature

For all the IPMI features described in this article, invoke the following out-of-band ipmitool command as the base string when you run the commands for all operations:

$IPMI_CMD = ipmitool -I lanplus -H $BMCIP -U $USER -P $PASSWORD
$BMCIP     BMC IP address
$USER      BMC IPMI Username
$PASSWORD  BMC IPMI Password
$IPMI_CMD  IPMI tool command invocation
$CMD = $IPMI_CMD $Operation

System power control

All system power control operations are controlled by the BMC. The different power control operations are power status, power on, power off, power cycle, and power reset.

  • Power status: To know the power status of the OpenPOWER systems, run the following command:
    $IPMI_CMD chassis power status
  • Power on: The system can be powered on by using one of the following methods:
    • Run the following command to power on the system.
      $IPMI_CMD chassis power on
    • Push the power on button.
    • Wake on local area network (LAN).

    To track the power status during the boot process of an OpenPOWER system, the host status sensor provides a system Advanced Configuration and Power Interface (ACPI) power state. This sensor is set to the following states during booting.

    • Soft off: Before power is on (that is, when the system is in off state)
    • Legacy on: When the hostboot firmware boots (that is, when hostboot firmware is able to communicate with the BMC)
    • Working state: When OPAL starts the Linux kernel.

    More details of sensors are provided in the Sensors section.

  • Power off: The system can be powered off by using one of the following methods:
    • Graceful shutdown: Push the power button for less than 3 seconds or run the IPMI power soft command. BMC sends a System Management Software (SMS) attention (graceful operating system shutdown request) to the host operating system. Wait for the host status sensor to be set to the soft off state before BMC trigger hardware power off.
      $IPMI_CMD chassis power soft

      Before BMC issues hardware power off, it must set the host status sensor to the soft off state.

    • Forced power off: Push the power button for more than 3 seconds or run the following IPMI power off command:
      $IPMI_CMD chassis power off

      On forced power off, the system immediately goes to the standby state irrespective of the operating system status, and BMC sets the host status sensor to the softoff state.

  • Power reset: This operation is a hardware power off followed by the IPMI power on sequence.
    $IPMI_CMD chassis power reset
  • Power cycle: When the system is in the working state, the power cycle operation reboots the system. It is a graceful operating system shutdown followed by an IPMI power reset.
    $IPMI_CMD chassis power cycle
  • Power policy: Based on the system power policy, BMC must restore to a particular power state when power supply is lost. What this means is that a server can be powered on automatically according to this power policy setting. To list the available supported power policies, run the following command:
    $IPMI_CMD chassis power policy list

    To set to a particular power policy, run the following command:

    $IPMI_CMD chassis power policy <always-on/always-off/previous>

Sensors

Sensors are software or hardware physical entities that are used to monitor the health of different system hardware devices or software components. There are two types of sensors.

  • A virtual sensor that does not exist physically. However, it represents the status of some software or hardware operation such as processor/Dual Inline Memory Module (DIMM) functioning or host status.
    $IPMI_CMD sensor list

    or

    $IPMI_CMD sdr elist

    The following example shows the virtual sensor Host Status usage.

    During system run-time, the sensor status shows as S0/G0: WORKING, and when the system is in standby state or powered off state, the sensor status shows as S5/G2: SOFT-OFF.

    HOST STATUS      | 04H | OK  | 35.0 | S0/G0: WORKING
    HOST STATUS      | 04H | OK  | 35.0 | S5/G2: SOFT-OFF
  • A physical sensor on the motherboard that reads the status of hardware devices such as processor/DIMM temperatures and frequencies.

    CPU Temp         | 64h | ok  |  3.0 | 42 degrees C
    Membuf Temp 0    | 65h | ok  |  7.0 | 42 degrees C
    DIMM Temp 0      | 69h | ok  | 32.0 | 28 degrees C
    DIMM Temp 1      | 6Ah | ns  | 32.1 | No Reading

System thermal or power management

This feature is mainly used to monitor and control system power and thermal levels. BMC keeps monitoring certain temperatures (processor, DIMM, and so on) with the help of the OCC and sets the fan speed based on the current readings. You can use the power reading and capping functions to read and maintain the power level of the system. You can run the following commands to deal with platform power limits:

$IPMI_CMD dcmi power
power <command>
reading       Get power related readings from the system
get_limit     Get the configured power limits
set_limit     Set a power limit option
activate      Activate the set power limit
deactivate    Deactivate the set power limit
  • Run the following command to find the platform power readings:

    $IPMI_CMD dcmi power reading
    Instantaneous power reading:                   237 Watts
    Minimum during sampling period:                233 Watts
    Maximum during sampling period:                240 Watts
    Average power reading over sample period:      236 Watts
    IPMI timestamp:                                Mon Nov  7 13:20:22 2016
    Sampling period:                               00000010 Seconds.
    Power reading state is:                        activated
  • Run the following command to find the active power limit. The following output shows that the current power limit is 1000 watts.

    $IPMI_CMD dcmi power get_limit
    Current Limit State: Power Limit Active
    Exception actions:   Log Event to SEL
    Power Limit:         1000 Watts
    Correction time:     1000 milliseconds
    Sampling period:     10 seconds
  • Run the following command to set the active power limit:

    $IPMI_CMD dcmi power set_limit limit 1050
    Current Limit State: Power Limit Active
    Exception actions:   Log Event to SEL
    Power Limit:         1050 Watts
    Correction time:     1000 milliseconds
    Sampling period:     10 seconds
  • Run the following command to activate the power limit:

    $IPMI_CMD  dcmi power activate
    Power limit successfully activated
  • Run the following command to deactivate the power limit:

    $IPMI_CMD dcmi power deactivate
    Power limit successfully deactivated

System event log

The BMC is the master of system event log repository and maintains all firmware system event logs. All low-level events in the system firmware happen during system boot and runtime. Also, all the critical failures in the hardware and firmware are logged in the BMC System event log repository. 64 KB of system event log and extended system event log data can be stored.

$IPMI_CMD SEL LIST
1 | 11/07/2016 | 01:44:49 | TEMPERATURE #0X30 | UPPER CRITICAL GOING HIGH | ASSERTED
2 | 11/07/2016 | 01:45:08 | VOLTAGE #0X60 | LOWER CRITICAL GOING LOW  | ASSERTED
3 | 11/07/2016 | 01:45:25 | MEMORY #0X53 | CORRECTABLE ECC | ASSERTED

Boot progress

System boot progress can be tracked by seeing the SOL console where hostboot and OPAL emit their appropriate progress codes or by updating system firmware progress and operating system boot sensors to their respective boot states (that is, processor initialization, motherboard initialization, and PCI initialization).

Hostboot progress codes:

3.42145|Ignoring boot flags, incorrect version 0x0
3.68858|ISTEP  6. 3
4.13466|ISTEP  6. 4
4.13535|ISTEP  6. 5
15.27375|HWAS|PRESENT> DIMM[03]=AAAAAAAAAAAAAAAA
15.27375|HWAS|PRESENT> Membuf[04]=CCCC000000000000
15.27376|HWAS|PRESENT> Proc[05]=C000000000000000
28.57643|ISTEP  6. 6
28.66284|ISTEP  6. 7
28.66337|ISTEP  6. 8
28.69192|ISTEP  6. 9
31.32017|ISTEP  6.10
31.36741|ISTEP  6.11
33.17372|ISTEP  6.12
33.17531|ISTEP  6.13
33.17579|ISTEP  7. 1

OPAL or Skiboot progress codes:

[   44.095518490,5] OPAL skiboot-5.6.0-158-ga1e0a047b2a0 starting...
[   44.095526941,7] initial console log level: memory 7, driver 5
[   44.095530349,6] CPU: P8 generation processor (max 8 threads/core)
[   44.095533485,7] CPU: Boot CPU PIR is 0x0068 PVR is 0x004d0200
[   44.095536954,7] CPU: Initial max PIR set to 0x1fff
[   44.095993908,7] OPAL table: 0x300dc240 .. 0x300dc730, branch table: 0x30002000
[   44.095999625,7] Assigning physical memory map table for unused
[   44.096003854,7] FDT: Parsing fdt @0xff00000
[   44.099952132,6] CHIP: Initialised chip 0 from xscom@3fc0000000000
[   44.100047333,5] CHIP: Chip ID 0000 type: P8 DD2.0
[   44.100050694,7] XSCOM: Base address: 0x3fc0000000000
[   44.100059469,7] XSTOP: XSCOM addr = 0x2010c82, FIR bit = 31
[   44.100063231,6] MFSI 0:0: Initialized
[   44.100065694,6] MFSI 0:2: Initialized
[   44.100068188,6] MFSI 0:1: Initialized
[   44.100451213,5] LPC: LPC[000]: Initialized, access via XSCOM @0xb0020
[   44.100459497,7] LPC: Default bus on chip 0x0
[   44.100585382,6] MEM: parsing reserved memory from node /ibm,hostboot/reserved-memory
[   44.100602925,7] HOMER: Init chip 0

System inventory or vital product data (VPD)

System VPD is stored on the BMC in the IPMI FRU inventory. The BMC collects the FRU data of the hardware that is directly connected to the BMC [for example, backplane, power supply, and voltage regulator module (VRM)]. Hostboot updates the processor, centaur, and DIMM VPD. OPAL updates Peripheral Component Interconnect Express (PCIe) VPD. By running the following command, you can collect the complete system VPD including data that contains manufacturing information, product name, serial, and part numbers.
$IPMI_CMD fru print

The example FRU description for the processor is as follows:

FRU Device Description : CPU (ID 1)
Board Mfg Date         : Mon Jan  1 05:30:00 1996
Board Mfg              : IBM
Board Product          : PROCESSOR MODULE
Board Serial           : YA1932735603
Board Part Number      : 00UM003
Board Extra            : ECID:019A007301180718050A000000C031C2
Board Extra            : EC:20

SOL console

SOL is a mechanism that redirects the input and output of a serial port of the remote system over LAN IP. BMC provides the IPMI SOL console with the help of Ethernet and serial ports that are attached to it. You can see the boot progress and failure messages on the console screen. SOL console is the main interface between the overall system and the user. By running the following command, you can connect to the SOL console: 
$IPMI_CMD sol activate

Also, BMC has 32 KB of circular log buffer that is assigned for SOL console data, which you can get from the BMC busy box.

# cat /extlog/sollog/
/extlog/sollog/SOLHostCapture.log    /extlog/sollog/SOLHostCapture.log.1  /extlog/sollog/archive/
 
# cat /extlog/sollog/SOLHostCapture.log.1
 17.88935|ISTEP 11.12
 17.89009|ISTEP 11.13
 17.89083|ISTEP 12. 1
 17.98714|ISTEP 12. 2
 18.08120|ISTEP 12. 3
 18.11037|ISTEP 12. 4
 18.47909|ISTEP 12. 5
 18.48009|ISTEP 13. 1
 18.56525|ISTEP 13. 2
 18.64082|ISTEP 13. 3
 18.64194|ISTEP 13. 4
 18.67988|ISTEP 13. 5
 18.68156|ISTEP 13. 6
 19.57066|ISTEP 13. 7
 19.74316|ISTEP 13. 8
 19.89404|ISTEP 13. 9

When the system is at a checkstop (for example, when the processor is not able to complete any instructions for some time or it is in an impossible state) the corresponding console log data is archived for further debugging and analysis.

System time management

System time is maintained in the Real-Time Clock (RTC), which is controlled by the BMC. When the BMC boots the system, it sets its own time by reading the current Inter-Integrated Circuit (I2C) RTC time. The host (hostboot or OPAL) or the user can read or write the RTC time by running the following IPMI commands. BMC sets or obtains the current RTC time.

$IPMI_CMD sel time get
03/12/2017 09:32:12
$IPMI_CMD sel time set “03/12/2017 09:34:12”
03/12/2017 09:34:12

Boot failure management

OpenPOWER systems have two sides of the PNOR firmware: Primary side and golden side. BMC always boots the system from the primary side of the PNOR firmware. If the primary side boot fails twice due to system checkstop, watchdog conditions (conditions where the watchdog timer detects malfunctions of the operating system or server and recovers from them), or any other reason, BMC boots the system from the golden side of the PNOR firmware. For this process, BMC uses a boot count sensor, which is initially set to two. During the start of every boot operation, BMC decrements this sensor value by one. When the system reaches to the user-accessible level (that is, petitboot or when Linux boots), OPAL resets this sensor value back to two. Whenever the value of the boot count reaches zero due to boot failure, BMC starts booting the system from the golden side of the PNOR firmware.

During any boot failures, run the following command to know the value of boot count:

$IPMI_CMD sensor list | grep -i "boot count"
Boot Count | 0x0 | discrete | 0x0280| na | na | na | na | na | na

The BIOS golden side sensor has two discrete values (0x0080, 0x0180). The value of this sensor determines the side of the PNOR firmware boot.

The following example shows that the value of this sensor is set to 0x0180, which means that the system boots from the golden side of the PNOR firmware:

$IPMI_CMD sensor list | grep -i golden
BIOS Golden Side | 0x0 | discrete | 0x0180| na | na | na | na | na | na

The following example shows that the value of this sensor is set to 0x0080, which means that the system boots from the primary side of the PNOR firmware:

$IPMI_CMD sensor list | grep -i golden
BIOS Golden Side | 0x0 | discrete  | 0x0080 | na | na | na  | na  | na | na

Out-of-band firmware update

Usually, systems have general availability firmware installed. If the firmware gets corrupted or you want to upgrade the firmware to install bug fixes, you can select the out-of-band firmware update method. System firmware is a combination of the host firmware component (PNOR) and the BMC firmware component. It is a Hardware Platform Management (.hpm) file. To update the firmware code (xxxx.hpm) by using the out-of-band method, you need to complete the following steps:

  1. Power off the system by running the following command: 
    $IPMI_CMD chassis power off
  2. Issue a cold reset to BMC by running the following command:
    $IPMI_CMD mc reset cold

    Then wait until the BMC starts.

  3. Before you update the BMC network settings, back up the network settings by running the following command: 
    $IPMI_CMD raw 0x32 0xba 0x18 0x00
  4. Update the BMC and PNOR levels by the using the HPM upgrade option.
    $IPMI_CMD hpm upgrade <xxxx.hpm file> -z 30000 force

    Wait until the firmware upgrade is successful.

  5. Power on the system by running the following command: 
    $IPMI_CMD chassis power on

VUART-to-VGA rendering

Generally, most of the users want to see boot messages or any boot failures during system boot. To view early boot messages in a system boot, the VUART-to-VGA rendering feature is implemented in OpenPOWER systems. By using this feature, when you power the system on, you can see all the early boot messages in a local VGA console. The BMC renders the output of the host UART to the VGA display.

Figure 1. Sample remote VGA console output

Firmware settings

The boot loader (petitboot) has the following settings in the user interface:

  • Network settings
  • Turbo mode setting (enable/disable)
  • Boot device selection
  • Boot device order

All these features can also be controlled by the BMC. By using IPMI commands, you can enable or disable the turbo mode, select a boot device, and configure the host network.

The settings that are changed by using the IPMI commands take preference, and the settings that are changed at petitboot in nonvolatile random access memory (NVRAM) configuration are overridden. Also, system information provides complete firmware versions (BMC and PNOR versions, including the golden side version), and the BMC MAC address.

IPMI lock and unlock feature

When a system is deployed to a customer, unauthenticated in-band IPMI must not be able to access certain BMC configuration information and functions. The OpenPOWER original equipment manufacturer (OEM) IPMI Lock command can be run in an authenticated interface to lock certain IPMI commands. After BMC is in the IPMI lockdown mode, further unauthenticated in-band IPMI messages must satisfy the allowed commands, added in a list called white list that is matched by NetFn command specification. To revert the BMC to a fully permitted configuration, you can run the OEM IPMI Unlock command in an authenticated interface.

  • Lock IPMI interface command: You can run this command to lock the IPMI interface for safer executions. Only a predefined set of commands are allowed in this mode of operations. This is similar to the safe mode operations. 

    $IPMI_CMD raw 0x32 0xf3 0x4c 0x4f 0x43 0x4b 0x00; echo $?
     
    0
    # ipmitool chassis status
    Error sending Chassis Status command: Insufficient privilege level
     
    Get SEL time
    # ipmitool raw 0x0a 0x48; echo $?
     00 ae c0 57
    0

    From these examples, you can see that the Chassis Status command does not produce any output because the command is not listed in the white list. However, when you run the Get SEL Time command, output is displayed because the command is available in the white list. Commands that are listed in the white list can work when BMC is in the IPMI lockdown mode.

  • Unlock IPMI Interface command: By unlocking the IPMI interface, you can run all the commands again. 

    $IPMI_CMD raw 0x32 0xF4 0x55 0x4e 0x4c 0x4f 0x43 0x4b 0x00

IPMI PNOR reprovision

You can revert the modified system settings and modified configurations back to default settings. The OEM IPMI PNOR Reprovision command in OpenPOWER resets the system to the default settings. BMC clears any persistent data that is set by the user. Currently, in PNOR, the erasable partitions are GARD (hardware guard entries), NVRAM (boot loader configuration), hostboot attribute overrides (turbo mode non-default value to default), and FIRDATA.

The following procedure shows the PNOR re-provision process for an NVRAM partition:

  1. Update the NVRAM partition with test data by running the following command: 

    # nvram --print-config
    "common" Partition
    ---------------------
     
    # nvram --update-config test-name=test-value
    # nvram --print-config
    "common" Partition
    ---------------------
    test-name=test-value
  2. Run the PNOR reset/reprovision command. 

    # $IPMI_CMD raw 0x3A 0x1C; echo $?
     
    [392812400894,5] IPMI: PNOR access requested
  3. Run the following command to get the reprovisioning status. Wait for reprovision to complete. 00 indicates successful reprovision. 03 indicates that the re-provisioning is still in progress. 

    # $IPMI_CMD raw 0x3A 0x1D; echo $?
    03
    0
    # $IPMI_CMD raw 0x3A 0x1D; echo $?
    03
    0
    [163479624724,5] IPMI: PNOR access released
                     
    # $IPMI_CMD raw 0x3A 0x1D; echo $?
    00
    0
  4. Read NVRAM data after reboot by running the following command:

    # nvram --print-config
    "common" Partition
    ---------------------
    test-name=test-value
    # reboot
                                     
    # nvram  --print-config

NVRAM data is erased after a PNOR reset or reprovision operation.

The IPMI raw command data might change between different OpenPOWER BMC vendors. However, the functionality remains the same. All the examples mentioned in this article mainly refer to American Megatrends BMC vendor-based OpenPOWER systems.

References


'IBM PowerLinux' 카테고리의 다른 글

H/W check and status check  (0) 2018.07.23
Amber off  (0) 2018.07.05
Scale-out LC System Event Log Collection Tool  (0) 2018.06.19
RHEL7: How to get started with CPU governor  (0) 2018.03.20
리눅스에서 LVM 구성 및 사용방법  (0) 2018.03.06


To check host hardware using ipmitool as an alternative to dsa, as root run the following commands:


ipmitool sdr (status on envir, fans, cpu's, etc)

ipmitool fru (fru's for memory/system bd, etc) 

ipmitool sel elist (errors in event log)



-----------------------------------------------


ipmitool sel save sellistsave.txt


ipmitool sel elist

ipmitool sel list

ipmitool sel get <entry>

ipmitool sel save <filename>


http://fibrevillage.com/storage/279-hot-add-remove-rescan-of-scsi-devices-on-linux



Finding informations about SCSI devices

The first problem when working with SCSI devices might be to map informations you got from /proc/scsi/scsi to the device names the kernel uses like /dev/sda and so on.

Or you can use lsscsi utlity. Here's an example:

# lsscsi
[0:0:0:0]    disk    ATA      SEAGATE ST31000N SU0E  /dev/sda
[0:0:1:0]    disk    ATA      SEAGATE ST31000N SU0E  /dev/sdb
...
[1:0:1:0]    disk    ATA      SEAGATE ST31000N SU0E  /dev/sdj
[1:0:2:0]    disk    ATA      SEAGATE ST31000N SU0E  /dev/sdk
[1:0:3:0]    disk    ATA      HITACHI H7210CA3 A3CB  /dev/sdl
[1:0:4:0]    disk    ATA      HITACHI HUA7210S AC5A  /dev/sdm
...
[5:0:7:0]    disk    ATA      SEAGATE ST31000N SU0D  /dev/sdav
[6:0:0:0]    mediumx IBM      TS3500           0104  /dev/sch0
[6:0:1:0]    tape    IBM      ULT3580-TD5      0104  /dev/st0
[6:0:2:0]    tape    IBM      ULT3580-TD5      0104  /dev/st1

You can find same info by checking /proc/scsi/scsi

# cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: ATA      Model: SEAGATE ST31000N Rev: SU0E
  Type:   Direct-Access                    ANSI  SCSI revision: 05
Host: scsi0 Channel: 00 Id: 01 Lun: 00
  Vendor: ATA      Model: SEAGATE ST31000N Rev: SU0E
  Type:   Direct-Access                    ANSI  SCSI revision: 05
Host: scsi0 Channel: 00 Id: 02 Lun: 00
  Vendor: ATA      Model: SEAGATE ST31000N Rev: SU0E
  Type:   Direct-Access                    ANSI  SCSI revision: 05
...

In the example above

Host: scsi0 Channel: 00 Id: 01 Lun: 00 
is the same device of [0:0:0:0] in the output of lsscsi

Where the output

          h == hostadapter id (first one being 0)
          c == SCSI channel on hostadapter (first one being 0)
          t == ID
          l == LUN (first one being 0)

Rescan of a SCSI bus

Surely reboot a server will let the scsi device get rescanned. But this is not the prefered way. The easiest way is to rescan the whole SCSI bus which will enable the Linux kernel to detect new devices!

To issue a SCSI bus rescan you must know on which bus you've added the device. If you don't know which bus and if there are mutliple buses on the system you can rescan each bus which will be somehow annoying but will not interrupt the system. 
To initiate a SCSI bus rescan type

echo "- - -" > /sys/class/scsi_host/host<H>/scan

where H stands for the SCSI bus you want to scan.

# lsscsi
...
[1:0:0:7]    disk    IBM      1814      FAStT  1060  /dev/sdb
[1:0:0:8]    disk    IBM      1814      FAStT  1060  /dev/sdc
[1:0:0:10]   disk    IBM      1814      FAStT  1060  /dev/sde
# echo "- - -" > /sys/class/scsi_host/host1/scan
# lsscsi
...
[1:0:0:7]    disk    IBM      1814      FAStT  1060  /dev/sdb
[1:0:0:8]    disk    IBM      1814      FAStT  1060  /dev/sdc
[1:0:0:9]    disk    IBM      1814      FAStT  1060  /dev/sdd
[1:0:0:10]   disk    IBM      1814      FAStT  1060  /dev/sde

Well done, we got /dev/sdd back.

By the way this does not only work for disks but also for SCSI CD/DVD devices.

You can still use the old way, to get sdd back

echo "scsi add-single-device 1 0 0 9" > /proc/scsi/scsi

For more devices, you have to repeat the same for all devices

Deletion of a SCSI Device

There might be the situation where you must remove a SCSI device from the system.

Easy by using

    echo 1 > /sys/class/scsi_device/h:c:t:l/device/delete
    or
    echo 1 > /sys/block/<dev>/device/delete
    where <dev> is like sda or sdb etc..

Here's an example:

# echo 1 > /sys/block/sdau/device/delete 
# lsscsi | grep sdau
#

Now you see the device sdau is gone.

In old way, this is what you would like to do

echo "scsi remove-single-device h c t l" > /proc/scsi/scsi

Add a SCSI Device back

Surely this can be done just rescan the SCSI bus that the disk seats inuse wildcard like below

    echo "- - -" > /sys/class/scsi_host/host<h>/scan

You can also do this if you know the device SCSI location h:c:t:l

    echo "c t l" >  /sys/class/scsi_host/host<h>/scan

Old way

    echo "scsi add-single-device a b c d" > /proc/scsi/scsi

Rescan of a SCSI Device

The problem of a SCSI bus rescan is, that it will only detect new devices. Can a existing or missing device be rescanned?

Sure, here is it

echo 1 > /sys/block/sdau/device/rescan 
or
echo 1 > /sys/class/scsi_device/h:c:t:l/device/rescan

 In SAN environment, there is a easier way to manage SAN scsi devices, see Sysfs fibre channel tools


'IBM PowerLinux > REDHAT' 카테고리의 다른 글

RHV RHVM 관련  (0) 2018.08.07
Redhat Nouveau 내장그래픽카드 nvidia 드라이버 설치 삭제  (0) 2018.07.03
CentOS 7 bonding nmcli  (0) 2017.11.01
gnome login screen id  (0) 2016.08.11
Linux semaphore  (0) 2016.07.11

 

ipmitool sel clear

 

 

 

 

 

 

How to disable the Nouveau driver and install the Nvidia driver in RHEL 7

 

 

 

 

 

How to uninstall proprietary "Nvidia" module and switch back to Red Hat shipped "Nouveau" module ?

 

 

 

 

 

 

How to remove Nvidia drivers and switch back to nouveau for Red Hat Enterprise Linux 7?

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

'IBM PowerLinux > REDHAT' 카테고리의 다른 글

RHV RHVM 관련  (0) 2018.08.07
Hot add, remove, rescan of SCSI devices on Linux  (0) 2018.07.09
CentOS 7 bonding nmcli  (0) 2017.11.01
gnome login screen id  (0) 2016.08.11
Linux semaphore  (0) 2016.07.11


https://www-304.ibm.com/support/customercare/sas/f/lopdiags/scaleOutLCdebugtool.html



Scale-out LC Service and Support

[ Last updated: 01 June 2018 ]

Start

If a Linux partition is up and running then the standard sosreport should be collected in addition to running the plc.pl data collection script.

The sosreport needs to be run by root user, the script will prompt for additional information and when complete will show the location of the output file.

To collect the data from the BMC, the plc.pl script file (contained in the plc.zip package below) should be used by the customer to collect additional data.

Installation

For MT 8348-21C, 8335-GCA, 8335-GTA, and 8335-GTB systems:
plc.zip

For MT 8001-12C, 8001-22C, 8005-12N, 8005-22N, 7063-CR1, 9006-22P, 9006-22C, and 5104-22C systems:
plc.zip

Prerequisites

Installation steps

Usage

usage: plc.pl { -b bmc_address | -i } [-a admin_pw] [-s sysadmin_pw] [-h host -u user -p password] [-f]

Flags:

-b BMC hostname or IP address
-a BMC ADMIN password if changed from default (admin)
-s BMC sysadmin password if changed from default (superuser)
-i Interactive mode
-f Collect BMC firmware image
-h Linux host address: Only on POWER8 Systems
-u Linux host user ID: Only on POWER8 Systems
-p Linux host password: Only on POWER8 Systems

Errors

Reference Information

This section is intended as additional reference information.

Installing Requisite Packages

Note: The linux server that is going to be used for running data collection script can be running any version of Linux on any type of server. It is not related to the Scale-out LC server or the version of Linux running on the Scale-out LC server.

We would expect the administrator to be familiar with installing packages and files on their Linux environment.

Managing software
Taskapt (deb) Debian, Ubuntuzypp (rpm) openSUSEyum/dnf (rpm) Fedora, CentOSurpmi (rpm) Mandriva, Mageia
Install new software from package repositoryapt-get install pkgzypper install pkgyum install pkgurpmi pkg
Install new software from package filedpkg -i pkgzypper install pkgyum localinstall pkgurpmi pkg
Update existing softwareapt-get install pkgzypper update -t package pkgyum update pkgurpmi pkg
Remove unwanted softwareapt-get remove pkgzypper remove pkgyum erase pkgurpmi pkg

IBM OpenBMC tool

The IBM OpenBMC tool is used to interact with the new OpenBMC on the 8335-GTG, 8335-GTC, 8335-GTW, 8335-GTH, and 8335-GTX products.

Pre-requisites:

For RHEL distributions:
openbmctool-1.0-4.noarch.rpm

For other operating systems:
openbmctool.zip

Note: For Windows OS support, version 1.04 or greater of the tool is needed.

RHEL


Other operating systems

To install, complete the following:

Execution

Scale-out LC system VPD update tool

The Scale-out LC system VPD update tool is used to make VPD modifications to POWER Systems from the host OS of the machine.

For Ubuntu distributions: 
ophtk-lht_20160128-1.ub14.04_ppc64el.deb

For RHEL distributions:
ophtk-lht-20160128-1.el7.ppc64le.rpm

Petitboot Plugin:

Ubuntu

RHEL


Petitboot Plugin:

Note: /path/to needs to be substituted with the actual path to the petitboot plugin. For example, pb-plugin install /var/petitboot/mnt/dev/sda/vpdupdate-1.3.pb-plugin

To install the plugin from a network location from the petitboot shell:
pb-plugin install http://mystorage.com/path/to/vpdupdate-1.3.pb-plugin

Execution

SNMP Trap enablement

For MT 8348-21C, 8335-GCA, 8335-GTA, and 8335-GTB systems:

For MT 8001-12C, 8001-22C, 8005-12N, 8005-22N, and 7063-CR1 systems:


'IBM PowerLinux' 카테고리의 다른 글

H/W check and status check  (0) 2018.07.23
Amber off  (0) 2018.07.05
RHEL7: How to get started with CPU governor  (0) 2018.03.20
리눅스에서 LVM 구성 및 사용방법  (0) 2018.03.06
LVM home삭제후 root 증설  (0) 2018.02.14

 

https://www.certdepot.net/rhel7-get-started-cpu-governor/

 

RHEL7: How to get started with CPU governor.

 

 

 

 

Presentation of CPU Governor

The modern x86 processors provide two mechanisms to reduce power consumption when idle. Useful for a portable PC, it can also help for physical servers with limited workload.

However, don’t think about virtual machines, they are not concerned.

CPU Idle States

In the x86 architecture several CPU states, called C-states, have been defined, allowing systems to save power by decreasing CPU functionalities. These C-states are broadly similar across processors but the exacts details may vary.

  • C0: The processor is working as usual.
  • C1: The processor doesn’t execute any instruction but can start working again without any delay.
  • C2: The processor is stopped but keeps the complete state of its registers and caches. A delay is necessary for the processor to start working again.
  • C3: The processor is sleeping and doesn’t keep its caches. A longer delay than in C2 state is needed for the processor to start working again.

CPU Freq

CPU Freq or CPU speed scalling is a way to reduce power consumption by adjusting the clock speed of the processor.
Five CPU Freq governors are available in RHEL 7:

  • performance: with this static governor you get the highest possible clock frequency but without any power saving benefit. It is best suited for heavy workload when the CPU is almost never idle.
  • powersave: here your CPU gets the lowest possible clock frequency but at the cost of the lowest CPU performance. One serious drawback of this static governor happens when the system experiences unexpected high loads: in this case it can consume more power than other governors with higher clock frequencies. For this reason, it is not recommended to use it except when overheating is a problem.
  • ondemand: this dynamic governor sets the maximum clock frequency when system load is high and minimum clock frequency when idle, but without intermediate state. This allows the system to adjust power consumption according to system load but at the expense of latency. In case switches between idle and heavy workloads happen too often, performance and power saving can suffer. Otherwise, it is one of the best options.
  • userspace: with this governor, any process running as root can set the clock frequency.
  • conservative: this dynamic governor is very similar to the ondemand governor except it adjusts clock frequency more gradually. Instead of choosing between maximum and minimum clock frequencies, it selects the clock frequency according to usage. This more granular approach provides significant power saving but at the expense of an ever greater latency than the ondemand governor.

Installation Procedure

Install the kernel-tools package to get access to the cpupower command:

# yum install -y kernel-tools

Note: The kernel-tools package and the cpupower command are not strictly needed to manipulate CPU governors. They only provide a convenient interface. All operations can be done using the /sys/devices/system/cpu/ path and the echo command.

Basic Operations

To get the list of the various idle states supported by the CPU number 0 (available idle states are given for various types of servers), type:

# cpupower idle-info
CPUidle driver: intel_idle
CPUidle governor: menu
analyzing CPU 0:
...
Available idle states: POLL C1E-ATM C2-ATM C4-ATM C6-ATM (Atom CPU N2800)
Available idle states: POLL C1-IVB C1E-IVB C3-IVB C6-IVB (Xeon CPU E3-1245 V2)
Available idle states: POLL C1-NHM C1E-NHM C3-NHM C6-NHM (Core i5 CPU M 430)
Available idle states: POLL C1-HSW C1E-HSW C3-HSW C6-HSW C7s-HSW C8-HSW C9-HSW C10-HSW (Celeron 2961Y)
...

To get the same information for all the CPUs on a server, type:

# cpupower -c all idle-info

Note: The -c option can be replaced with –cpu.

To get the list of the available governors for the CPU number 0, type:

# cpupower frequency-info -g
analyzing CPU 0:
  available cpufreq governors: conservative userspace powersave ondemand performance

Note: The -g option can be replaced with –governors.

To get all the details about the available CPU frequencies for the CPU number 0, type:

# cpupower frequency-info
analyzing CPU 0:
 driver: acpi-cpufreq
 CPUs which run at the same hardware frequency: 0
 CPUs which need to have their frequency coordinated by software: 0
 maximum transition latency: 10.0 us
 hardware limits: 1.20 GHz - 2.27 GHz
 available frequency steps: 2.27 GHz, 2.27 GHz, 2.13 GHz, 2.00 GHz, 1.87 GHz, 1.73 GHz, 1.60 GHz, 1.47 GHz, 1.33 GHz, 1.20 GHz
 available cpufreq governors: conservative userspace powersave ondemand performance
 current policy: frequency should be within 1.20 GHz and 2.27 GHz.
                 The governor "conservative" may decide which speed to use
                 within this range.
 current CPU frequency: 1.20 GHz (asserted by call to hardware)
 boost state support:
 Supported: yes
 Active: yes
 1900 MHz max turbo 2 active cores
 1900 MHz max turbo 1 active cores

Note1: Without the -c option, only the information about the CPU number 0 is displayed.
Note2: The governor conservative is the current configuration.

To change the governor to performance for all the CPUs, type:

cpupower frequency-set -g performance
Setting cpu: 0
Setting cpu: 1
Setting cpu: 2
Setting cpu: 3

Note1: Without the -c option, all the CPUs are affected.
Note2: To only change for the CPUs number 0, 1 and 2, type: # cpupower -c 0-2 frequency-set -g performance
Note3: The -g option can be replaced with –governor.

# cpupower -c all frequency-info
...
 current policy: frequency should be within 1.20 GHz and 2.27 GHz.
                 The governor "performance" may decide which speed to use
                 within this range.
...

To specify the governor userspace for the CPU number 1 with a CPU frequency of 1.2GHz, type:

# cpupower -c 1 frequency-set -f 1.2
Setting cpu: 1
# cpupower -c 1 frequency-info -p
analyzing CPU 1:
  current policy: frequency should be within 1.20 GHz and 2.27 GHz.
                  The governor "userspace" may decide which speed to use
                  within this range.
# cpupower -c 1 frequency-info -f
analyzing CPU 1:
  current CPU frequency: 1199000 (asserted by call to kernel)
# cpupower -c 1 frequency-info --hwlimits
analyzing CPU 1:
  hardware limits: 1.20 GHz - 2.27 GHz

Note: Only the governor userspace allows frequencies to be set.

Standard Operations

All commands seen previously don’t persist after reboot. The standard way to set up CPU governor in a persistent way is through the tuned daemon and the governor directive (alternatively, using rc.local only works if the tuned service is disabled).

If we look at the throughput-performance tuned profile (/usr/lib/tuned/throughput-performance/tuned.conf), we can see:

...
[cpu]
governor=performance
energy_perf_bias=performance
min_perf_pct=100
...

Note: The energy_perf_bias directive allows software on supported Intel processors to more actively contribute to determining the balance between optimum performance and saving power.

Therefore, if you want to define a specific configuration, create a new tuned profile with the tuned inheritance mechanism in the /etc/tuned directory (see the tuned tutorial):

[main]
include=throughput­-performance

[cpu]
...

Behaviour Analysis

To get a better understanding of the way your system behaves, install the powertop package:

# yum install -y powertop

Then, run the powertop command:

# powertop
PowerTOP 2.3      Overview   Idle stats   Frequency stats   Device stats   Tunables            

Summary: 528.4 wakeups/second,  0.0 GPU ops/seconds, 0.0 VFS ops/sec and 4.1% CPU use

                Usage       Events/s    Category       Description
              2.2 ms/s     177.5        Interrupt      PS/2 Touchpad / Keyboard / Mouse
            445.2 us/s      44.4        Timer          tick_sched_timer
              3.4 ms/s      39.2        Interrupt      [27] nvkm
            318.1 us/s      29.2        Timer          hrtimer_wakeup
            137.7 us/s      19.4        Process        [rcu_sched]
...

By pressing the tab key, you get access to different kinds of information (more details are available in the powertop manual):

  • the Overview tab displays a general state of the system.
  • the Idle stats tab presents the CPUs and GPUs currently loaded in the system in relationship with their C-states.
  • the Frequency stats tab shows the P-states of a system in relationship with the idle state.
  • the Device stats tab presents the list of devices in the system that consume the most power.
  • the Tunables tab lists the devices that are present on the system. You can tune the system to be power friendly by toggling each item from bad to good.

Source: RHEL 7 Power Management Guide.

'IBM PowerLinux' 카테고리의 다른 글

Amber off  (0) 2018.07.05
Scale-out LC System Event Log Collection Tool  (0) 2018.06.19
리눅스에서 LVM 구성 및 사용방법  (0) 2018.03.06
LVM home삭제후 root 증설  (0) 2018.02.14
Linux samba 설정  (0) 2017.08.04

 

 

출처 : https://support.hpe.com/hpsc/doc/public/display?docId=emr_na-c01847647

 

 

기술 작업 지침

리눅스에서 LVM 구성하는 방법

LVM 은 Logical Volume Manager 의 약자로서, 저장장치들을 좀더 효율적이고 유연하게 관리할 수 있는 커널의 부분과 프로그램을 말합니다. 처음에는 IBM에서 개발되었는데, 그 후에 OSF(현재는 OpenGroup http://www.opengroup.org)에서 차용을 하여 OSF/1 operating system 에서 쓰였습니다. 지금은 HP-UX, Digital Unix operating system, AIX 등의 상용 유닉스에서 쓰고 있습니다. 리눅스 버전은 현재 HP-UX의 것을 모델로 하여 Sistina Software사 (http://www.sistina.com)에서 open source로 개발하고 있습니다. LVM 을 이해하려면 먼저 Software RAID (Redundant Array of Inexpensive Drives)를 언급해야 하는데, 이 둘은 비슷하면서도 큰 차이가 있습니다. 비슷한 점은 여러 물리적인 디스크들을 하나의 논리적인 디스크처럼 다룰 수 있게 함으로서 조합방법에 따라 고용량, 고속, 데이터의 무결성을 실현하는 점입니다. 하지만 분명하게 다른 점이 있는데. lvm은 raid보다 관리 및 확장이 비교적 쉬운 반면, raid에는 lvm에는 없는 disk mirroring (RAID level 1), Parity Stripe (RAID level 4,5) 등의 방식이 있어서 속도 또는 데이터의 무결성을 보장 받을 수 있습니다. 그러나 이런 차이점에도 불구하고 lvm가 주목을 받는 이유는 다음과 같습니다.

  • 쉬운 관리
  • 서로 다른 많은 디바이스 조합 지원
  • 직관적인 저장 장치로의 접근
  • 뛰어난 확장성
  • 믿을만한 안전성과 효율
  • 스냅샷 기능 지원
이와 같은 특징들로 인해 사용자들이 얻는 이득은 많습니다.

VG(Volume Group)은 LVM의 가장 기본적인 요소입니다. 쉽게 말하자면 가상 디스크라고 할 수 있는데, 하나 이상의 실제 물리적으로 존재하는 블록 디바이스가 모여서 VG를 이루게 됩니다.

그 물리적인 블록 디바이스를 PV(Physical Volume)라고 하는데, 거의 대부분의 장치를 PV로 쓸 수 있습니다. 하드디스크 및 그 파티션, 소프트웨어/하드웨어 RAID 장치, 심지어 Loopback 블록 디바이스(파일 시스템상의 파일을 블록 디바이스처럼 쓸 수 있게 해준다) 도 포함합니다.

PV와 대비되는 것이 LV(Logical Volume)입니다. 이것은 가상 파티션이라고도 할 수 있는데, VG를 적당히 나누어 할당한 것이 LV입니다. 사용자는 LV를 일반 디스크나 파티션처럼 쓰면 됩니다. 정리하자면, 하나 이상의 PV가 모여 VG를 이루고, VG를 가상적으로 나누어 할당하면 LV이 됩니다.

  1. PV(Physical Volume) 초기화 작업

    # fdisk /dev/hda

    Command (m for help): t

    Partition number (1-6): 2

    Hex code (type L to list codes): 8e

    Changed system type of partition 2 to 8e (Linux LVM)

    Command (m for help): w



    # fdisk /dev/hdb

    Command (m for help): t

    Partition number (1-6): 2

    Hex code (type L to list codes): 8e

    Changed system type of partition 2 to 8e (Linux LVM)

    Command (m for help): w



  2. PV(Phydical Volume) 생성

    # pvcreate /dev/hda2

    pvcreate -- physical volume “/dev/hda2”

    successfully created



    # pvcreate /dev/hdb2

    pvcreate -- physical volume “/dev/hdb2”

    successfully created



  3. VG(Volume Group) 생성

    # vgcreate -s 16m new_vg /dev/hda /dev/hdb

    위의 명령은 두 개의 스크를 합쳐서 new_vg라는 VG를 만든다는 것이다.

    옵션 ‘-s 16m’은 PE(Physical Extent)의 크기를 16MB로 정하는 것인데, 만약 옵션 ‘-s’가 생략되면 기본적으로 PE의 크기는 4MB가 된다. VG가 만들어지면 /dev/VolumeGroupName라는 형식으로 디렉토리가 생기게 된다.

    위의 예에서는 /dev/new_vg 가 될 것이다.



  4. VG(Volume Group)명 변경 또는 삭제방법

    1. 변경방법

      # vgrename new_vg vg00

    2. 삭제방법

      VG에 LV가 남아있지 않고 비활성화되어 있으면 vgremove로 지울 수 있습니다. 비활성화 시키는 방법은, # vgchange -a n vg00 이고, 다음의 명령으로 지워집니다.

      # vgremove vg00



  5. VG(Volume Group) 확장방법

    VG의 확장과 축소는 PV의 추가, 제거로 이루어집니다.

    VG에 PV를 추가하는 명령은 vgextend인데, vg00이라는 VG에 PV인 /dev/hda2를 추가하려면 다음과 같이 실행해야 합니다.

    # vgextend vg00 /dev/hda2



  6. VG(Volume Group) 축소방법

    PV를 VG에서 제거하는 명령은 vgreduce입니다. 그러나 PV에 PE가 할당되어 있으면 제거되지 않습니다. 그 할당된 PE를 다른 PV로 옮겨야 제거될 것입다. 빈 PV인 /dev/hda2를 vg00에서 제거하려면,

    # vgreduce vg00 /dev/hda2



  7. LV(Logical Volume) 생성

    VG에 LV를 만들면 /dev/VolumeGroupName/LogicalVolumeName의 형식으로 블록 디바이스가 만들어집니다. 이것은 일반 블록 디바이스와 다를 바 없는 용도로 쓸 수 있습니다. LV 를 만드는 명령은 lvcreate인데 일반적인 예는 다음과 같습니다.

    # lvcreate -L 4g -n data vg00

    위의 명령은 4GB 크기로 vg00이라는 VG에 data라는 새로운 LV를 만드는 것입니다. 옵션 ‘-L’은 LV의 크기를 지정하는 것인데, 숫자 뒤의 접미사에 따라 숫자의 단위가 달라집니다. k는 KB, m은 MB, g는 GB, t는 TB를 뜻합니다. 만약, 접미사가 안 붙어있으면 숫자의 단위는 MB가 됩니다. ‘-L’ 대신 ‘-l’를 쓸 수도 있는데, ‘-l’ 뒤에는 LE의 갯수를 쓰면 됩니다.



  8. LV(Logical Volume)명 변경 및 삭제방법
    1. 변경방법

      # lvrename /dev/vg00/data /dev/vg00/db

    2. 삭제방법

      # lvremove /dev/vg00/db



  9. LV(Logical Volume) 확장방법

    # lvextend -L +2g /dev/vg00/db

    위의 명령은 /dev/vg00/db의 크기를 2GB 만큼 늘립니다. 기존의 크기가 4GB 였다면, 옵션 ‘-L 6g’를 줬어도 같은 결과를 보일 것입니다. 역시 여기에서도 옵션 ‘-l’를 쓰면 LE 단위로 늘릴 수 있습니다.



    다음은 일반적인 ext2 의 확장 절차입니다.

    • # umount /var/lib/mysql
    • # lvextend -L +10g /dev/databases/mysql
    • # resize2fs /dev/databases/mysql
    • # mount /dev/databases/mysql /var/lib/mysql
    NOTE: reiserfs : reiserfs는 resize_reiserfs 라는 명령으로 크기를 바꿀 수 있습니다.

    마운트된 상태에서도 크기를 늘릴 수 있는데, 그 예는 다음과 같습니다.

    # lvextend -L +5g /dev/devel/cvs

    # resize_reiserfs -f /dev/devel/cvs

    언마운트해서 늘리려면 다음 같이 합니다.

    # umount /var/cvs

    # lvextend -L +5g /dev/devel/cvs

    # resize_reiserfs -f /dev/devel/cvs

    # mount /dev/devel/cvs /var/cvs



  10. LV(Logical Volume) 축소방법
    • ext2 : e2fsadm 을 쓰는 것이 간단합니다.

      # umount /home

      # lvreduce -L -2g /dev/vg00/home 또는

      # lvresize -L -2g /dev/vg00/home

      # mount /dev/vg00/home /home

    • reiserfs : 크기를 늘릴 때와는 달리 마운트 된 상태에서는 줄일 수 없습니다

      # umount /usr

      # resize_reiserfs -s -1g /dev/vg00/usr

      # lvreduce -L -1g /dev/vg00/usr

      # mount /dev/vg00/usr /usr



  11. LVM 설정의 Backup 방법

    먼저 설정 백업 파일의 내용을 보려면 다음과 같이 합니다.

    # vgcfgrestore -f /etc/lvm/backup/vg00 -ll vg00



    이 파일을 이용해 설정을 복구하려면 다음과 같이 합니다.

    # vgchange -a n vg00

    # vgcfgrestore -f /etc/lvm/backup/vg00 vg00

    # vgchange -a y vg00



  12. 두개의 ide disk를 하나의 striped mapping LV로 묶는 방법

    80GB 짜리(실제는 약 76.1GB) IDE 하드디스크 두 개를 striped mapping LV 로 묶는 과정입니다. 먼저 블록 디바이스 이름이 /dev/hde, /dev/hdf 인 디스크들을 PV로 만듭니다.

    # pvcreate /dev/hde /dev/hdf



    이렇게 만든 PV들을 합쳐서 VG를 만듭니다.

    # vgcreate vg00 /dev/hde /dev/hdf



    이제 VG에 LV를 만듭니다.

    # lvcreate -i 2 -I 4 -L 152g -n striped_lv vg00

    위의 명령으로 152GB 짜리 striped mapping LV가 만들어진 것입니다. 옵션을 설명하면 ‘-i 2’는 두 개의 PV를 striped 하는데 쓰고, ‘-I 4’는 PE를 4KB로 쪼개서 PV들에게 저장한다는 것입니다. ‘-I’ 옵션에는 2n (n은 0과 7사이의 숫자), 즉 1, 2, 4, 8, 16, 32, 64, 128 의 숫자를 쓸 수 있습니다



    파일 시스템을 만들고, 마운트를 해서,

    # mkreiserfs /dev/vg00/striped_lv 또는

    # mke2fs –j /dev/vg00/striped_lv

    # mount /dev/vg00/striped_lv /mnt

  13. 새로운 디스크로 PV 교체방법

    환경은 /dev/hdd, /dev/sda, /dev/sdb가 vg01에 속해있는데, 그중에서 /dev/hdd를 빼고 /dev/sdc를 더하는 과정입니다.

    먼저 /dev/sdc 를 PV 로 만들고,

    # pvcreate /dev/sdc



    /dev/sdc를 vg01에 추가한 후에,

    # vgextend vg01 /dev/sdc



    /dev/hdd의 PE 들을 /dev/sdc로 옮깁니다.

    # pvmove /dev/hdd /dev/sdc



    성공적으로 옮겨졌으면 vg01에서 /dev/hdd를 제거합니다.

    # vgreduce vg01 /dev/hdd

  14. snapshot LV를 만들어서 안전한 백업방법

    데이터의 변동이 많은 /var등의 디렉토리는 백업 도중에 데이터가 엉키는 수가 있습니다. 그것을 방지하기 위해서, snapshot LV를 만들어 데이터를 고정시킨 후 백업을 하면 됩니다. 일단 snapshot LV 를 만듭니다.(한 줄로)

    # lvcreate -s -L 5g -n mysqlbackup /dev/vg01/mysql

    위의 명령은 /dev/vg01/mysql에 대한 snapshot LV인 /dev/vg01/mysqlbackup를 만듭니다. 옵션 ‘-s’는 만들어질 LV가 snapshot 형식임을 정해주고 있습니다. 옵션 ‘-L’ 는 LV 의 최대 크기를 정해줍니다. 대개 원본 LV와 크기를 같게 하는 것이 좋습니다. 사실 snapshot LV는 원본이 갱신되는 부분만 고정시키려고 데이터를 가져와 LE에 할당하기 때문에 많은 LE가 필요하지 않습니다.



    이제 만든 LV 를 마운트 시킨 후

    # mount /dev/vg01/mysqlbackup /mnt



    백업을 하면 된다.

    # tar cf /dev/rmt0 /mnt



    백업을 마쳤으면 언마운트시킨 후에 snapshot LV 을 지웁니다.

    # umount /mnt

    # lvremove /dev/vg01/mysqlbackup

LVM관련 디스크가 변경되었을 경우

# vgscan –v –mknodes 를 실행하면

vgscan scans all SCSI, (E)IDE disks, multiple devices and a bunch of other disk devices in the system looking for LVM physical volumes and volume groups. Define a filter in lvm.conf(8) to restrict the scan to avoid a CD ROM, for example.

In LVM2, vgscans take place automatically; but you might still need to run one explicitly after changing hardware.

See lvm for common options

--mknodes

Also checks the LVM special files in /dev that are needed for active logical volumes and creates any missing ones and removes unused ones.

'IBM PowerLinux' 카테고리의 다른 글

Scale-out LC System Event Log Collection Tool  (0) 2018.06.19
RHEL7: How to get started with CPU governor  (0) 2018.03.20
LVM home삭제후 root 증설  (0) 2018.02.14
Linux samba 설정  (0) 2017.08.04
Linux Network SPEED test iperf  (0) 2017.07.09

+ Recent posts