Linux disk relationship knowledge
I have learned more or less about linux disk management, including hard disks, logical disks, and lvm, however, I encountered a lot of problems and confusions when I checked the linux database yesterday. I also reviewed the related knowledge.
First, let's take a look at the disk situation: df-k
File System 1 K-block used available % mount point
/Dev/mapper/vg_sspdb1-lv_root
51606140 2754580 46230120 6%/
Tmpfs 32984140 0 32984140 0%/dev/shm
/Dev/sda1 495844 38042 432202 9%/boot
/Dev/mapper/vg_sspdb1-lv_home
777577944 201368 737877824 1%/home
/Dev/mapper/ssp-data 1078031100 206080 1023064216 1%/opt/sspdata
After reading this, I felt that the partition was not reasonable, so I checked the disk: fdisk-l
Disk/dev/sda: 897.0 GB, 896998047744 bytes
255 heads, 63 sectors/track, 109053 cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Sector size (logical/physical): 512 bytes/512 bytes
I/O size (minimum/optimal): 512 bytes/512 bytes
Disk identifier: 0x0007306b
Note: This disk is divided into two partitions: linux partitions and lvm partitions.
Device Boot Start End Blocks Id System
/Dev/sda1*1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/Dev/sda2 64 109054 875461632 8e Linux LVM
Note: The following three partitions are linux lv partitions, which are the lv partitions under vg.
Disk/dev/mapper/vg_sspdb1-lv_root: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Sector size (logical/physical): 512 bytes/512 bytes
I/O size (minimum/optimal): 512 bytes/512 bytes
Disk identifier: 0x00000000
Disk/dev/mapper/vg_sspdb1-lv_swap: 33.8 GB, 33848033280 bytes
255 heads, 63 sectors/track, 4115 cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Sector size (logical/physical): 512 bytes/512 bytes
I/O size (minimum/optimal): 512 bytes/512 bytes
Disk identifier: 0x00000000
Disk/dev/mapper/vg_sspdb1-lv_home: 808.9 GB, 808934440960 bytes
255 heads, 63 sectors/track, 98347 cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Sector size (logical/physical): 512 bytes/512 bytes
I/O size (minimum/optimal): 512 bytes/512 bytes
Disk identifier: 0x00000000
Disk/dev/sdb: 1121.5 GB, 1121501315072 bytes
255 heads, 63 sectors/track, 136348 cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Sector size (logical/physical): 512 bytes/512 bytes
I/O size (minimum/optimal): 512 bytes/512 bytes
Disk identifier: 0x00000000
Disk/dev/sdc: 1121.5 GB, 1121501315072 bytes
255 heads, 63 sectors/track, 136348 cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Sector size (logical/physical): 512 bytes/512 bytes
I/O size (minimum/optimal): 512 bytes/512 bytes
Disk identifier: 0x00000000
This partition is very strange at the time. It seems that I have never understood it, and the name is strange. It is not like vg or lv partition. I will continue to explain it later.
Disk/dev/mapper/ssp-data: 1121.5 GB, 1121501315072 bytes
255 heads, 63 sectors/track, 136348 cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Sector size (logical/physical): 512 bytes/512 bytes
I/O size (minimum/optimal): 512 bytes/512 bytes
Disk identifier: 0x00000000
Check the pv information first to know that pv is composed of the second disk of the first hard disk: pvdisplay
--- Physical volume ---
PV Name/dev/sda2
VG Name vg_sspdb1
PV Size 834.91 GiB/not usable 3.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 213735
Free PE 0
Allocated PE 213735.
Pvuuid JIOUSx-HSBm-L1uJ-roee-DARr-BMRw-XfgeRP
Check the vg information: vgdisplay.
--- Volume group ---
VG Name vg_sspdb1
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 4
VG Access read/write
VG Status resizable
Max lv 0
Cur LV 3
Open LV 3
Max PV 0
Cur PV 1
Act PV 1
VG Size 834.90 GiB
PE Size 4.00 MiB
Total PE 213735
Alloc PE/Size 213735/834 .90 GiB
Free PE/Size 0/0
Vg uuid 5fmSVl-1ZfR-Z01F-Ktx0-qeKg-rB97-wxk27c
Then query the question about lv verification: lvdisplay
--- Logical volume ---
LV Path/dev/vg_sspdb1/lv_root
LV Name lv_root
VG Name vg_sspdb1
Lvuuid gxYyXJ-KdQY-XivF-ZfH8-ET7H-gX5Y-WjAVak
LV Write Access read/write
LV Creation host, time ssp-db-1, 17:42:41 + 0800
LV Status available
# Open 1
LV Size 50.00 GiB
Current LE 12800
Segments 1
Allocation inherit
Read ahead sectors auto
-Currently sets to 256
Block device 253: 0
--- Logical volume ---
LV Path/dev/vg_sspdb1/lv_home
LV Name lv_home
VG Name vg_sspdb1
Lvuuid NprKvy-Uc76-JjHf-oZo2-LxBR-NS59-ima9VJ
LV Write Access read/write
LV Creation host, time ssp-db-1, 17:42:46 + 0800
LV Status available
# Open 1
LV Size 753.38 GiB
Current LE 192865
Segments 1
Allocation inherit
Read ahead sectors auto
-Currently sets to 256
Block device 253: 2
--- Logical volume ---
LV Path/dev/vg_sspdb1/lv_swap
LV Name lv_swap
VG Name vg_sspdb1
Lvuuid hD9Hx9-EonS-RpBH-Qiv0-s4kY-PeXv-Z6RaNG
LV Write Access read/write
LV Creation host, time ssp-db-1, 17:43:52 + 0800
LV Status available
# Open 1
LV Size 31.52 GiB
Current LE 8070
Segments 1
Allocation inherit
Read ahead sectors auto
-Currently sets to 256
Blocks device 253: 1
I learned from the above query that I have probably understood the relationship in it, but the problem is/dev/mapper/ssp-data. The disk information has never been known from where:
Then let's take a look at the hard disk information. Through this information, we can know the relationship between lv and dm. Block device 253: 1 is related to the following major minor: cat/proc/partitions.
Major minor # blocks name
8, 0, 875974656, sda
8 1 512000 sda1
8 2 875461632 sda2
253 0 52428800 dm-0
253 1 33054720 dm-1
253 2 789975040 dm-2
8 16 1095216128 sdb
8 32 1095216128 sdc
253 3 1095216128 dm-3
Then, query the details of/dev/mapper/and see that the above name is very similar to the fdisk-l NAME. below is the correspondence between the lv name and the hard disk, so what we see from df-k is the name of the vg_sspdb1-lv_home, it is actually a shortcut: ll/dev/mapper/
Total usage 0
Crw-rw ----. 1 root 10, December 22 11:35 control
Lrwxrwxrwx. 1 root 7 December 22 11:45 ssp-data-> ../dm-3
Lrwxrwxrwx. 1 root 7 December 22 11:35 vg_sspdb1-lv_home-> ../dm-2
Lrwxrwxrwx. 1 root 7 December 22 11:35 vg_sspdb1-lv_root-> ../dm-0
Lrwxrwxrwx. 1 root 7 December 22 11:35 vg_sspdb1-lv_swap-> ../dm-1
However, we do not know where ssp-data comes from.
Then let's take a look at the information about the storage device and its file system: cat/etc/fstab.
/Dev/mapper/vg_sspdb1-lv_root/ext4 ults 1 1
UUID = 1f705c1d-fc2c-43ee-87af-4900830a3ec0/boot ext4 ults 1 2
/Dev/mapper/vg_sspdb1-lv_home/home ext4 defaults 1 2
/Dev/mapper/vg_sspdb1-lv_swap swap defaults 0 0
Tmpfs/dev/shm tmpfs defaults 0 0
Devpts/dev/pts devpts gid = 5, mode = 620 0 0
Sysfs/sys sysfs defaults 0 0
Proc/proc defaults 0 0
/Dev/mapper/ssp-data/opt/sspdata ext4 _ netdev 0 0
From the above analysis, we found that the ssp-data type is _ netdev, And the name is network-related. We are continuing to query.
Check the iscsi storage, indicating that storage is enabled during this period.
Ps-ef | grep iscsi
Root 2074 1972 10 00:00:00 pts/0 grep iscsi
[Root @ justin Packages] # chkconfig -- list | grep iscsi
Iscsi 0: off 1: off 2: off 3: on 4: on 5: on 6: off
Iscsid 0: off 1: off 2: off 3: on 4: on 5: on 6: off
Check the iscsi information.
More/etc/iscsi/initiatorname. iscsi
InitiatorName = iqn.1994-05.com. redhat: 4ef28aa338b5
Display disk array: iscsiadm-m node
10.11.102.2: 3260,9 iqn.2000-09.com. fujitsu: storage-system.eternus-dx400: 00C0C1P0
View File Information: ls/var/lib/iscsi/nodes/
Iqn.2000-09.com. fujitsu: storage-system.eternus-dx400: 00C0C1P0
Then the query indicates that there is a multi-path startup: ps-ef | grep multipathd
Root 2726, 1 0 2014? 00:01:50/sbin/multipathd
Root 10379 10358 0 00:00:00 pts/1 grep multipathd
Then view: multipath-ll
Ssp-data (3600000e00d0000000100846001f0000) dm-3 FUJITSU, ETERNUS_DX400
Size = 1.0 T features = '1 queue_if_no_path 'hwhandler = '0' wp = rw
|-+-Policy = 'round-robin 0' prio = 130 status = active
| '-14: 0: 0: 0 sdb 8: 16 active ready running
'-+-Policy = 'round-robin 0' prio = 10 status = enabled
'-13: 0: 0: 0 sdc 8: 32 active ready running
Then the name corresponds to the name in fdisk-l.