AIX 5L SysAdmin I: (Unit 05) – System Storage Overview

Terminology & Concepts:
————————————-
PV – Physical Volumes – (hard disks)
VG – Volume Groups – (a way to group hard disks)
LV – Logical Volumes – (a way to carve out a piece of a VG)
PP – Physical Partitions – (on PVs that are mapped to LP)
LP – Logical Partitions – (on LVs that are mapped to PP)

File Systems vs Logical Volumes – You cannot have a file system without a logical volume.

Components of AIX Storage:
—————————————–
Files – (command, script file, text etc)
Directories – (a way to organize files)
File Systems – (an AIX directory and file hiearchy)
Logical Storage – (provides flexibility)
Physical Storage – (limitations on drive size etc)
Logical Volume Manager (LVM) – (maps logical storage space to the physical storage space)

Traditional UNIX Disk Storage (Problems):
————————————————————-
Partition 1 Partition 3
Partition 2 Free Space
Free Space Free Space

Fixed partitions
Expanding size of the partition
Limitation on size of a file system and a file
Contiguous data requirement
Time and effort required in planning ahead

Note: Difficult to enlarge Partition 1 because it would require backing up the data in Partition 1 & 2, blowing it all away, then recreating the larger partitions and restoring the data.

Benefits of the LVM:
——————————
Logical volumes solve non-contiguous space problems
Logical volumes can span disks
Dynamically increase logical volume size
Logical volumes can be mirrored
Hard disks easily added to a system
Logical volumes can be relocated (ex. if a disk is failing)
Volume group and logical volume statistics can be collected

Note: These tasks can be performed dynamically without taking the system down or making users log off.

Physical Storage:
————————–
Volume Group A – PV1
Volume Group B – PV2, PV3, PV4, PV5 …

–> 32 max PV Physical Volumes in a VG Volume Group
–> 1016 max PP Physical Partitions on a PV Physical Volume
–> 4 MB default size per PP Physical Partition
Note: All physical disks in a volume group will have the same partition size. Partition size is set by VG Volume Group.

Volume Groups:
————————
rootvg – (root volume group)
datavg – (data volume group)

New PV:
————-
–> Add to existing VGs
–> Create new VG

Why create new volume groups?
———————————————–
–> Separate user data from operating system files
–> Disaster recovery
–> Data portability
–> Data integrity and security

Volume Group Descriptor Area (VGDA):
———————————————————-
VGDA – Contains all of the structural information for the volume groups.

There are two copies of the VGDA on each disk if there is only 1 or 2 PV in the volume group. Once there are three or more PV in a VG then there is only one copy ov the VGDA stored on each PV. Thus, if one PV goes down, there is still a copy of the VGDA on the other PV.

Max Size:
—————
Normal VG – 32 PVs
Big VG – 128 PVs

Volume Group Limits:
——————————–
Normal Volume Groups (mkvg)
Max#ofDisks Max.#ofPartitions/Disk
——————- ———————————
1 32512 32 – Factor
2 16256 16 – Factor
4 8128 8 – Factor
8 4064 4 – Factor
16 2032 2 – Factor
32 1016 Default

Note: Each normal VG volume group can only address 32512 partitions. These partitions can be in one PV physical volume or up to 32 PV physical volumes. The number of partitions on each disk will depend upon how many disks there are and what the partition size is set at 4Meg being the default.

Big Volume Groups (mkvg -B)
Max#ofDisks Max.#ofPartitions/Disk
——————- ———————————
1 130048 128 – Factor
2 65024 64 – Factor
4 32512 32 – Factor
8 16256 16 – Factor
16 8128 8 – Factor
32 4064 4 – Factor
64 2032 2 – Factor
128 1016 Default

mkvg -t – To make a volume group
chvg -t – To change the volume group
-t – factor number

Note: You always divide the max#ofDisks by the factor number and you always multiply the max#ofParitions/Disk by the factor number. This shifts the balance to less disks and more partitions as you move away from the defaults.

Example:
—————-
#ofDisks = 1
DiskSize = 8Gig
PartitionSize = 4Meg(Default)
Partitions/Disk = 1016(Default)
Partitions * PartitionSize = 1016 * 4Meg = 4Gig

Note: In this case the process would fail because the whole disk must be in the same partition.

To correct the problem we could:
1. Increase the PartitionSize to 8Meg
(1016 * 8Meg = 8Gig) or
2. Use the -t option with either the mkvg -t 2 or chvg -t 2 to adjust the “Factor number”. This increases the #ofPartitions/Disk from 1016 to 2032 for a normal volume group.
(2032 * 4Meg = 8Gig)

Size Counts:
——————–
1 1,024 (1k) 1,048,576 (1024k, 1Mg)
2 2,048 (2k) 2,097,152 (2048k, 2Mg)
4 4,096 (4k) 4,194,304 (4096k, 4Mg)
8 8,192 (8k) 8,388,608 (8192k, 8Mg)
16 16,384 (16k) 16,777,216 (16,384k, 16Mg)
32 32,768 (32k) 33,554,432 (32,768k, 32Mg)
64 65,536 (64k) 67,108,864 (65,536k, 64Mg)
128 131,072 (128k) 134,217,728 (131,072k, 128Mg)
256 262,144 (256k) 268,434,456 (262,144k, 256Mg)
512 524,288 (512k) 536, 870,912 (524,288k, 512Mg)

1,073,741,824(1,048,576k, 1024Mg, 1Gig)
2,147,483,648(2,097,152k, 2097Mg, 2Gig)
4,294,967,296(4,194,304k, 4096Mg, 4Gig)
8,589,934,592(8Gig)
17,179,869,184(16Gig)
34,359,738,368(32Gig)
68,719,476,736(64Gig)
137,438,953,472(128Gig)

Logical Storage:
————————
The LVM – Logical Volume Manger maps the physical volume partitions to the logical volume partitions. Remember that each physical volume must be in only one volume group.

Uses of Logical Volumes:
————————————–
A logical volume may contain one of the following, and only one at a time:
–> Journaled or Enhanced journaled file system (for example: /dev/hd4)
–> Paging space (/dev/hd6)
–> Journal log (/dev/hd8)
–> Boot Logical Volume (/dev/hd5)
–> Nothing (raw device)

Note: Logical Volumes basically says that I want to take this much space and set it aside for this purpose.

What is a File System?:
————————————
A file system is:
–>Method of storing data
–>Hierarchy of directories

Four types supported:
–>Journaled File System (jfs)
–>Enhanced Journaled File System (jfs2)
–>CD-ROM File System (cdrfs)
–>Network File System (nfs)

Different file systems are connected together via directories to form the view of files users see. Never does the user switch disk drives because it is transparent to the user. The user will only switch between files systems.

Volume Group (Hierarchy):
—————————————-
A VG Volume Group may have one or more LV Logical Volumes.
Each LV Logical Volume will have a separate file system to handle the file and directory hiearchy.
Volume Group
LV1 – File System – Directory – Files
LV2 – File System – Directory – Files

Note: There can be only one file system for each LV Logical Volume. Moreover, a LV Logical Volume can contain only one File System or one Paging Space or one Boot Volume or one Journal Log.

Why Have File Systems?:
—————————————-
1. Can strategically place it on disk for improved performance
2. Some tasks are performed more efficiently on a file system than on each directory within the file system, for example, back up, move, secure an entire file system
3. Can limit disk usage of users by file system (quotas)
4. Maintain integrity of the entire file system structure, for example, if one file system is corrupted, the others are not affected.
5. Special security situations
6. Organize data and programs into groups for ease of file manangement and better performance

Standard File Systems in AIX (hd4) /(root):
—————————————————————-
/home – LV – hd1
/sbin
/lib
/lpp
/usr – LV – hd2 /bin, /lib, /lpp, /share, /sbin
/bin
/dev
/tftpboot
/var – LV – hd9var /spool, /adm, /tmp
/mnt
/etc
/tmp – LV – hd3

/etc/filesystems:
————————-
/:
dev = /dev/hd4
vol = root
mount = automatic
check = false
vfs = jfs
log = /dev/hd8
type = bootfs

/home
dev = /dev/hd1
vol = “/home”
mount = true
check = true
vfs = jfs2
log = /dev/hd8
….

Mount Points:
———————
–> mount: the glue that logically connects file systems to the directory hierarchy.
–> File systems are associated with devices represented by special files in /dev – the logical volume
–> When a file system is mounted, the logical volume and its contents are connected to a directory in the hierarchical tree structure.

# mount /dev/lv00 /home/patsie
/dev/lv00 – What to mount
/home/patsie – Where to mount it

Note: File Systems must be mounted before it is available. The mount point should be an empty directory otherwise the information already in the directory won’t be available or visible. If data disappears it could be because you have a file system mounted on top of it.

Listing Files Systems:
———————————
lsfs – ls for list, fs for file systems
Name Node MountPt VFS Size(512byte blocks)
/dev/hd4 … / jfs 16384 = 8000k or 8 Meg
/dev/hd1 … /home jfs2
/dev/cd0 … /infocd cdrfs

Listing Logical Volume Information:
—————————————————
lsvg -l rootvg
LVNAME TYPE LPs PPs PVs LVSTATE MOUNTPT
hd6 paging 64 64 1 open/syncd N/A
hd5 boot 1 1 1 closed/syncd N/A
hd2 jfs 156 156 1 open/syncd /usr

Note: All of the hd* logical volumes were created during installation procedure.

Unit Summary:
———————-
1. The LVM is organized as follows:
– A VG consists of one or more PVs
– Each PV is divided into PPs
– A LV is made up of LPs
– LPs are mapped to PPs

2. Logical Volumes are used to contain:
– JFS or JFS2, Paging Spaces, Journal Logs, Raw Space, DumpSpace or Boot Logical Volume

3. The most common use of logical volumes is to contain JFS or JFS2.

Q: When I install my operating system, how is the physical partition size selected for rootvg?
A: Rootvg is set with a 4mb physical partition size normally. However, if your disk is larger than 4gb, you would not have enough partitions to partition the entire disk. Remember that the maximum number of partitions is 1016 per disk. When BOS is installed, it determines the size of the disk used for installation and sets the partition size large enough to partition the entire disk. For example, if your disk is 2.5 gb, then it will have 4 mb partitions. But, if your disk is 4.5 gb, then 4 mb * 1016 would only give you enough partitions for 4 gb worth of disk. So, the OS bumps up the size to the next available size, 8mb. If you have a 9gb disk, the PP is set to 16 mb.
?????
Q: If I want to add a 9gb drive to a VG with PPs set to 4mb, how do I increase my partition size?
A: You can’t, at least not easily. Your PP size is designated at VG creation time. You would need to back up your data, remove the volume group, recreate it with a larger partition size, and move the data back onto the VG.? OR use the chvg -t? to change the factor size.? This will allow more PP’s on a single PV in your volume group.? Remeber it also decreases the total number of PV’s allowed in the VG.

Leave a Reply

Your email address will not be published. Required fields are marked *

*