PV, VG, LV volume management and XFS format

Source: Internet
Author: User

1. PV command

PVCREATE/DEV/SDB1/DEV/SDC1/DEV/SDD1 can take multiple physical partitions and create physical volumes

PVS Lists all physical volumes

Pvscan Scan All physical volumes

Pvdisplay View all physical volume details


2. VG Command

Vgcreate VG1/DEV/SDB1/DEV/SDC1/DEV/SDD1 can take multiple partitions that are represented as physical volumes, set up a volume group

VGS List all volume groups

Vgscan Scan All volume groups

Vgdisplay View All Volume group details


3. LV command

Lvcreate-l 1024m-n lv1 vg1 a 1024M zone from the VG1 to create a logical volume LV1

Lvcreate-l 29.88t-n lv1 Vgmain

Lvs

Lvscan

Lvdisplay

LV1 will appear in/dev/vgmain.


4, MOUNT, MKFS

MOUNT/DEV/VGMAIN/LV1/MNT Mount

Mkfs.ext3/dev/vgmain/lv1

In the Ext3 file system

Block size maximum file Max file system

1KB 16G 2T

2KB 256G 8T

4KB 2T 16T

8KB 16T 32T

Therefore, the above format will be an error. The system default fast size is 4KB, if the maximum system file size has been exceeded. Therefore, you need to modify the block size. or divided into multiple partitions (no more than 16T).

# Mkfs.ext3-b 8192/dev/vgmain/lv1 (Mount when 8192 did not succeed)


5. XFS (Installed on rhel6)

Yum Install Kmod-xfs Xfsprogs
Modprobe XFS//Loading XFS file system module
Lsmod |grep XFS//See if XFS modules are loaded

Format and Mount with XFS
—————————————————————————————
Mkfs.xfs/dev/vg1/lv1
Mount-t Xfs/dev/vg1/lv1/lvdisk

Add to Fstab let system start auto mount
—————————————————————————————————————-

Vi/etc/fstab//Open Fstab
Uuid=c3749d2d-08b5-45a3-9aa4-312b6161d471/data XFS Defaults 1 2//Add mount information Specify file system XFS (UUID obtained by BLKID/DEV/SDB1 command)


6. Bare Equipment (Udev)

No formatting XFS is also available, and can be exported directly using the UDEV device

Vim/etc/udev/rules.d/60-raw.rules

Join:

action== "Add", kernel== "Lv1", run+= "/bin/raw/dev/raw/raw1%N"

Vim/etc/rc.local

Join:

Chown Root:root:/DEV/RAW/RAW1

chmod 777/DEV/RAW/RAW1

VIM/


This article is from the "7727197" blog, please be sure to keep this source http://7737197.blog.51cto.com/7727197/1663085

PV, VG, LV volume management and XFS format

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.