Creating AIX LV VG and JFS2 issues?


 
Thread Tools Search this Thread
Operating Systems AIX Creating AIX LV VG and JFS2 issues?
# 1  
Old 11-20-2014
Hammer & Screwdriver Creating AIX LV VG and JFS2 issues?

Can someone please help me understand what it is I am doing incorrectly?

I have 22 PVs (disks) assigned to a VG, the stats on the disks:

Code:
# lspv hdisk1
PHYSICAL VOLUME:    hdisk1                   VOLUME GROUP:     vg_usr1
PV IDENTIFIER:      0000150179158027 VG IDENTIFIER     000015010000d60000000149c                                                                                                                               f0a568a
PV STATE:           active
STALE PARTITIONS:   0                        ALLOCATABLE:      yes
PP SIZE:            128 megabyte(s)          LOGICAL VOLUMES:  1
TOTAL PPs:          546 (69888 megabytes)    VG DESCRIPTORS:   1
FREE PPs:           0 (0 megabytes)          HOT SPARE:        no
USED PPs:           546 (69888 megabytes)    MAX REQUEST:      256 kilobytes
FREE DISTRIBUTION:  00..00..00..00..00
USED DISTRIBUTION:  110..109..109..109..109
MIRROR POOL:        None

I have a VG created..

Code:
# lsvg vg_usr1
VOLUME GROUP:       vg_usr1                  VG IDENTIFIER:  000015010000d60000000149cf0a568a
VG STATE:           active                   PP SIZE:        128 megabyte(s)
VG PERMISSION:      read/write               TOTAL PPs:      12012 (1537536 megabytes)
MAX LVs:            256                      FREE PPs:       2 (256 megabytes)
LVs:                1                        USED PPs:       12010 (1537280 megabytes)
OPEN LVs:           0                        QUORUM:         12 (Enabled)
TOTAL PVs:          22                       VG DESCRIPTORS: 22
STALE PVs:          0                        STALE PPs:      0
ACTIVE PVs:         22                       AUTO ON:        yes
MAX PPs per VG:     32512
MAX PPs per PV:     1016                     MAX PVs:        32
LTG size (Dynamic): 256 kilobyte(s)          AUTO SYNC:      no
HOT SPARE:          no                       BB POLICY:      relocatable
PV RESTRICTION:     none                     INFINITE RETRY: no
DISK BLOCK SIZE:    512

I have a LV created..

Code:
# lslv lv_usr1
LOGICAL VOLUME:     lv_usr1                VOLUME GROUP:   vg_usr1
LV IDENTIFIER:      000015010000d60000000149cf0a568a.1 PERMISSION:     read/write
VG STATE:           active/complete        LV STATE:       closed/syncd
TYPE:               jfs2                   WRITE VERIFY:   off
MAX LPs:            32512                  PP SIZE:        128 megabyte(s)
COPIES:             2                      SCHED POLICY:   parallel
LPs:                6005                   PPs:            12010
STALE PPs:          0                      BB POLICY:      relocatable
INTER-POLICY:       minimum                RELOCATABLE:    yes
INTRA-POLICY:       middle                 UPPER BOUND:    32
MOUNT POINT:        N/A                    LABEL:          usr1
MIRROR WRITE CONSISTENCY: on/ACTIVE
EACH LP COPY ON A SEPARATE PV ?: yes
Serialize IO ?:     NO
INFINITE RETRY:     no

I created a mirrored LV (Copies: 2), so next I want to create the JFS2 FS..

Code:
  Volume group name                                   vg_usr1
  SIZE of file system
          Unit Size                                   Megabytes
*         Number of units                            [768000]
* MOUNT POINT                                        [/usr1]
  Mount AUTOMATICALLY at system restart?              yes
  PERMISSIONS                                         read/write
  Mount OPTIONS                                      []
  Block Size (bytes)                                  4096
  Logical Volume for Log
  Inline Log size (MBytes)                           []
  Extended Attribute Format
  ENABLE Quota Management?                            no
  Enable EFS?                                         no
  Allow internal snapshots?                           no
  Mount GROUP                                        []

The error I get is..

Code:
Command: failed        stdout: yes           stderr: no
Before command completion, additional instructions may appear below.
0516-404 allocp: This system cannot fulfill the allocation request.
        There are not enough free partitions or not enough physical volumes
        to keep strictness and satisfy allocation requests.  The command
        should be retried with different allocation characteristics.
0516-822 mklv: Unable to create logical volume.
crfs: 0506-972 Cannot create logical volume for file system.
rmlv: Logical volume loglv00 is removed.

I have no idea what I am doing wrong? I am trying to maximize my usage of PP/LPs, so basically use it all up and assign the largest possible FS on the JFS2.

When creating the JFS2 FS, its asking for the Number of Units so if my LV has 6005 LPs, and my PP size is 128, 6005x128 .. 768640MB.. to leave a bit of breathing room I tried to set it to 768000 but the above error happens.

What am i doing wrong.. really would like to understand how to do this correctly starting from the PPs up to creating the JFS2.

Thank you for your help.
# 2  
Old 11-21-2014
I suppose you fell for a very simple thing, but at one point this happened perhaps to all of us. As fas as i can tell from your posted output you are using SMIT to create the LVs and FSes.

In the respective SMIT dialogue there are two entries:

Code:
                                      Enhanced Journaled File Systems

Move cursor to desired item and press Enter.

  Add an Enhanced Journaled File System
  Add an Enhanced Journaled File System on a Previously Defined Logical Volume

Note that you need to use the second option when you have defined the LV already. Otherwise a new one will be created before a FS is created on it. This is perhaps where your error comes from.

I hope this helps.

bakunin
# 3  
Old 11-21-2014
Oh wow, that worked. thank you Smilie

So just so I understand..

The process I took was to first verify my PVs were not assigned anywhere, then I took note of the PV's PP Size and Total PPs.

Next I proceeded to create the VG, in there I specified the PVs I want to use and give it a name, next I create the Logical Volume from the VG, here I can specify copies, max LPs and Number of LPs.

If my PV has 546 Total PPs (128MB per PP), then when I create the LV I can assume that LP has a 1:1 relation to PP on the disk? So (example) if I assign 10 PVs (disks) and I want to use maximum space, 10 (PVs) x 546 = 5460. When creating my LV my Number of LPs would be 5460, if I set to "2 copies" this would be half (2730)?

So that takes care of the LV (basically a partition in MSWIN world?), now we need to give it a filesystem, when using SMITTY and adding an enhanced JFS and we select the 2nd option (previously defined logical volume) it is by default consuming all space on the defined LV?

My initial approach (original post) when I was going to the first option, was creating a enhanced JFS, it would of attempted to create a new LV? Thus this is why I was running into those errors?

As a note, I did find this interesting..

Code:
# lsvg vg_usr1
VOLUME GROUP:       vg_usr1                  VG IDENTIFIER:  000015010000d60000000149d31c8e44
VG STATE:           active                   PP SIZE:        128 megabyte(s)
VG PERMISSION:      read/write               TOTAL PPs:      13104 (1677312 megabytes)
MAX LVs:            256                      FREE PPs:       13104 (1677312 megabytes)
LVs:                0                        USED PPs:       0 (0 megabytes)
OPEN LVs:           0                        QUORUM:         13 (Enabled)
TOTAL PVs:          24                       VG DESCRIPTORS: 24
STALE PVs:          0                        STALE PPs:      0
ACTIVE PVs:         24                       AUTO ON:        yes
MAX PPs per VG:     32512
MAX PPs per PV:     1016                     MAX PVs:        32
LTG size (Dynamic): 256 kilobyte(s)          AUTO SYNC:      no
HOT SPARE:          no                       BB POLICY:      relocatable
PV RESTRICTION:     none                     INFINITE RETRY: no
DISK BLOCK SIZE:    512

As we see I have 13104 Free PPs in my VG, when I attempt to create my LV I get an error.

Code:
# /usr/sbin/mklv -y'lv_usr1' -t'jfs2' -c'2' -L'usr1' -x'32512' vg_usr1 6552
0516-032 lcreatelv: Illegal physical partition number.
0516-822 mklv: Unable to create logical volume.

2 Copies, 6552 LPs (which totals to 13104 LPs available in the vg_usr1).

So why the error? It Seemed to work when i set the LPs to 6000, however now I have 1103 free PPs that I was hoping to allocate to the same jfs2 fs/mount.

Code:
VOLUME GROUP:       vg_usr1                  VG IDENTIFIER:  000015010000d60000000149d3251b14
VG STATE:           active                   PP SIZE:        128 megabyte(s)
VG PERMISSION:      read/write               TOTAL PPs:      13104 (1677312 megabytes)
MAX LVs:            256                      FREE PPs:       1103 (141184 megabytes)
LVs:                2                        USED PPs:       12001 (1536128 megabytes)
OPEN LVs:           2                        QUORUM:         13 (Enabled)
TOTAL PVs:          24                       VG DESCRIPTORS: 24
STALE PVs:          0                        STALE PPs:      0
ACTIVE PVs:         24                       AUTO ON:        yes
MAX PPs per VG:     32512
MAX PPs per PV:     1016                     MAX PVs:        32
LTG size (Dynamic): 256 kilobyte(s)          AUTO SYNC:      no
HOT SPARE:          no                       BB POLICY:      relocatable
PV RESTRICTION:     none                     INFINITE RETRY: no
DISK BLOCK SIZE:    512

Am I hitting some kind of limitation? Just want to understand this fully.

Thanks for your help as always.
# 4  
Old 11-21-2014
Quote:
Originally Posted by c3rb3rus
My initial approach (original post) when I was going to the first option, was creating a enhanced JFS, it would of attempted to create a new LV? Thus this is why I was running into those errors?
Basically yes. The long answer is that you seem not to have a firm grasp of LVM concepts and terminology. See below.

Lets first deal with your other problem (with the big FS). Notice the difference in your provided output, i have snipped the important part:
Code:
MAX LVs:            256                      FREE PPs:       13104 (1677312 megabytes)
LVs:                0                        USED PPs:       0 (0 megabytes)

Code:
# /usr/sbin/mklv -y'lv_usr1' -t'jfs2' -c'2' -L'usr1' -x'32512' vg_usr1 6552
0516-032 lcreatelv: Illegal physical partition number.
0516-822 mklv: Unable to create logical volume.

Code:
MAX LVs:            256                      FREE PPs:       1103 (141184 megabytes)
LVs:                2                        USED PPs:       12001 (1536128 megabytes)


Notice that you have 2(!) and not one LVs after creating the first LV and you have 1103 PPs free after using 12000 out of the initial 13104. You have one LV more than expected and one PP less than expected, right?

The reason for this is that JFS is a JOURNALED filesystem and as such it needs a journal. Issue a

Code:
lsvg -l <vgname>

and you will see an (automatically created) LV of type "jfslog" with the size of 1 PP. This has been created automatically when you issued your "mklv" command to create a LV without an "inline" log. JFS2 can use either an external jfslog device (one per VG) or an inline log (one per LV). This is why your "mklv" command failed: the jfslog LV was created first and then you missed one PP to fulfill your size demands.

Here is a short introduction to LVM concepts. I suggest you download and study some of IBMs Redbooks to that.

We start with disks. What a "disk" is can be a wide variety of devices: physical disks, RAID sets, LUNs, etc., basically everything that has a "hdisk"-device entry in "lsdev". We will consider a disk to be a real, physical disk at first. (Let us start simple and go from there.)

The first thing we have to create is a "volume group". VGs are purely logical constructs, containers. You create a VG and give it at least one disk. A disk inside a VG is called "physical volume", PV. Classical VGs can hold up to 32 PVs (there are "scalable" and "big" VGss, but about that later). There are commands ("extendvg", "reducevg") to add disks to a VG or remove them from one.

When a disk is added to a VG it is sliced into "physical partitions". A PP is the smallest amount of disk space a VG can deal with. Classical VGs can have a maximum of 1019 PPs in one PV, therefore a classical VG is limited to 32 x 1019 PPs in size. The PP size is therefore a vital decision and one should better err to the big side than to the small side. Bigger PPs mean you might waste some space because you cannot add less than a single PP to a FS. Selecting the PP size too small means you cannot use larger disks. Unfortunately the PP size cannot be changed, you will have to wipe the whole VG and create it anew.

Once you have a VG you can create volumes, LVs: volumes are similar to "partitions" in PCs. Raw disk space,which can be used either for filesystems or other purposes (raw devices, swap space, ...). LVs are created from (in principle) anonymized PPs. When you add a disk to a VG it is sliced up into PP-sized chunks (PPs) and these chunks are put into a big bag. Then you create a LV and give it a certain amount of PPs. You do not need to know where they come from (which PV and position) although you can control this process to the utmost extent (by using map files). You can, but do not have to (and one usually doesn't).

Notice that inside the LV there are "logical partitions", LPs. These are the logical equivalent of PPs, but abstracted. If you use a LV with one copy (unmirrored) then each PP corresponds to one LP and vice versa. When you have 2 copies there are two PPs corresponding to one LP, 3 copies would mean 3 PPs corresponding to 1 LP. The VG has an attribute controlling the allocation of these PPs: "each copy on a separate PV". This means that every PP resenting the same LP should be located on a different PV (disk). Switch the attribute off and all copies might land on the same disk.

Finally you can put filesystems (and some other things) onto a LV or use it as a raw device. The latter is often preferred by database guys (for no good reason any more, because the performance gain is next to nil nowadays). You can also put a JFS or JFS2 (and some other filesystems) ont it, you can create a paging device or system dump device. Creating a FS means you format the LV and put some FS information onto it. You can create a FS directly, in which case the underlying LV is automatically created for you (this is what you tried above and what failed). You can also grow and shrink the FS (command chfs), which will also automatically enlarge/shrink the underlying LV acccordingly. Notice that stiil the PP size is set. You can add 1 byte to the FS, but it would result in adding a whole LP (and therefore, depending on the LV copies, 1, 2 or 3 PPs) to the LV and subsequently to the FS. You can try it:

Code:
chfs -a size=+1 /some/FS

will grow "/some/FS" by not 1 byte but by the PP size.

I hope this helps.

bakunin
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Has anyone created JFS2 file system on a USB drive attached to AIX server?

We have an IBM Power 710. It has a USB port on the front. I have done some searching and see that there is information out there on how to create a JFS2 file system on USB drives. A few have commented that they would not recommend it, if the server is important, may crash the server... Just... (0 Replies)
Discussion started by: mbenedi
0 Replies

2. Emergency UNIX and Linux Support

How to fix the CPU bound issues on AIX?

Hi All, Can you please answer my question. i see lot of CPU utilization on AIX LPARs. i am able to find the cause of the probelm. But i do not know how to mitigate or fix the problem. for instance, i found the process which is consuming most of CPU. i informed the responsible team. how... (7 Replies)
Discussion started by: System Admin 77
7 Replies

3. AIX

AIX 6.1 Memory Performance issues

Good Day Everyone, Just wonder anyone has encounter AIX 6.1 Memory Performance issues ? What I have in my current scenario is we have 3 datastage servers (Segregate server and EE jobs - for those who know Datastage achitect) and 2 db servers(running HA to load balance 4 nodes partitions for... (3 Replies)
Discussion started by: ckwan
3 Replies

4. AIX

AIX JFS2 content

Hello! I have a LPAR with 51GB RAM topas shows 21% of memory for client pages (~11Gb) svmon -G show 2906772 client pages in use (~11Gb) but then i try to investigate per process client memory usage svmon -P -O filtertype=client and summarize inuse column, i get only 347880 pages... (1 Reply)
Discussion started by: sys
1 Replies

5. AIX

AIX filter Issues

Hi, I want to print from AIX 5.3/6.1 using 'pr' preprocessing filter and 'PCL' print file type. Steps: 1. Smitty 2. Print Spooling 3. Create a print queue(remote->Generic) 4. change the attributes for that print queue. 5. Change print file type to PCL and... (1 Reply)
Discussion started by: meeraramanathan
1 Replies

6. AIX

AIX-specific memory issues?

Hi, Does anyone here write cross-platform applications to be run on different Unix variants? For some reason, an application I'm working with, when being run on machines with similar specifications, I run into "cannot allocate" errors (St9bad_alloc) on AIX but not on other platforms. Is it a... (8 Replies)
Discussion started by: wolfier
8 Replies

7. UNIX for Advanced & Expert Users

AIX 5.2 using jfs2 file system

We are using AIX 5.2 using jfs2 almost all excpt one mount. Is it possible for a non root user id to mount one file system without journaling turned on, perform some activities and then remount (un-mount and mount) the same file system again. Please advise if this is possible Thanks (2 Replies)
Discussion started by: jerardfjay
2 Replies

8. AIX

(URGENT) Mounting JFS2 FileSystem on AIX 4.3

Hi Every body, I created Volume Group & FileSystem of type JFS2 with size 1.3 TB on AIX 5.2. I want to import this VG on another system AIX 4.3. It is imported successfully & I can varyon the VG but unfourtantly I couldn't mount the FileSystem. Is it possible to mount a JFS2 FileSystem on AIX... (3 Replies)
Discussion started by: aldowsary
3 Replies

9. AIX

AIX 5.3 Issues

We are planning to move to AIX 5.3 and we would like to know if someone has had any 'bad' experiences with it. We have a 32PE p690 Regatta and currently we are running the latest AIX 5.2 with the latest patches. Has anyone any interesting points to mention when transitioning to AXI 5.3? Is... (1 Reply)
Discussion started by: miket
1 Replies

10. UNIX for Advanced & Expert Users

jfs (jfs2) for AIX versus Veritas

Hi there, Can anyone tell me the advantages that jfs has over Veritas (if any)?? Cheers. (5 Replies)
Discussion started by: rich
5 Replies
Login or Register to Ask a Question