Linux Disk Management-RAID5 and LVM

Source: Internet
Author: User

First, create RAID5 volume (soft RAID)
1, the newly added hard disk use a command can be scanned out to use

2. Disk Partitioning

Enter p to print out the partition as follows. (then finish typing w save exit fdisk partition Tool)

If the partition is complete without the device file/dev/sdb*, you can run the following command

3. Create a RAID5 volume

4. Mdadm Common Commands

5. Auto-Assemble RAID configuration

6. Format and set the boot automatically mount raid

7, the method of related information inquiry
View RAID Status

viewing partition information

8. After restarting Linux, the status should be like this
Input: mdadm-d/dev/md1 View

Df-th

Ii. Creating an LVM volume
1. Use FDISK to partition

Enter p to print the current partition, end still use W save to exit

2. Create the LVM process. (two LVM volumes are created, respectively, using the-l specified size and-L Specify the number of PE to create; When creating a VG, you can specify a single PE size with the-s option, without specifying a default of 4M)

3. View status
Volume Group Vgroup Status

Logical Volume Lvone Status

Logical Volume Lvtwo Status

4, format and automatic mount (execution mount-a will load the configuration in/etc/fstab, if there is no output, indicating that the mount is complete)

5, LV added capacity
Now my volume group has room, so you can add capacity directly to the LV (note that the difference between +16m and 16M is that if you write +16m, you add 16M; If you write 16M to increase to 16M)

If I need to increase the logical volume (LV) capacity by 100M Now, the volume group (VG) capacity is not enough; You can add a new physical volume (PV) to the volume group (VG).

Note: The lvtwo volume of the XFS file system, although it has increased capacity, does not directly mount the point/xiaoshou does not increase capacity. Such as

6. Since LVM supports increased capacity, it also supports reduced capacity; in production environments, reduced capacity is seldom used, only to understand.
Reduce the lvone of the Ext4 file system.

Note that lvtwo under the XFS file system does not support scaling.
7, LVM snapshot function.
Create an LVM volume using SSM and format it to mount under/test

Back up/etc/paswd in the/test directory

Create a snapshot of the moment, which can be viewed through lvscan. (The snapshot is also an LVM volume, which also takes up disk space)

The simulated backup file was mistakenly deleted

Lifting the Mount

Restore data from a/dev/vg_test/lv_test volume with a snapshot (the snapshot disappears when it is restored)

Re-mount, you can see the deleted backup files are recovered

Linux Disk Management-raid5 and LVM

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.