Logical Volume Manager – LVM Configuration,pvcreate,vgdisplay,vgscan,lvcreate

What is  Logical Volume Manager ?

HP-UX LVM is used to manage disk space with special features like mirroring, high availability, stripping, etc. Physical volumes can be organized into a logical volume groups with equal size extent.

Each volume group can have one or more physical volumes. A system can have more than single volume groups. A volume group can be moved from a system to another instead of physical disk.

A volume group can be divided into virtual disks, called logical volumes. A logical volume can span a number of physical volumes or represent only a portion of one physical volume. Disks can be added into logical volumes with different sizes.

The following commands are used to create, display and manipulate the LVM:

1. pvcreate

Creates physical volume to use in logical volume group.

Syntax:  pvcreate -f /dev/rdsk/c2tod1

2. pvdisplay

Displays information about physical volumes in LVM volume group.

Syntax:  pvdisplay /dev/dsk/c2tod1

3. pvmove

Move allocated physical extents frm one LVM physcal volume to another.

Syntax:  pvmove /dev/dsk/c1t0d0 PVG0

4. vgcreate

Creates LVM volume group.

Syntax:  Create a directory for volume group. 

mkdir /dev/vg00 

vgcreate -s 2 /dev/vg00 /dev/dsk/c1t0d0

5. vgdisplay

Display information about LVM volume groups.

Syntax:  vgdisplay -v /dev/vg00

6. vgexport

Export an LVM volume group and its associated logical volumes.

Syntax:  vgexport -v -f vg00.outfile /dev/vg00

7. vgimport

Import an LVM volume group onto the system.

Syntax: vgimport -v /dev/vg00 /dev/dsk/c0t1d0

8. vgextend

Extend an LVM volume group by adding physical volumes.

Syntax:  vgextend /dev/vg00 /dev/dsk/c0t1d0

9. vgreduce

Remove physical volumes from an LVM volume group.

Syntax:  vgreduce /dev/vg00 /dev/dsk/c0t1d0

10. vgremove

Remove LVM logical volume group from system.

Syntax:  vgremove /dev/vg00 /dev/dsk/c0t1d0

11. vgscan

Scans physcal volumes for LVM volume group.

Syntax: vgscan

12. lvcreate

Creates logical volume in LVM volume group.

Syntax: 

lvcreate -L 100 /dev/vg03

13.  lvdisplay

Displays information about logical volumes .

lvdisplay /dev/vg00

14. lvextend

Increase space,mirrors for logical volumes.

lvextend -L 400 /dev/vg03

15.  lvreduce

Reduce number of physical extents, mirrors.

lvreduce -L 50 /dev/vg03

16. lvremove

Remove one or more logical volumes from system.

lvremove -f /dev/vg03

17. lvlnboot

Prepare LVM logical volume to be root, boot, primary swap, or dump volume.

lvlnboot -r /dev/vg00

18. lvrmboot

Remove logical volume link to root, primary swap, or dump volume.

lvrmboot -r /dev/vg00

Regards,
R.Gopinath

Tell a friend

HP-UX vPartition Guide – Creating vPartitions, Configuration of vpars, vpar Management

Introduction to vPartitions

vPars Is a Virtual Partitions product that enables you to run multiple instances of HP-UX simultaneously on one hard partition by dividing that hard partition further into virtual partitions.

Each virtual partition is assigned its own subset of hardware, runs a separate instance of HP-UX, and hosts its own set of applications. Because each instance of HP-UX is isolated from all other instances, vPars provides applicationand Operating System (OS) fault isolation.

Each instance of HP-UX can have different patches and a different kernel .

 

vPar-Representation

vPar-Representation

 

Key Terms of vPar

 

Complex:

A complex is the entire partitionable server, including both cabinets, all cells, I/O chassis, cables, and power and utility components.

Cabinet

A cabinet is the Superdome hardware “box”, which contains the cells, Guardian Service Processor (GSP), internal I/O chassis, I/O fans, cabinet fans, and power supplies. A complex has up to two cabinets.

Hard partition

A hard partition is any isolated hardware environment, such as an nPartition within a Superdome complex or an entire rp7400/N4000 server.

npartition

An nPartition is a subset of a complex that divides the complex into groups of cell boards where each group operates independently of other groups. An nPartition can run a single instance of HP-UX or be further divided into virtual partitions.

Virtual partition

A virtual partition is a software partition of a hard partition that contains an instance of

HP-UX. Though a hard partition can contain multiple virtual partitions, a virtual partition cannot span a hard partition boundary.

vPars Monitor and Database

vPars 

For each hard partition, the vPars Monitor manages the assignment of hardware resources to virtual partitions, boots virtual partitions and their kernels, and emulates certain firmware calls. By emulating these specific calls, vPars creates the illusion to each HP-UX instance that it is running on a standalone server, consisting of the hardware that has been assigned to it.

Once a virtual partition is launched, the Monitor transfers ownership of the hardware to the virtual partition. At that point the Monitor is not involved in accessing I/O hardware, physical memory, or process to processor cycles: the individual HP-UX instances have complete ownership of their respective hardware resources. This allows each partition to run at full speed.

vPars Partition Database

At the heart of the vPars Monitor is the partition database. The partition database contains partition configuration information. Using the partition database, the Monitor tracks which virtual partitions exist and what hardware resources and partition attributes are associated with each partition.

When the Monitor boots , it reads a copy of the partition database from a file on the same disk from which the Monitor /stand/vpmon is booted. The default file is /stand/vpdb. Then, the Monitor creates a master copy of the vPars partition database in the memory reserved by the Monitor.

The operating system of each virtual partition also keeps a local copy of the partition database in a file, by default /stand/vpdb, on its local boot disk

 Boot Sequence

This section describes the boot differences in a vPars system relative to a non-vPars system.

Boot Sequence: Quick Reference

On a server without vPars, a simplified boot sequence is:

 

 

 

vPar-boot-sequence

vPar-boot-sequence

 

 

Adding vPars adds the Monitor layer, so now hpux (for Integrity, hpux.efi) loads the Monitor.

Then the Monitor boots the kernels of the virtual partitions. The boot sequence becomes

 

 

 

vPar-boot

vPar-boot

 

 

Tell a friend

HP-UX nPartition Guide – Creating nPartitions, Configuration of npars, npar Management

Introduction to nPartitions

Cell-based HP servers enable you to configure a single server complex as one large system or as multiple smaller systems by configuring nPartition

  • Each nPartition defines a subset of server hardware resources to be used as an independent system environment. An nPartition includes one or more cells assigned to it (with processors and memory) and all I/O chassis connected to those cells.

  • All processors, memory, and I/O in an nPartition are used exclusively by software running in the nPartition.

  • Each nPartition has its own system boot interface, and each nPartition boots and reboots independently.

  • nPartitions can be reconfigured for a server without physically modifying the serverhardware configuration by using the HP software-based nPartition management tools.

HP-UX-nPartition

HP-UX-nPartition

Operating Systems Supported on nPartitions

Here is the list of operating systems that can run on nPartitions.

HP-UX 11i v1 (B.11.11)

HP-UX 11i v2 (B.11.23)

HP-UX 11i v3 (B.11.31)

HP OpenVMS I64 8.2-1 and 8.3

Microsoft® Windows® Server 2003

Red Hat Enterprise Linux

SuSE Linux Enterprise Server 9

SuSE Linux Enterprise Server 10

Administration Tools for nPartitions

The main administration tools for nPartitions are

  1. Partition Manager – which provides a graphical interface.

  2. The nPartition Commands – which provide a command-line interface.

Partition Manager

Tool location of Partition Manager (/opt/parmgr/bin/parmgr)

Partition Manager provides a graphical interface for configuring, modifying, and managing nPartitions and hardware within a server complex.

The following tools can perform nPartition administration tasks:

Service Processor (MP or GSP) Menus

Service processor menus provide a service interface for the entire complex. It allows access to all hardware and nPartitions defined within the complex.

EFI Boot Manager and EFI Shell Commands

On cell-based HP Integrity servers, the Extensible Firmware Interface (EFI) supports nPartition management. The EFI is accessible from an nPartition console when the nPartition is in an active state but has not booted an operating system.

BCH Menu Commands

On cell-based PA-RISC servers, the Boot Console Handler (BCH) interface supports management from an nPartition console when the nPartition is in an active state but has not booted an operating system.

nPartition Commands

Command

Description

parcreate

Create a new nPartition; root or IPMI LAN access is required.

parmodify

Modify an existing nPartition; root or IPMI LAN access is required.

parremove

Remove an existing nPartition; root or IPMI LAN access is required.

parstatus

Display nPartition information and hardware details for a server complex.

parunlock

Unlock Complex Profile data (use this command with caution); root or IPMI LAN access is required.

fruled

Blink the attention indicators (LEDs) or turn them off. This command can control these indicators for cells, I/O chassis, and cabinet numbers.

frupower

Display status or turn power on or off for cells and I/O chassis; root or IPMI LAN access is required.

cplxmodify

Only distributed with the Enhanced nPartition Commands.

Modify server complex attributes. Supports changing the name of a complex; root or IPMI

LAN access is required

Table:  nPartion Commands Description

nPartition Properties

This section describes the nPartition properties when work with performing nPartition administration tasks.

The following nPartitions details are covered here:

Partition Numbers

Each nPartition has its own unique partition number that the nPartition administration tools use for identifying the nPartition.

Assigned and Unassigned Cells

Each cell in a server complex either is assigned to one of the nPartitions in the complex, or it is unassigned and thus is not used by any of the nPartitions. If an I/O chassis is attached to an unassigned cell, then the chassis likewise is not assigned to an nPartition.

Base Cells

On both HP 9000 servers and HP Integrity servers, all cells within an nPartition are base cells. The nPartitions administration tools automatically set the cell type to base cell, if you do not specify the cell type

Core Cells

 One cell in each nPartition must serve as the active core cell. The core cell controls the nPartition until an operating system has booted, and it provides console services and other boot and management abilities for the nPartition.

The monarch processor on the core cell runs the Boot Console Handler (BCH) or Extensible Firmware Interface (EFI) code while all other processors are idle until an operating system is booted.

Active and Inactive Cells

Cells that are assigned to an nPartition and have booted to form an nPartition are active cells whose resources (processors, memory, and any attached I/O) can be actively used by software running in the nPartition.

Cells that are inactive either are not assigned to an nPartition, or they have not participated in partition rendezvous to form an nPartition with any other cells assigned to the nPartition.

Creating and Configuring nPartitions

Creating a New Partition

parcreate -c — command to create a new nPartition with the cells.

For example, with the Original nPartition Commands, the following command creates a

one-cell nPartition:

# parcreate -c4:base:y:ri -c6:base:y:ri

Partition Created. The partition number is : 1

#

When parcreate successfully creates a new nPartition, it reports “Partition Created” and reports the nPartition number (“partition number is…”).

If parcreate detects any problems or issues when creating an nPartition, it lists them in its output. If it cannot create the nPartition, parcreate reports “Command failed” along with more details.

Removing (Deleting) an nPartition

Deleting an nPartition causes all cells (and any I/O resources connected to the cells) that were assigned to the nPartition to be unassigned. As a result, all of these cells become available resources which can be assigned to any nPartition in the server complex.

When removing an active nPartition, you must complete the procedure by performing a shutdown for reconfig (the HP-UX shutdown -R -H command or Windows shutdown /s command) as soon as possible after initiating the nPartition removal.

1. Issue the parremove -p# command to remove the inactive remote nPartition

(-p# where # is the nPartition number).

For example:

#parremove -p1

2. Issue the parstatus -P command to confirm that the nPartition was removed.

If the nPartition was removed, it no longer is listed in the parstatus command output.

Renaming an nPartition

Use the parmodify -p# -P name command to set the nPartition name for any of the nPartitions in the server complex.

Specify both the nPartition number (-p#, where # is the nPartition number) and the new

name for the nPartition (-P name).

If the nPartition name contains spaces then quotation marks must surround the name.

# parmodify -p1 -P “New Name”

Command succeeded.

#

Booting and Resetting nPartitions

Types of Booting and Resetting for nPartitions

 HP cell-based servers provide two special types of reboot and reset for managing nPartitions: performing a reboot for reconfig, and performing a shutdown for reconfig.

Regards,
R.Gopinath

Tell a friend

RAID Concepts and Configuration – RAID 0, RAID 1, RAID 5

RAID  – Redundant Array Of Independent Disks

The basic idea behind RAID is to combine multiple small, inexpensive disk drives into an array to accomplish performance or redundancy goals not attainable with one large and expensive drive. This array of drives will appear to the computer as a single logical storage unit or drive.

Concept of RAID

Concept of RAID

The current RAID drivers in Linux supports the following levels:

Linear mode 

 a)  Two or more disks are combined into one physical device. The disks are “appended” to each other, so writing linearly to the RAID device will fill up disk 0 first, then disk 1 and so on.

 b) The disks does not have to be of the same size. In fact, size doesn’t matter at all here :)
 There is no redundancy in this level. If one disk crashes you will most probably lose all your data. You can however be lucky to recover some data, since the filesystem will just be missing one large consecutive chunk of data.

c) The read and write performance will not increase for single reads/writes. But if several users use the device, you may be lucky that one user effectively is using the first disk, and the other user is accessing files which happen to reside on the second disk. If that happens, you will see a performance gain.

Linear Mode RAID Configuration

Ok, so you have two or more partitions which are not necessarily the same size (but of course can be), which you want to append to each other.

Set up the /etc/raidtab file to describe your setup. I set up a raidtab for two disks in linear mode, and the file looked like this:

raiddev /dev/md0
        raid-level      linear
        nr-raid-disks   2
        chunk-size      32
        persistent-superblock 1
        device          /dev/sdb6
        raid-disk       0
        device          /dev/sdc5
        raid-disk       1
Spare-disks are not supported here. If a disk dies, the array dies with it. There’s no information to put on a spare disk.

You’re probably wondering why we specify a chunk-size here when linear mode just appends the disks into one large array with no parallelism. Well, you’re completely right, it’s odd. Just put in some chunk size and don’t worry about this any more.

Ok, let’s create the array. Run the command
  mkraid /dev/md0

This will initialize your array, write the persistent superblocks, and start the array.

If you are using mdadm, a single command like
   mdadm –create –verbose /dev/md0 –level=linear –raid-devices=2 /dev/sdb6 /dev/sdc5
should create the array. The parameters talk for themselves. The output might look like this
  mdadm: chunk size defaults to 64K
  mdadm: array /dev/md0 started.

Have a look in /proc/mdstat. You should see that the array is running.

Now, you can create a filesystem, just like you would on any other device, mount it, include it in your /etc/fstab and so on.

RAID-0 (RAID zero)

a) Also called “stripe” mode. The devices should (but need not) have the same size. Operations on the array will be split on the devices; for example, a large write could be split up as 4 kB to disk 0, 4 kB to disk 1, 4 kB to disk 2, then 4 kB to disk 0 again, and so on. If one device is much larger than the other devices, that extra space is still utilized in the RAID device, but you will be accessing this larger disk alone, during writes in the high end of your RAID device. This of course hurts performance.

b)  Like linear, there is no redundancy in this level either. Unlike linear mode, you will not be able to rescue any data if a drive fails. If you remove a drive from a RAID-0 set, the RAID device will not just miss one consecutive block of data, it will be filled with small holes all over the device. e2fsck or other filesystem recovery tools will probably not be able to recover much from such a device.

c)  The read and write performance will increase, because reads and writes are done in parallel on the devices. This is usually the main reason for running RAID-0. If the busses to the disks are fast enough, you can get very close to N*P MB/sec.

RAID 0 Configuration

You have two or more devices, of approximately the same size, and you want to combine their storage capacity and also combine their performance by accessing them in parallel.

Set up the /etc/raidtab file to describe your configuration. An example raidtab looks like:
raiddev /dev/md0
        raid-level      0
        nr-raid-disks   2
        persistent-superblock 1
        chunk-size     4
        device          /dev/sdb6
        raid-disk       0
        device          /dev/sdc5
        raid-disk       1
Like in Linear mode, spare disks are not supported here either. RAID-0 has no redundancy, so when a disk dies, the array goes with it.

Again, you just run
  mkraid /dev/md0
to initialize the array. This should initialize the superblocks and start the raid device. Have a look in /proc/mdstat to see what’s going on. You should see that your device is now running.

/dev/md0 is now ready to be formatted, mounted, used and abused.

RAID – 1

a)  This is the first mode which actually has redundancy. RAID-1 can be used on two or more disks with zero or more spare-disks. This mode maintains an exact mirror of the information on one disk on the other disk(s). Of Course, the disks must be of equal size. If one disk is larger than another, your RAID device will be the size of the smallest disk.

b)  If up to N-1 disks are removed (or crashes), all data are still intact. If there are spare disks available, and if the system (eg. SCSI drivers or IDE chipset etc.) survived the crash, reconstruction of the mirror will immediately begin on one of the spare disks, after detection of the drive fault.

c)  Write performance is often worse than on a single device, because identical copies of the data written must be sent to every disk in the array. With large RAID-1 arrays this can be a real problem, as you may saturate the PCI bus with these extra copies.
This is in fact one of the very few places where Hardware RAID solutions can have an edge over Software solutions – if you use a hardware RAID card, the extra write copies of the data will not have to go over the PCI bus, since it is the RAID controller that will generate the extra copy.
Read performance is good, especially if you have multiple readers or seek-intensive workloads.
The RAID code employs a rather good read-balancing algorithm, that will simply let the disk whose heads are closest to the wanted disk position perform the read operation.
Since seek operations are relatively expensive on modern disks (a seek time of 6 ms equals a read of 123 kB at 20 MB/sec), picking the disk that will have the shortest seek time does actually give a noticeable performance improvement.

Configuration of RAID 1

Configuration of RAID 1

RAID 1 Configuration

You have two devices of approximately same size, and you want the two to be mirrors of each other. Eventually you have more devices, which you want to keep as stand-by spare-disks, that will automatically become a part of the mirror if one of the active devices break.

Set up the /etc/raidtab file like this:
raiddev /dev/md0
        raid-level      1
        nr-raid-disks   2
        nr-spare-disks  0
        persistent-superblock 1
        device          /dev/sdb6
        raid-disk       0
        device          /dev/sdc5
        raid-disk       1
If you have spare disks, you can add them to the end of the device specification like
        device          /dev/sdd5
        spare-disk      0
Remember to set the nr-spare-disks entry correspondingly.

Ok, now we’re all set to start initializing the RAID. The mirror must be constructed, eg. the contents (however unimportant now, since the device is still not formatted) of the two devices must be synchronized.

Issue the
  mkraid /dev/md0
command to begin the mirror initialization.

Check out the /proc/mdstat file. It should tell you that the /dev/md0 device has been started, that the mirror is being reconstructed, and an ETA of the completion of the reconstruction.

Reconstruction is done using idle I/O bandwidth. So, your system should still be fairly responsive, although your disk LEDs should be glowing nicely.

The reconstruction process is transparent, so you can actually use the device even though the mirror is currently under reconstruction.

Try formatting the device, while the reconstruction is running. It will work. Also you can mount it and use it while reconstruction is running. Of Course, if the wrong disk breaks while the reconstruction is running, you’re out of luck.

RAID-4

a)  This RAID level is not used very often. It can be used on three or more disks. Instead of completely mirroring the information, it keeps parity information on one drive, and writes data to the other disks in a RAID-0 like way. Because one disk is reserved for parity information, the size of the array will be (N-1)*S, where S is the size of the smallest drive in the array. As in RAID-1, the disks should either be of equal size, or you will just have to accept that the S in the (N-1)*S formula above will be the size of the smallest drive in the array.

b)  If one drive fails, the parity information can be used to reconstruct all data. If two drives fail, all data is lost.

c)  The reason this level is not more frequently used, is because the parity information is kept on one drive. This information must be updated every time one of the other disks are written to. Thus, the parity disk will become a bottleneck, if it is not a lot faster than the other disks. However, if you just happen to have a lot of slow disks and a very fast one, this RAID level can be very useful.

RAID 4 Configuration

You have three or more devices of roughly the same size, one device is significantly faster than the other devices, and you want to combine them all into one larger device, still maintaining some redundancy information. Eventually you have a number of devices you wish to use as spare-disks.

Set up the /etc/raidtab file like this:
raiddev /dev/md0
        raid-level      4
        nr-raid-disks   4
        nr-spare-disks  0
        persistent-superblock 1
        chunk-size      32
        device          /dev/sdb1
        raid-disk       0
        device          /dev/sdc1
        raid-disk       1
        device          /dev/sdd1
        raid-disk       2
        device          /dev/sde1
        raid-disk       3
If we had any spare disks, they would be inserted in a similar way, following the raid-disk specifications;
        device         /dev/sdf1
        spare-disk     0
as usual.

Your array can be initialized with the
   mkraid /dev/md0
command as usual.

You should see the section on special options for mke2fs before formatting the device.

RAID-5

a)  This is perhaps the most useful RAID mode when one wishes to combine a larger number of physical disks, and still maintain some redundancy. RAID-5 can be used on three or more disks, with zero or more spare-disks. The resulting RAID-5 device size will be (N-1)*S, just like RAID-4. The big difference between RAID-5 and -4 is, that the parity information is distributed evenly among the participating drives, avoiding the bottleneck problem in RAID-4.

b)  If one of the disks fail, all data are still intact, thanks to the parity information. If spare disks are available, reconstruction will begin immediately after the device failure. If two disks fail simultaneously, all data are lost. RAID-5 can survive one disk failure, but not two or more.

c)  Both read and write performance usually increase, but can be hard to predict how much. Reads are similar to RAID-0 reads, writes can be either rather expensive (requiring read-in prior to write, in order to be able to calculate the correct parity information), or similar to RAID-1 writes. The write efficiency depends heavily on the amount of memory in the machine, and the usage pattern of the array. Heavily scattered writes are bound to be more expensive.

RAID 5 Disks

RAID 5 Disks

RAID 5 Configuration

You have three or more devices of roughly the same size, you want to combine them into a larger device, but still to maintain a degree of redundancy for data safety. Eventually you have a number of devices to use as spare-disks, that will not take part in the array before another device fails.

If you use N devices where the smallest has size S, the size of the entire array will be (N-1)*S. This “missing” space is used for parity (redundancy) information. Thus, if any disk fails, all data stay intact. But if two disks fail, all data is lost.

Set up the /etc/raidtab file like this:
raiddev /dev/md0
        raid-level      5
        nr-raid-disks   7
        nr-spare-disks  0
        persistent-superblock 1
        parity-algorithm        left-symmetric
        chunk-size      32
        device          /dev/sda3
        raid-disk       0
        device          /dev/sdb1
        raid-disk       1
        device          /dev/sdc1
        raid-disk       2
        device          /dev/sdd1
        raid-disk       3
        device          /dev/sde1
        raid-disk       4
        device          /dev/sdf1
        raid-disk       5
        device          /dev/sdg1
        raid-disk       6
If we had any spare disks, they would be inserted in a similar way, following the raid-disk specifications;
        device         /dev/sdh1
        spare-disk     0
And so on.

A chunk size of 32 kB is a good default for many general purpose filesystems of this size. The array on which the above raidtab is used, is a 7 times 6 GB = 36 GB (remember the (n-1)*s = (7-1)*6 = 36) device. It holds an ext2 filesystem with a 4 kB block size. You could go higher with both array chunk-size and filesystem block-size if your filesystem is either much larger, or just holds very large files.

Ok, enough talking. You set up the /etc/raidtab, so let’s see if it works. Run the
  mkraid /dev/md0
command, and see what happens. Hopefully your disks start working like mad, as they begin the reconstruction of your array. Have a look in /proc/mdstat to see what’s going on.

If the device was successfully created, the reconstruction process has now begun. Your array is not consistent until this reconstruction phase has completed. However, the array is fully functional (except for the handling of device failures of course), and you can format it and use it even while it is reconstructing.

See the section on special options for mke2fs before formatting the array.

Ok, now when you have your RAID device running, you can always stop it or re-start it using the
  raidstop /dev/md0
or
  raidstart /dev/md0
commands.

With mdadm you can stop the device using
  mdadm -S /dev/md0
and re-start it with
  mdadm -R /dev/md0
Instead of putting these into init-files and rebooting a zillion times to make that work, read on, and get autodetection running.

Source: tldp.org

Tell a friend