How to create RAW LV with zero byte offset in AIX

Posted on 2011-04-27
Last Modified: 2013-11-17
How can i create RAW LV with zero byte offset in AIX 5.3
Question by:assistunix
    LVL 68

    Accepted Solution

    Hi again,

    to be able to do this the VG where the LV is to be created in must be of "Big VG" format.

    Once such a VG is present you can use the flag "-T O" of "mklv" to indicate that the logical volume control block will not occupy the first block of the logical volume, to make the space available for application data.

    You can't use smitty for this, and you can't change an existing LV to zero offset format.

    To change an existing VG to BIG format use the "-B" flag of "chvg".

    Please note that there must be enough free partitions available on each physical volume for the VGDA expansion for this operation to be successful!

    If you need further assistance with mklv or chvg please let me know!


    Author Comment

    Hello wmp.

    Can normal regular rootvg be converted into bigvg ?

    Also, can a normal regular vg that is active and operating right now with plenty of lv's in it, including some raw lv's be converted to big vg on the go, without any issues or outage to the lv's in that vg?

    what would happen if i use the following on normal regular vg, will the zero offset setting still take affect?
    mklv -t raw -y myraw -T O appvg 8


    Author Comment

    This is the vg in question. and it already has plenty of raw lv's in it.

    # lsvg appvg
    VOLUME GROUP:       appvg                VG IDENTIFIER:  00cc7d0100004c000000012658097387
    VG STATE:           active                   PP SIZE:        128 megabyte(s)
    VG PERMISSION:      read/write               TOTAL PPs:      4956 (634368 megabytes)
    MAX LVs:            256                      FREE PPs:       3778 (483584 megabytes)
    LVs:                50                       USED PPs:       1178 (150784 megabytes)
    OPEN LVs:           28                       QUORUM:         8 (Enabled)
    TOTAL PVs:          14                       VG DESCRIPTORS: 14
    STALE PVs:          0                        STALE PPs:      0
    ACTIVE PVs:         14                       AUTO ON:        yes
    MAX PPs per VG:     32768                    MAX PVs:        1024
    LTG size (Dynamic): 256 kilobyte(s)          AUTO SYNC:      no
    HOT SPARE:          no                       BB POLICY:      relocatable

    This is one of the raw lv's from that vg

    LOGICAL VOLUME:     rawlv          VOLUME GROUP:   appvg
    LV IDENTIFIER:      00cc7d0100004c000000012658097387.43 PERMISSION:     read/write
    VG STATE:           active/complete        LV STATE:       closed/syncd
    TYPE:               raw                    WRITE VERIFY:   off
    MAX LPs:            512                    PP SIZE:        128 megabyte(s)
    COPIES:             1                      SCHED POLICY:   parallel
    LPs:                64                     PPs:            64
    STALE PPs:          0                      BB POLICY:      relocatable
    INTER-POLICY:       minimum                RELOCATABLE:    yes
    INTRA-POLICY:       middle                 UPPER BOUND:    1024
    MOUNT POINT:        N/A                    LABEL:          None
    Serialize IO ?:     NO

    The device subtype is DS_LVZ for that rawlv, which means T O flags were used when creating this LV and the from the output above of lsvg appvg, it seems like the appvg is normal regular vg.

    LVL 68

    Assisted Solution

    1) Yes, you can convert rootvg.

    2) Yes,  chvg -B can (No: must be!) run on a VG that is varied on and active.

    3) The command will succeed, but the LVCB will be created in the first 512 byte block nevertheless!
    LVL 68

    Assisted Solution

    No. appvg is a big VG.

    MAX PVs:        1024
    LVL 68

    Assisted Solution

    OK, sorry, what I forgot to say for rootvg:

    Your rootvg will most probably contain an active paging device, and chvg -B is not supported for VGs with such devices.


    Author Comment

    Ok great thank you. I did not know that MAX PVs: 1024 meant Big VG. I was looking for the word BIG VG somewhere in the lsvg output.

    So similarly for scalable vg, there would be a MAX PV number that i would have to look for, to determine if it's Scalable VG? Do you know that MAX PV number?

    Although i don't have to convert VG to BIG VG in this case, but if i were to convert it than,
    would i have to unmount all fs and close all raw devices before running chvg -B command?
    Also, i only have one vg in my test server, which is rootvg, can i deactivate remove paging space from rootvg in order to perform chvg -B command, or would removing one and only paging space from the system cause system issues?
    LVL 68

    Assisted Solution

    1) -T O is only supported on BIG VGs, not on old VGs and not on scalable VGs!

    2) Scalable VGs have

    MAX PPs per VG:     32768 (default) up to 2097152
    MAX LVs:                 512 (default) up to 4096
    MAX PVs:                                       up to 1024

    3) You can leave everything as is, no umounts or the like.

    4) You cannot deactivate the only paging space. AIX will not allow this, and if it did the system would crash.
    LVL 68

    Expert Comment

    OK, it's late here, so I again forgot an important thing on scalable VGs:

    -T O is not needed for LVs in scalable VGs, because these volume groups never use the first block of the logical volume to store the logical volume control block!

    I think I'll go to bed now, before I start writing even more nonsense!

    Good night!

    LVL 61

    Expert Comment

    There is no danger rewriting first 4k of created PV
    System can get information that volume is RAW or DB from odm.
    BUT it is still better to offset one page on raw volumes.
    Take care to make backups from oracle

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
    About FreeBSD Jails In FreeBSD, jails are a way of doing operating system level virtualization.  The basis of FreeBSD jails is chroot (, which changes the root directory of processes.  As a…
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Video by: Phil
    This video goes over how to configure and start a jail in FreeBSD.  This video is meant to supplement the article included with this course.

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now