Linux System/dev/mapper Directory

Source: Internet
Author: User

The generic file system name of the Linux system is similar to/DEV/SDA1 or/DEV/HDA1, but today, with the maintenance of the system, the DF-H command is used to knock out the/dev/mapper/volgroup-lv_root and/dev/mapper/ Volume-lv_home two file system name, puzzled, on the Internet to find information, in this talk about/dev/mapper directory.

First, understand the Linux system device mapper mechanism

Device Mapper is a mapping mechanism from logical devices to physical devices provided in the Linux2.6 kernel, where users can easily manage storage resources according to their needs. The logical Volume Manager under Linux is required for specific management, and the current popular logical Volume manager has LVM2 (Linux Volume Manager 2 version), EVMS (Enterprise Volume Management System), Dmraid (Device Mapper Raid Tool).

To learn more about the device mapper mechanism, refer to the blog http://blog.sina.com.cn/s/blog_6237dcca0100hnwb.html, which is not described here.

Ii. interpretation of the/dev/mapper catalogue

    for the sake of narration, suppose that a server has three drives for a,b,c, with a capacity of 1T per drive. In the installation of Linux, based on the system and its own needs to establish a basic partition, assume that the hard disk A is partitioned, the space is divided out of 0.1T in the/boot directory, the other hard disk is not partitioned. The system uses the device mapper mechanism to set up a volume group (volume GROUP,VG), you can view the VG as a resource pool, and then create a logical volume (logical VOLUME,LV) on the VG. To add the remaining space of hard disk A, hard disk B and hard drive C to the VG, the remaining space of hard disk A is first established as a physical volume (physical VOLUME,PV), and the physical volume is 0.9T, after which the remaining space of hard disk A, Hard disk B and hard drive C are added to the VG resource pool as PV, and then you need much space to carve out a large amount of space from the VG (not exceeding the capacity of the VG, of course). For example, the space in the pool is 2.9T, at which point you can build a space of more than 1T, rather than the largest capacity space in the past can only be 1T.

/dev/mapper/volume-lv_root means that you have a VG (Volume group) called Volume, and this Volume has a lv called Lv_root. In fact, this/dev/mapper/volume-lv_root file is a connection file, is connected to the/dev/dm-0, you can use the command ll/dev/mapper/volume-lv_root to view.

In fact, in the system/dev/volume/lv_root and/dev/mapper/volume-lv_root and/dev/dm-0 are a thing, can be treated as a partition.

To understand the specifics of your hard disk, you can view it by using FDISK or the Pvdisplay command.

If you want to reinstall the system to/DEV/SDA, and some things do not want to be formatted to transfer to/DEV/SDB, but at this time/dev/sda and/dev/sdb is put into the VG, then how to solve the problem? In this case, because there is no way to determine the data on which hard disk, because the two hard disks are added to the pool, is managed by device Mapper, so the solution is to build a logical volume, the data moved to the new volume, so that you can re-install the system only delete the previous partition of the things, And the new volume of things do not move, it will not be lost.


This article is from the "Dream to Reality" blog, please be sure to keep this source http://lookingdream.blog.51cto.com/5177800/1846427

Linux System/dev/mapper Directory

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.