From: kwh@stiatl.salestech.com (Kurt Hoyt)
Newsgroups: comp.unix.aix
Subject: Re: How Do You Partition A Disk In AIX?
Date: 10 Apr 92 13:29:10 GMT
Organization: Sales Technologies, Inc.

john@newave.mn.org (John A. Weeks III) writes:

>I just obtained an RS/6000 with two 400 M-Byte disks.  After
>installing AIX 3.1.5, one of the disks appears to be all
>set up with the standard partitions, plus an empty partition
>called `u'.

>The second disk does not appear to be set up in any way.  I 

It may not be part of any volume group yet. To check, use the lsvg
command:
	% lsvg -p rootvg
This will list the physical volumes (the actual disk drives) which
are part of the rootvg volume group (a collection of disk drives).

>cannot figure out how to make partitions on this disk, or
>how to tell if there are any existing partitions on it that
>are not mounted.  I also cannot find a `partitions' file in
>the etc directory.  I was able to tell that the device is
>configured as hdisk1 using smit (and that the disk with root
>is hdisk0).

The standard UNIX concept of a partiton does not exist in AIX.
IBM replaced it with its logical volume manager (LVM). Read the
Logical Volume Storage Overview in the General Concepts and Procedures
book in InfoHider.

Here's how it works: Disks on an AIX system are considered "physical
volumes" (a volume being IBM-speak for a disk drive, see also DASD
and hard file). Physical volumes are collected into groups called
"volume groups". All of the disk space on all of the physical volumes
in a volume group is collected into a pool of physical partitions.
The default size for a physical partition is 4MB of disk space. So,
the total amount of disk space available in a volume group is the
sum of the space on each of the physical volumes in the volume group.
AIX is booted from the root volume grop (rootvg). AIX upgrades tend to
trash the root volume group, so it should contain only the base system
file systems (/, /var, /usr, /tmp).

File systems are created in logical volumes. A logical volume is what
you currently think of as a UNIX partition: some chunk of disk space
with a file system in it. A logical volume is a collection of logical
partitions. A logical partition represents one to three physical
partitions of real disk space in a volume group. By using more than one
physical partition to hold a logical partition (also 4MB), you get higher
reliability since you have one to three copies of the data on the real disk.
Anyway, to create a logical volume you specify to SMIT the volume group you
want to create the logical volume in and its size in partitions (4MB
chunks). The name given to the logical volume becomes a name in /dev similar
to the /dev/rz01c that UNIX partitions have in /dev. You create file
systems in logical volumes. The file system need not use all the space
in the logical volume. These are the file systems you are used to and they
get mounted with mount, etc. Look in /etc/filesystems.

>BTW, if I do manage to make partitions on the second disk, how
>do I get them to be mounted automatically on bootup?  Is this
>just an entry in the `filesystems' file, or does it have to be
>coded in somewhere else?

It is an entry in /etc/filesystems and can be set in SMIT when you create
the file system.

>I assume that I have to do some mkdev's, then mkfs, then mount,
>but I cannot find docs on the proper device names for mkdev,
>or the number of sectors for mkfs.

Actually, no. You can use SMIT. The fastest way to create new file systems
in a volume group is to use SMIT [PATH: Physical & Logical Storage, File
Systems, Add/Change/Show/Delete File Systems, Journaled File Systems,
Add a Journaled File System]. SMIT asks you to select the volume group
for the file system. It this presents a screen in which you give it the
size of the file system as the number of 512-byte blocks it needs, the
mount point, whether or not to mount the file system automatically at
system restart, the permissions on the file system (read only, read/write,
etc.), and any mount options. Only the size and the mount point are
required. Press enter and SMIT creates a logical volume of the proper size,
makes a file system in it of the size you specified, mounts it, and modifies
/etc/filesystems for you. You no longer need to know device names or numbers
of sectors.

One mistake I made when I first used AIX was to allocate all the space in
a volume group to the file systems. This doesn't work very well since it
removes all the flexibility of the LVM on AIX. Only allocate as much
space to a file system as you need right now. If it fills up, go back
into SMIT and change the size of the file system to something larger. With
the LVM you can do this while AIX is running multiuser and while the
file system is mounted and in use.

Get to know the LVM -- it's wonderful. It's also frustrating for the
experienced UNIX administrator because it's a completely different
mind set.

-- 
---------------------+ 
Kurt in Atlanta      | "This 'Tamper Proof Bag' is being provided to
kwh@salestech.com    |  ensure the integrity of your 'Software'."
...!uupsi!stiatl!kwh |             -- IBM
Newsgroups: comp.unix.aix