3.5 Configuring Raw Logical Volumes on IBM: Linux on System z
On IBM: Linux on System z, you can use raw logical volume manager (LVM) volumes for Oracle Clusterware and Automatic Storage Management files. You can create the required raw logical volumes in a volume group on either direct access storage devices (DASDs) or on SCSI devices. To configure the required raw logical volumes, follow these steps:
Note:
You do not have to format FBA-type DASDs in Linux. The device name for the single whole-disk partition for FBA-type DASDs is /dev/dasd
xxxx
1
.
-
If necessary, install or configure the shared DASDs that you intend to use for the disk group and restart the system.
-
Enter the following command to identify the DASDs configured on the system:
# more /proc/dasd/devices
The output from this command contains lines similar to the following:
0302(ECKD) at ( 94: 48) is dasdm : active at blocksize: 4096, 540000 blocks, 2109 MB
These lines display the following information for each DASD:
-
The device number (
0302)
-
The device type (
ECKD
orFBA
) -
The Linux device major and minor numbers (
94: 48
) -
The Linux device file name (
dasdm
)In general, DASDs have device names in the form
dasd
xxxx
, wherexxxx
is between one and four letters that identify the device. -
The block size and size of the device
-
-
From the display, identify the devices that you want to use.
If the devices displayed are FBA-type DASDs, then you do not have to configure them. You can proceed to bind them for Oracle Database files.
If you want to use ECKD-type DASDs, then enter a command similar to the following to format the DASD, if it is not already formatted:
# /sbin/dasdfmt -b 4096 -f /dev/dasdxxxx
Caution:
Formatting a DASD destroys all existing data on the device. Make sure that:-
You specify the correct DASD device name
-
The DASD does not contain existing data that you want to preserve
This command formats the DASD with a block size of 4 KB and the compatible disk layout (default), which enables you to create up to three partitions on the DASD.
-
-
If you intend to create raw logical volumes on SCSI devices, then proceed to step 5.
If you intend to create raw logical volumes on DASDs, and you formatted the DASD with the compatible disk layout, then determine how you want to create partitions.
To create a single whole-disk partition on the device (for example, if you want to create a partition on an entire raw logical volume for database files), enter a command similar to the following:
# /sbin/fdasd -a /dev/dasdxxxx
This command creates one partition across the entire disk. You are then ready to mark devices as physical volumes. Proceed to Step 6.
To create up to three partitions on the device (for example, if you want to create partitions for individual tablespaces), enter a command similar to the following:
# /sbin/fdasd /dev/dasdxxxx
Use the following guidelines when creating partitions:
-
Use the
p
command to list the partition table of the device. -
Use the
n
command to create a new partition. -
After you have created the required partitions on this device, use the
w
command to write the modified partition table to the device. -
See the
fdasd
man page for more information about creating partitions.
The partitions on a DASD have device names similar to the following, where
n
is the partition number, between 1 and 3:/dev/dasdxxxxn
When you have completed creating partitions, you are then ready to mark devices as physical volumes. Proceed to Step 6.
-
-
If you intend to use SCSI devices in the volume group, then follow these steps:
-
If necessary, install or configure the shared disk devices that you intend to use for the volume group and restart the system.
-
To identify the device name for the disks that you want to use, enter the following command:
# /sbin/fdisk -l
SCSI devices have device names similar to the following:
/dev/sdxn
In this example,
x
is a letter that identifies the SCSI disk andn
is the partition number. For example,/dev/sda
is the first disk on the first SCSI bus. -
If necessary, use
fdisk
to create partitions on the devices that you want to use. -
Use the
t
command infdisk
to change the system ID for the partitions that you want to use to0x8e
.
-
-
Enter a command similar to the following to mark each device that you want to use in the volume group as a physical volume:
For SCSI devices:
# pvcreate /dev/sda1 /dev/sdb1
For DASD devices:
# pvcreate /dev/dasda1 /dev/dasdb1
-
To create a volume group named
oracle_vg
using the devices that you marked, enter a command similar to the following:For SCSI devices:
# vgcreate oracle_vg /dev/sda1 /dev/sdb1
For DASD devices:
# vgcreate oracle_vg /dev/dasda1 /dev/dasdb1
-
To create the required logical volumes in the volume group that you created, enter commands similar to the following:
# lvcreate -L size -n lv_name vg_name
In this example:
-
size
is the size of the logical volume, for example500M
-
lv_name
is the name of the logical volume, for exampleorcl_system_raw_500m
-
vg_name
is the name of the volume group, for exampleoracle_vg
For example, to create a 500 MB logical volume for the SYSTEM tablespace for a database named
rac
in theoracle_vg
volume group, enter the following command:# lvcreate -L 500M -n rac_system_raw_500m oracle_vg
Note:
These commands create a device name similar to the following for each logical volume:/dev/vg_name/lv_name
-
-
On the other cluster nodes, enter the following commands to scan all volume groups and make them active:
# vgscan # vgchange -a y