Use of Linux LVM raw devices

Source: Internet
Author: User
Tags dba file size file system linux

1. Create PV

PVCREATE-M2--metadatasize 100M/DEV/SDA

PVCREATE-M2--metadatasize 100M/DEV/SDB1

PVCREATE-M2--metadatasize 100M/DEV/SDB2

PVCREATE-M2--metadatasize 100M/DEV/SDC

The physical volume can be an entire hard disk (LUN) or a partition on the hard disk

Add:

Metadata (meta data) is about data warehouse data, which is the key data related to data source definition, target definition, conversion rule and so on in the process of data warehouse construction.

Metadata (meta data), the definition of a table in a database, the definition of a field, the definition of a tuple, and so on, are the most basic description in a database, so it is called metadata. Also known as the Data directory, database about the database.

When a data is stored in a shared volume, we can see directly that it is a document, or a picture, or a video, or a database file, which is the data itself. However, when the data is stored, the file system also produces a lot of data that cannot be seen directly, such as file retrieval table, path information, address information, etc. in the file system, which is called the metadata of documents, pictures, videos, etc. in the shared volume.

The main content of San networked storage sharing software management is metadata, which controls the transmission of metadata between multiple hosts.

We can see the storage of metadata in many places, online down the movie itself a video file data, and click the right button to see the video file properties, such as storage path, rate, file size, and director, actor, production units, etc. is the video file metadata.

-M2 specify meta data using LVM2 format

2. Create VG

Vgcreate vg_db/dev/sda/dev/sdb1/dev/sdb2/dev/sdc-s 128m

-S,--physicalextentsize PHYSICALEXTENTSIZE[KKMMGGTT]

Sets The physical extent size on physical volumes to this volume group.

3. Create LV

Lvcreate-l 2048m-i4-i 64k Vg_db-n lv_2g_001

Lvcreate-l 2048m-i4-i 64k Vg_db-n lv_2g_002

4. Binding

raw/dev/raw/raw1/dev/mapper/vg_db-lv_2g_001

raw/dev/raw/raw2/dev/mapper/vg_db-lv_2g_002

Notice the way the name of the LV is named, which is broken down as follows:

/dev/mapper/vgname '-' lvname.

A bare device that is bound with the raw command will fail after reboot.

* For AS4

So you need to modify the/etc/sysconfig/rawdevices configuration file and add the following in the file (one line per bare device):

/dev/raw/raw1/dev/mapper/vg_db-lv_2g_001

/dev/raw/raw2/dev/mapper/vg_db-lv_2g_002

Perform/etc/init.d/rawdevices restart to make the bare device in the configuration file effective

Perform/sbin/chkconfig rawdevices on to ensure that the bare devices are loaded when the machine starts

* For AS5

Raw Device Mappings

This article URL address: http://www.bianceng.cn/OS/Linux/201410/45424.htm

Raw device interfaces have been canceled in Red Hat Enterprise Linux 5; Raw device mappings are now configured with Udev rules. To configure raw device mappings, you can include entries in the following format in/etc/udev/rules.d/60-raw.rules:

Device Name:

action== "Add", kernel= "<device name>", run+= "Raw/dev/raw/rawx%N"

Primary/Secondary Number:

action== "Add", env{major}= "A", env{minor}= "B", run+= "raw/dev/raw/rawx,%m%m"

Replace the <device name> (for example:/DEV/SDA1) with the name of the device you want to bind to. "A" and "B" are the primary/secondary numbers for the device, and X is the raw device number used by the system.

Another thing about the configuration here is that it's very strange that I see the kernel== or env{major in the official Red Hat documentation about Raw.rule ... Only need to configure any one on it, but I found in the specific configuration of the hundred test, I tried a variety of combinations found not effective, must both be configured to

5. Authorization

Chown-r Oracle.dba/dev/mapper

Modify configuration file/etc/udev/permissions.d/50-udev.permissions

Comment out raw/*:root:disk:0660

Add New Row raw/*:oracle:dba:0660

6. Link (optional)

Ln-s/dev/raw/raw1/oradata/ningoo/system01.dbf

Ln-s/dev/raw/raw2/oradata/ningoo/undo01.dbf

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.