前言:
同事叫把/dev/sda7 磁盘挂载到/data目录,当执行mount时报"mount: unknown filesystem type 'LVM2_member' "错,如下为解决方案和思路;
注释
:报错有提到为识别filesystem type 'LVM2_member' 磁盘;
情况1 未创建逻辑卷/卷组和格式化分区引起 -->本次问题
情况2 逻辑卷 卷状态信息失效'
unenable
'
列出
/dev/sda7
分区信息:
[root@Database-backup ~]# fdisk -l| grep sda7
/dev/sda7 17258 91380 595382272 8e Linux LVM
[root@Database-backup ~]#
/dev/sda7 17258 91380 595382272 8e Linux LVM
[root@Database-backup ~]#
复现报错:
[root@Database-backup ~]# mount /dev/sda7 /data/
mount: unknown filesystem type 'LVM2_member'
[root@Database-backup ~]#
mount: unknown filesystem type 'LVM2_member'
[root@Database-backup ~]#
情况1
查看物理卷:
[root@Database-backup ~]# pvdisplay
"/dev/sda7" is a new physical volume of "567.80 GiB"
--- NEW Physical volume ---
PV Name /dev/sda7
VG Name -->没数据...
PV Size 567.80 GiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID 2N99xd-jlWG-Yo1e-kAbI-DsmL-syyd-At8EHx
--- NEW Physical volume ---
PV Name /dev/sda7
VG Name -->没数据...
PV Size 567.80 GiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID 2N99xd-jlWG-Yo1e-kAbI-DsmL-syyd-At8EHx
[root@Database-backup ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/sda7 lvm2 a-- 567.80g 567.80g
[root@Database-backup ~]#
PV VG Fmt Attr PSize PFree
/dev/sda7 lvm2 a-- 567.80g 567.80g
[root@Database-backup ~]#
查看逻辑卷
[root@Database-backup ~]# lvdisplay
No volume groups found
[root@Database-backup ~]#
[root@Database-backup ~]# lvdisplay
No volume groups found
[root@Database-backup ~]#
查看卷组
[root@Database-backup ~]# vgs
No volume groups found
No volume groups found
[root@Database-backup ~]#
*** 创建卷组/逻辑卷~ 即可解决本次mount 报错问题
创建卷组
[root@Database-backup ~]# vgcreate vgdata /dev/sda7 ##vgdata为卷组名
Volume group "vgdata" successfully created
Volume group "vgdata" successfully created
[root@Database-backup ~]#
查看创建结果
[root@Database-backup ~]# vgs
VG #PV #LV #SN Attr VSize VFree
vgdata 1 0 0 wz--n- 567.80g 567.80g
VG #PV #LV #SN Attr VSize VFree
vgdata 1 0 0 wz--n- 567.80g 567.80g
[root@Database-backup ~]# vgdisplay
--- Volume group ---
VG Name vgdata
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 1
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 567.80 GiB
PE Size 4.00 MiB
Total PE 145356
Alloc PE / Size 0 / 0
Free PE / Size 145356 / 567.80 GiB
VG UUID DE9P00-BZTa-n80p-tdVJ-M1dA-6iOW-lif2Ye
创建逻辑卷:
[root@Database-backup ~]# lvcreate -L 559G vgdata -n lvolhome /dev/sda7
[root@Database-backup ~]# lvdisplay
[root@Database-backup ~]# mount /dev/sda7 /data/
mount: unknown filesystem type 'LVM2_member'
[root@Database-backup ~]#
[root@Database-backup ~]#
格式化分区:
[root@Database-backup ~]# mkfs.ext4 /dev/sda7
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
37216256 inodes, 148845568 blocks
7442278 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
4543 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 24 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@Database-backup ~]#
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
37216256 inodes, 148845568 blocks
7442278 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
4543 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 24 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@Database-backup ~]#
再挂载:
[root@Database-backup ~]# mount /dev/sda7 /data/
[root@Database-backup ~]# df -hl
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 50G 374M 47G 1% /
tmpfs 939M 0 939M 0% /dev/shm
/dev/sda1 194M 28M 157M 15% /boot
/dev/sda3 40G 544M 37G 2% /usr
/dev/sda5 40G 197M 38G 1% /var
/dev/sda7 559G 198M 531G 1% /data
[root@Database-backup ~]#
[root@Database-backup ~]# df -hl
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 50G 374M 47G 1% /
tmpfs 939M 0 939M 0% /dev/shm
/dev/sda1 194M 28M 157M 15% /boot
/dev/sda3 40G 544M 37G 2% /usr
/dev/sda5 40G 197M 38G 1% /var
/dev/sda7 559G 198M 531G 1% /data
[root@Database-backup ~]#
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/28602568/viewspace-1797429/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/28602568/viewspace-1797429/