/dev/sda2를 마운트하고 싶습니다. 어떻게 해야 하나요?
나는 이것을 시도했지만 결과를 확신할 수 없습니다. df
여전히 여유 공간이 표시되지 않습니다.
mount -v -o ro /dev/sda2 /data
mount: unknown filesystem type 'LVM2_member'
fdisk
다음은 , df
, lvmdiskscan
, lvdisplay
, vgdisplay
, lvscan
의 출력 입니다 pvdisplay
.
[root@IctThtSoluti-06 ~]# fdisk -l
Disk /dev/sda: 1030.8 GB, 1030792151040 bytes
255 heads, 63 sectors/track, 125320 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: 0x00034e05
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 1306 9972736 8e Linux LVM
Disk /dev/mapper/vg_centos6264bit-lv_root: 8095 MB, 8095006720 bytes
255 heads, 63 sectors/track, 984 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_centos6264bit-lv_swap: 2113 MB, 2113929216 bytes
255 heads, 63 sectors/track, 257 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
[root@IctThtSoluti-06 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_centos6264bit-lv_root
7.3G 988M 6.0G 14% /
tmpfs 3.9G 0 3.9G 0% /dev/shm
/dev/sda1 477M 64M 389M 15% /boot
[root@IctThtSoluti-06 ~]# lvmdiskscan
/dev/ram0 [ 16.00 MiB]
/dev/root [ 7.54 GiB]
/dev/ram1 [ 16.00 MiB]
/dev/sda1 [ 500.00 MiB]
/dev/vg_centos6264bit/lv_swap [ 1.97 GiB]
/dev/ram2 [ 16.00 MiB]
/dev/sda2 [ 9.51 GiB] LVM physical volume
/dev/ram3 [ 16.00 MiB]
/dev/ram4 [ 16.00 MiB]
/dev/ram5 [ 16.00 MiB]
/dev/ram6 [ 16.00 MiB]
/dev/ram7 [ 16.00 MiB]
/dev/ram8 [ 16.00 MiB]
/dev/ram9 [ 16.00 MiB]
/dev/ram10 [ 16.00 MiB]
/dev/ram11 [ 16.00 MiB]
/dev/ram12 [ 16.00 MiB]
/dev/ram13 [ 16.00 MiB]
/dev/ram14 [ 16.00 MiB]
/dev/ram15 [ 16.00 MiB]
2 disks
17 partitions
0 LVM physical volume whole disks
1 LVM physical volume
[root@IctThtSoluti-06 ~]# lvdisplay
--- Logical volume ---
LV Path /dev/vg_centos6264bit/lv_root
LV Name lv_root
VG Name vg_centos6264bit
LV UUID GuVsuq-Q0II-gcjX-6Pdp-7azY-FPub-25YWYR
LV Write Access read/write
LV Creation host, time ,
LV Status available
# open 1
LV Size 7.54 GiB
Current LE 1930
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
--- Logical volume ---
LV Path /dev/vg_centos6264bit/lv_swap
LV Name lv_swap
VG Name vg_centos6264bit
LV UUID Ukf2if-IlyB-95nM-8Gdq-XXI8-PcKT-fddsqR
LV Write Access read/write
LV Creation host, time ,
LV Status available
# open 1
LV Size 1.97 GiB
Current LE 504
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1
[root@IctThtSoluti-06 ~]# vgdisplay
--- Volume group ---
VG Name vg_centos6264bit
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size 9.51 GiB
PE Size 4.00 MiB
Total PE 2434
Alloc PE / Size 2434 / 9.51 GiB
Free PE / Size 0 / 0
VG UUID gG9yNW-Jq57-pFkY-oydY-5R4h-oHS0-W7QoWO
[root@IctThtSoluti-06 ~]# lvscan
ACTIVE '/dev/vg_centos6264bit/lv_root' [7.54 GiB] inherit
ACTIVE '/dev/vg_centos6264bit/lv_swap' [1.97 GiB] inherit
[root@IctThtSoluti-06 ~]# pvdisplay
--- Physical volume ---
PV Name /dev/sda2
VG Name vg_centos6264bit
PV Size 9.51 GiB / not usable 3.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 2434
Free PE 0
Allocated PE 2434
PV UUID 8sR1Mg-e4Pa-2FRI-hl1l-N4ns-mKjI-aszG8Y
[root@IctThtSoluti-06 ~]# vgdisplay vg_centos6264bit
--- Volume group ---
VG Name vg_centos6264bit
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size 9.51 GiB
PE Size 4.00 MiB
Total PE 2434
Alloc PE / Size 2434 / 9.51 GiB
Free PE / Size 0 / 0
VG UUID gG9yNW-Jq57-pFkY-oydY-5R4h-oHS0-W7QoWO
[root@IctThtSoluti-06 ~]# cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Tue Feb 4 21:48:23 2014
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/vg_centos6264bit-lv_root / ext4 defaults 1 1
UUID=795a0581-67ec-4fa0-ab81-79bb7cc111ab /boot ext4 defaults 1 2
/dev/mapper/vg_centos6264bit-lv_swap 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 proc defaults 0 0
답변1
lvm 드라이브를 직접 마운트할 수 없습니다.
/dev/sda2
루트 파티션과 스왑 파티션이 포함된 파티션입니다.
lvdisplay
논리 볼륨이 위치한 LV 경로를 표시합니다. 볼륨을 마운트하는 데 사용해야 하는 경로입니다.
답변2
1) 새로운 물리적 파티션 /dev/sda3을 생성합니다(그리고 여기에 lvm 플래그를 설정합니다). 이 작업을 수행parted
mkpart primary 0% 100%
set 3 lvm on
q
2) 새 /dev/sda3 파티션을 포함하도록 기존 볼륨 그룹을 확장합니다.
VG_NAME=`vgdisplay | grep "VG Name" | awk '{print $3}'`
vgextend $VG_NAME /dev/sda3
3) 논리 볼륨 생성(x를 기가바이트 크기로 대체)
LV_NAME=/dev/vg_centos6264bit/lv_data
lvcreate -L xG -n $LV_NAME $VG_NAME
4) 논리 볼륨에 파일 시스템을 생성합니다.
mkfs.ext4 $LV_NAME
5) 논리 볼륨 마운트
mkdir /data
mount $LV_NAME /data