AIX disks and file systems

Source: Internet
Author: User

1. System Directory


650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131229/212S43161-0.jpg "title =" 201303281601320.6.jpg" alt = "093838365.jpg"/>

2. logical volume Management

Before learning how AIX processes the file system, you 'd better have a basic understanding of LVM logical volume management. LVM is a disk management method that is completely different from traditional UNIX partition policies. One of its advantages is that it allows a file system to allocate more space dynamically. The components of LVM include physical volume PV, volume group VG, physical partition PP, logical Volume LV, and logical partition LP.


3. Basic concepts:

Physical volume: A physical volume refers to a hard disk.

Volume group: A volume group is a set of available physical hard disks, which can be logically considered as a large hard disk. A volume group consists of one or more physical volumes. Up to 32 AIX4.3.2 versions have increased to 128 ).

Physical partition: the physical volume in the volume group is divided into a fixed block size by default 4 MB). Such a block is called a physical partition.

Logical volume: one or more logical volumes can be defined in each volume group, A logical volume is a collection of information on a physical partition. It can be a file system, paging space, log, or dump device space ).

● Logical volumes can be created using images.

● When creating a logical volume, you can specify data to be distributed in a block manner. This is already described in Chapter 1 ). Block-based data blocks are evenly distributed across multiple disks to improve read/write performance.

Logical partition: A logical volume is composed of a certain number of logical partitions.

● Because the default logical partition size corresponds to the corresponding physical partition) is 4 MB, the logical volume allocated with 64 logical partitions is 256 MB.

● If no image is made, physical partitions and logical partitions are in a one-to-one relationship. In the image mode, two or three physical partitions can be allocated to a logical partition.

● Logical partitions in a logical volume are arranged in order, but the corresponding physical partitions can be arranged in a distributed or unordered manner, from different locations on the disk or from different disks.

Log File System: A logical volume can contain page adjustment and dump space, but is usually used as a file system.

● The structure of the AIX file system is very similar to that of other UNIX systems. As the log file system JFS), each AIX file system contains a super block, an I node, and a data block.

● The log file system replaces fsck with logs for restoring the file system in case of a fault.

● A jfs is not as limited as the hierarchical File System HFS in other Unix systems. It is not required to be distributed in a continuous disk space.

● JFS writes data in 4 K blocks and supports a minimum size of 512 bytes in BSD format) to improve disk utilization.

● JFS also supports LZ algorithm File compression and decompression.


4. Install Disks

The example used in the following discussion is: An RS/6000 system already has a built-in hard disk and is ready to add an external hard disk.

To enable the system to identify the existence of the new hard disk, just power off the host, connect to the hard disk, and then restart. The system will automatically assign a physical volume name to the new hard disk-hdisk <x>, and x is the next available disk number. For example, if the volume of the built-in disk is hdisk0, the newly added external disk is named hdisk1. At this time, the hard disk is only available for LVM, but not yet configured. You can use SMIT or the chdev command to configure the disk.

If you want to connect to an external hard disk through SMIT, enter smit makdsk in the command line and you will see:

Disk Type

Move cursor to desired item and press Enter.

[TOP]

1000 mb scsi 1.0 gb scsi Disk Drive

1000mb16bit scsi 1.0 gb scsi Disk Drive

1000mb16bitde scsi 1.0 GB 16 Bit Differential SCSI Disk Drive

1000 mbde scsi 1.0 GB Differential SCSI Disk Drive

1100 mb scsi 1.1 gb scsi Disk Drive

......

If the installation is not an ibm scsi hard Disk, select osdisk in the Disk Type list, and then select the correct Adapter in the Parent Adapter list, then fill in the SCSI address of the hard Disk in the CONNECTION address field on the Add a Disk screen:

Add a Disk

Type or select values in entry fields.

Press Enter AFTER making all desired changes.

[Entry Fields]

Disk type osdisk

Disk interface scsi

Description Other SCSI Disk Drive

Parent adapter scsi0

......

Note that the SCSI hardware address entered in this field contains two numbers, and the second number is 0. For example, if the hardware address of a SCSI hard disk is 4, enter 4 or 0. Select yes in the ASSIGN physical volume identifier Field. Press Enter, and the hard disk is configured as a physical volume PV), and a physical volume identifier PVID is assigned ).

The next step is to make PV a member of the volume group VG. Only in this way can the logical volume be created on the disk. If the created volume group contains both built-in and external hard disks, LVM regards these two disks as a single storage entity.

There is a special volume group named rootvg. rootvg contains the operating system and boot zone, which are usually in a disk. If you want rootvg to span both the built-in and external hard disks, you must reinstall and reconfigure the operating system as long as one of the disks fails, and recover user data from the backup.

A new hard disk can have its own volume group, or add it to an existing volume group. You can add it to rootvg as long as you want. In our example, if you want to add hdisk1 to rootvg, you can use the SMITsmit extendvg tool or the extendvg command:

# Extendvg-f rootvg hdisk1

If you want the physical volume hdisk1 to have its own volume group called datavg, you can use the SMITsmit mkvg tool or use the mkvg command:

# Mkvg-f-y datavg hdisk1

Before accessing a volume group, you must use the varyonvg command to activate it:

# Varyonvg datavg

If you add hdisk1 to datavg, use the lsvg column volume group command to generate the following output:

# Lsvg

Rootvg

Datavg

If you enter the lspv column physical volume) command, you will see:

# Lspv

Hdisk0 0004038485e2483a rootvg

Hdisk1 201713403f203af5 datavg


The first column is the volume label of the physical volume, the second column is the hexadecimal PVID, and the third column is the volume group to which each physical volume belongs.

At this point, the system has recognized the new hard disk and assigned it as a physical volume to the volume group datavg. Therefore, you can now create a logical volume on it.


5. Create a logical volume

Creating logical volumes provides great flexibility. For example, you can decide how many hard disks a lv can span, or whether the LV is allocated to the inside, center, or outside of a specific disk. If you do not want to define these values, LVM also provides the default definition. In this book, we assume that the default value is selected.

You can use the mklv command to create a logical volume, but the SMIT tool is simpler. Enter smit mklv in the command line. First, we need to provide the volume group name in our example, select rootvg or datavg), and then we will see the following content:

Add a Logical Volume

Type or select values in entry fields.

Press Enter AFTER making all desired changes.

[TOP] [Entry Fields]

Logical volume NAME []

* Volume group name rootvg

* Number of logical partitions []

#

Physical volume names [] +

Logical volume TYPE []

57

AIX basics and system management

POSITION on physical volume middle +

RANGE of physical volumes minimum +

Maximum number of physical volumes [] #

To use for allocation

Number of COPIES of each logical 1 +

Partition

Mirror Write Consistency yes +

Allocate each logical partition copy yes +

Mirror Write Consistency yes +

Allocate each logical partition copy yes +

On a SEPARATE physical volume

RELOCATE the logical volume during yes +

Reorganization

Logical volume LABEL []

Maximum number of logical partitions [1, 128]

Enable bad block relocation yes +

Scheduling policy for writing logical parallel +

Partition copies

Enable write verify no +

File containing allocation map []

Stripe Size [Not Striped] +

In SMIT, an item starting with a star number *, such as the volume group name, is a mandatory item. Therefore, the value that must be input in the preceding example is the number of logical partitions. Assume that the logical partition size is 4 MB. Enter 128 to create a logical volume of 512 MB. You can also select a more meaningful name for the logical volume. Otherwise, the system automatically obtains a name with no meaning, such as lv01. In our example, the logical volume is named data.


6. Create a File System

Once the logical volume is created, run the crfs command or enter smit crfs to create a file system for it. If you use the SMIT command, the following output is displayed:

Add a File System

Move cursor to desired item and press Enter.

Add a Journaled File System

Add a Journaled File System on a previusly Defined Logical Volume

Add a CD-ROM File System

If a Logical Volume has been Defined, select the second item -- Add a Journaled File System on a Previously Defined Logical Volume. If you want to automatically create a logical volume when creating a file system, select the first option. In this case, the attributes of the new logical volume are set by default. Select the second item and the output is as follows:

Add a Journaled File System on a previusly Defined Logical Volume

Type or select values in entry fields.

Press Enter AFTER making all desired changes.

[Entry Fields]

* Logical volume name +

* Mount point []

Mount AUTOMATICALLY at system restart no +

PERMISSIONS read/write +

Mount OPTIONS [] +

Start Disk Accounting no +

Fragment Sizebytes) 4096 +

Number of bytes per inode 4096 +

Compression algorithm no +

The required items are logical volume and mount point. But it is best to modify the third item -- Mount AUTOMATICALLY at system restart. If you want to enable the file system after the system is started, select yes. The file system mount point is a simple directory name used to specify the initial position of the file system. For example, after a file system is created on a logical volume named data and the mount point is the/usr/local/data directory, the file system is loaded or becomes available, its starting position is the/usr/local/data directory. The mount point may not be an empty directory, but once the file system is mounted to this directory, all the files under it will become invisible or temporarily unavailable.

The last step is now. Once a logical volume is created and the file system on the logical volume has been created, it must be made available by mounting the file system. The simplest way to mount a file system is to enter the mount command and keep up with the name of the mount point, for example:

# Mount/usr/local/data

In this way, the new file system created on the data logical volume is mounted to the/usr/local/data directory. AIX knows which file system should be mounted to/usr/local/data. This is because

Add an entry similar to the following in the/etc/filesystems file:

/Usr/local/data:

Dev =/dev/data

Vfs = jfs

Log =/dev/hd8

Mount = true

Check = true

Options = rw

Account = false

The mount command will go to/etc/filesystems to check an entry named/usr/local/data. If found, it will load/dev/data in the file system instance pointed to in dev, that is, the name of the logical volume) to the/usr/local/data directory.


7. Manage the page Space

To create a paging space, define the property as paging when creating a logical volume. To add a new page space logical volume, follow these steps:

1) Start SMIT:

# Smit mkps

2) the following output assumes that there is only one volume group rootvg ):

Volume group name

Move cursor to desired item and press Enter.

Rootvg

3) after you select a volume group, you will see:

Add Another Paging Space

Type or select values in entry fields.

Press Enter AFTER making all desired changes.


[Entry Fields]

Volume group name rootvg

SIZE of paging space in logical partitions) [] #

PHYSICALvolumename +

Start using this paging space NOW no +

Use this paging space each time the system is no +

RESTARTED

The default size of the number of input logical partitions is 4 MB ). To activate the page space at present and every time the system restarts, enter yes on each option with a question mark.

You can use the smit chps command to increase the page size. To reduce the page size, use smit rmps to delete it, and then use smit mkps to add a new page size.


8. Summary

The main steps to add a disk and create a file system are as follows:

1. Connect the disk to the system.

2. Define a disk as a physical volume.

3. Add the physical volume to a volume group, or create a new volume group for the physical volume.

4. Create a logical volume and modify the corresponding features as needed, such as whether the volume is an image or a storage location on the disk.

5. Create a file system on the logical volume. If you do not want to create a logical volume before creating a file system, AIX also provides the option to automatically create a logical volume.

6. mount the mount file system.

All these operations can be done either through the command line or through the SMIT tool. If you are a newbie or want to make it easier, using SMIT is a good choice.


Oracle video tutorial follow: http://u.youku.com/user_video/id_UMzAzMjkxMjE2.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.