扩展目标分区前提:
扩展的分区必须要是linux lvm卷如下截图(分区/dev/sda1不可以扩展,分区/dev/sda2可以扩展)
提示:决定linux lvm的因素是磁盘第一次分区时候选择的分区格式决定的。如下图列出了linux下支持的分区格式
SSH Secure Shell 3.2.9 (Build 283)
Copyright (c) 2000-2003 SSH Communications Security Corp - http://www.ssh.com/
This copy of SSH Secure Shell is a non-commercial version.
This version does not include PKI and PKCS #11 functionality.
Last login: Fri Dec 18 15:51:53 2015 from 192.168.19.1
1.查看当前磁盘空间
[root@mail ~]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 122M 0 122M 0% /dev
tmpfs 131M 0 131M 0% /dev/shm
tmpfs 131M 948K 130M 1% /run
tmpfs 131M 0 131M 0% /sys/fs/cgroup
/dev/mapper/fedora-root 18G 5.2G 12G 33% /
tmpfs 131M 8.0K 131M 1% /tmp
/dev/sda1 477M 99M 349M 23% /boot
tmpfs 27M 0 27M 0% /run/user/0
[root@mail ~]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 122M 0 122M 0% /dev
tmpfs 131M 0 131M 0% /dev/shm
tmpfs 131M 948K 130M 1% /run
tmpfs 131M 0 131M 0% /sys/fs/cgroup
/dev/mapper/fedora-root 18G 5.2G 12G 33% /
tmpfs 131M 8.0K 131M 1% /tmp
/dev/sda1 477M 99M 349M 23% /boot
tmpfs 27M 0 27M 0% /run/user/0
[root@mail ~]# fdisk -l
Disk /dev/sda: 30 GiB, 32212254720 bytes, 62914560 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x494832b4
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 1026047 1024000 500M 83 Linux
/dev/sda2 1026048 41943039 40916992 19.5G 8e Linux LVM
Disk /dev/mapper/fedora-swap: 2 GiB, 2147483648 bytes, 4194304 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/fedora-root: 17.5 GiB, 18798870528 bytes, 36716544 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
[root@mail ~]# pvdisplay
--- Physical volume ---
PV Name /dev/sda2
VG Name fedora
PV Size 19.51 GiB / not usable 3.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 4994
Free PE 0
Allocated PE 4994
PV UUID WX9LBx-nFSo-mVyM-3INs-T04v-lKg4-kXFiKk
[root@mail ~]# pvcreate /dev/sd
Device /dev/sd not found (or ignored by filtering).
[root@mail ~]# pvcreate /dev/sd*
Device /dev/sda not found (or ignored by filtering).
Can't open /dev/sda1 exclusively. Mounted filesystem?
Can't initialize physical volume "/dev/sda2" of volume group "fedora" without -ff
[root@mail ~]# pvcreate /dev/sdb
Device /dev/sdb not found (or ignored by filtering).
[root@mail ~]# pvdisplay /dev/sda2
--- Physical volume ---
PV Name /dev/sda2
VG Name fedora
PV Size 19.51 GiB / not usable 3.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 4994
Free PE 0
Allocated PE 4994
PV UUID WX9LBx-nFSo-mVyM-3INs-T04v-lKg4-kXFiKk
[root@mail ~]# pvdisplay /dev/sda3
Failed to find device for physical volume "/dev/sda3".
[root@mail ~]# df -lh
Filesystem Size Used Avail Use% Mounted on
devtmpfs 122M 0 122M 0% /dev
tmpfs 131M 0 131M 0% /dev/shm
tmpfs 131M 948K 130M 1% /run
tmpfs 131M 0 131M 0% /sys/fs/cgroup
/dev/mapper/fedora-root 18G 5.2G 12G 33% /
tmpfs 131M 8.0K 131M 1% /tmp
/dev/sda1 477M 99M 349M 23% /boot
tmpfs 27M 0 27M 0% /run/user/0
[root@mail ~]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 122M 0 122M 0% /dev
tmpfs 131M 0 131M 0% /dev/shm
tmpfs 131M 948K 130M 1% /run
tmp