Link to home
Start Free TrialLog in
Avatar of wesly_chen
wesly_chenFlag for United States of America

asked on

create filesystem on lv and mount it at boot up

I've a IBM eServer pSeries box with AIX 4.3 on it. It has 4 hard disk.

I would like to create logic volume, create filesystem (jfs) on it and mount it automaticall during bootup.

Here are some information:
# uname -a
AIX stymie 3 4 000AC1FF4C00

# lspv
hdisk0         000ac1ff146468d0    rootvg        
hdisk1         000ac4ff663d69ae    phat_vol_grp  
hdisk2         000ac4ff671219ab    phat_vol_grp  
hdisk3         000ac1ffb52e3ff4    phat_vol_grp

# lsvg -o | lsvg -i -l
phat_vol_grp:
LV NAME             TYPE       LPs   PPs   PVs  LV STATE      MOUNT POINT
lv00                jfs        3     3     1    closed/syncd  N/A
rootvg:
LV NAME             TYPE       LPs   PPs   PVs  LV STATE      MOUNT POINT
hd4                 jfs        1     1     1    open/syncd    /
hd2                 jfs        157   157   1    open/syncd    /usr
hd9var              jfs        1     1     1    open/syncd    /var
hd3                 jfs        1     1     1    open/syncd    /tmp
hd1                 jfs        1     1     1    open/syncd    /home

Ok I want to create logic volume (lv00) across hdisk1, hdisk2, and hdisk 3 with jfs filesystem. And mount it as /data when boot-up.

Could someone tell me the comands to do it step-by-step so I can do it quickly?

Thanks in advance.
ASKER CERTIFIED SOLUTION
Avatar of tfewster
tfewster
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
See http://publib.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixbman/admnconc/fs_overview.htm  for background info; Note that "crfs" and "mkfs" do a similar job, but "crfs" can create the entry in /etc/filesystems (And can actually create the LV as well, though using mklv gives you better control)

Oops, just noticed that the -A option needs a parameter, "yes" (to specify this FS should be mounted when the system restarts)
Avatar of wesly_chen

ASKER

Hi,

  How do I get the information of "vg's PP size"?

I got it.
# lsvg phat_vol_grp
VOLUME GROUP:   phat_vol_grp             VG IDENTIFIER:  000ac1ff2fe9f94f
VG STATE:       active                   PP SIZE:        1024 megabyte(s)
VG PERMISSION:  read/write               TOTAL PPs:      152 (155648 megabytes)
MAX LVs:        256                      FREE PPs:       152 (155648 megabytes)
LVs:            0                        USED PPs:       0 (0 megabytes)
OPEN LVs:       0                        QUORUM:         2
TOTAL PVs:      3                        VG DESCRIPTORS: 3
STALE PVs:      0                        STALE PPs:      0
ACTIVE PVs:     3                        AUTO ON:        yes
MAX PPs per PV: 1016                     MAX PVs:        32

The vg PP size is 1GB.

Wesly
I ran
# mklv -u 2 -S 64K -y lv00 phat_vol_grp 128
to create a 128GB logic volume "lv00", since the striped logical volume size can only be an even multiple of the striping width.
In other words, "-u 3" doesn't work.

Then when I ran
# crfs -v jfs -m /data -d lv00 -A -a bf=true -a size=134217727
---------------------
crfs: Warning: logical volume lv00 larger than filesystem max (134217728).
WARNING: log size greater than one segment
Only 256MB of log will be used
fshop_make: 0506-252 A file system with nbpi = 4096 cannot exceed 134217728 512-byte blocks

0506-276 JFS file systems have the following size limitations:

  NBPI  Minimum AG Size    Fragment Size        Maximum Size (GB)
   512         8        512, 1024, 2048, 4096          8
  1024         8        512, 1024, 2048, 4096         16
  2048         8        512, 1024, 2048, 4096         32
  4096         8        512, 1024, 2048, 4096         64
  8192         8        512, 1024, 2048, 4096        128
 16384         8        512, 1024, 2048, 4096        256
 32768        16             1024, 2048, 4096        512
 65536        32                   2048, 4096       1024
131072        64                         4096       1024

Filesystem Helper: 0506-527 Unknown error, code =  (28)
rmlv: Logical volume loglv00 is removed.
--------------------------------------
So how can I increase/change NBPI to 8192 so I can have maximum size to 128GB?
Besides, for 128GB, what is the number to pass to "size=" in crfs?

Thanks.
Hmm - 152 PPs seems like an odd number - Are all these disks the same size (approx 50Gb!)? lspv should show you the characteristics.   Are they actually logical disks allocated from a disk array?

mklv -u 2 -S 64K -y lv00 phat_vol_grp 128  - If this works, I'd guess that you have 2 * 72Gb disks in the VG and the third is about 8Gb!


Of course, I could be completely off base; If they are all the same size, try 132Gb, which meets the "even" criteria:
mklv -u 3 -S 64K -y lv00 phat_vol_grp 132


For the crfs:

Use the option "-a nbpi=8192" with the crfs command to allow an fs of up to 128Gb

The size would be "-a size=268435456"  (i.e. 128*1024*1024*1024/2)
(Increase that if you create a 132Gb lv)
# (lscfg -l hdisk0;lscfg -l hdisk1;lscfg -l hdisk2;lscfg -l hdisk3) | grep hdisk
  hdisk0            10-88-00-8,0      16 Bit LVD SCSI Disk Drive (18200 MB)
  hdisk1            10-88-00-9,0      16 Bit LVD SCSI Disk Drive (73400 MB)
  hdisk2            10-88-00-10,0     16 Bit LVD SCSI Disk Drive (73400 MB)
  hdisk3            10-88-00-11,0     16 Bit LVD SCSI Disk Drive (18200 MB)

In volume group "phat_vol_grp", hdisk1 and hdisk2 are 72GB and hdisk3 is 18GB.
So in this case, can I still use -u 3 with size 144+18=164GB or 144GB is the maximum size I can get?

I've tried "-a nbpi=8192" or "-a nbpi=16384" but I still got "fshop_make: 0506-252 A file system with nbpi = 4096 cannot exceed 134217728 512-byte blocks" with error code 28. Any idea?

Correction, 144+18=162
You can create a 152Gb filesystem, but it won't be striped - A striped filesystem allocates extents from each disk in turn (64K from hdisk1, then 64K from hdisk2, then 64K from hdisk 3, then back to hdisk1) so the biggest striped filesystem you could create would be 3 * 18 = 72Gb.

As regards setting nbpi to allow larger filesystem sizes - I don't know why it doesn't work :-(

Just to confirm, your command looked like this?
crfs -v jfs -m /data -d lv00 -A yes -a size=268435456 -a bf=true -a nbpi=8192

You could try using mkfs directly:
mkfs  -s 268435456 -o nbpi=8192,bf=true  -V jfs  lv00
Ok, 136GB is the biggest capacity I can get with "-u 2".
# mklv -u 2 -S 64K -y lv00 phat_vol_grp 136
Not 144GB. Is it because the limitation of "-S 64k"? (Sorry, man mklv doesn't work for me on the AIX box)

However, the following command
# crfs -v jfs -m /data -d lv00 -A -a nbpi=16384 -a bf=true -a size=285212672
still fail at fshop_make: 0506-252 A file system with nbpi = 4096 cannot exceed 134217728 512-byte blocks" with error code 28.

This drives me crazy.
wesly, you've not put the "yes" after the -A option;  Possibly that's why its ignoring the -a nbpi=16384 ?  Though I'd have expected a more meaningful error message!

.. -A yes -a nbpi=16384..

Regarding the 144/136 - Disk manufacturers call a Gigabyte 1000 * 1000 * 1000 bytes, which accounts for the difference; 73,000,000,000 /1024/1024/1024 = 67.98  

# crfs -v jfs -m /data -d lv00 -A yes -a size=285212672 -a bf=true -a nbpi=16384
Works. I missed "yes" after "-A". Well, that's a typo in tfewster's first post.

Thank you very much.
Summary:
---------------------
Check PP size in a volume group:
# lsvg <vg name>

Check the physical disk size:
# lscfg -l hdisk0  (or hdisk1, hdisk2...)

Create logic volume:
# mklv -u 2 -S 64K -y <NEW_LV_NAME> <vg name>  <number_of_PPs>
(Note: A striped filesystem allocates extents from each disk in turn (64K from hdisk1, then 64K from hdisk2, then 64K from hdisk 3, then back to hdisk1)

Create filesystem on a logic volume:
# crfs -v jfs -m <moint point> -d <NEW_LV_NAME> -A yes -a size=<size in 512> -a bf=true -a nbpi=<8192 for 128GB and 16384 for 256GB>
(Note: -a bf=true allows large files [ > 2Gb]; Alternatively, you may want want `-a frag=512` if you expect lots of very small [< 512 byte] files. Specifying -m /data will create the entry in /etc/filesystems for you)
or
# mkfs -s <size in 512> -o nbpi=<8192 for 128GB and 16384 for 256GB>,bf=true  -V jfs <NEW_LV_NAME>

Mount the filesysem:
mount /data
--------------------
Wesly
Sorry - I did mention it in my 2nd post but I should have made it more clear!