linux逻辑卷管理(LVM)
1. 逻辑卷(LVM)的原理
LVM(Logical Volume Manager)逻辑卷管理 是在物理磁盘和文件系统的之间添加一个逻辑层,通过对底层物理磁盘的封装,以逻辑卷的方式呈现给上层应用,通过对逻辑卷的操作来管理底层物理磁盘
2. LVM 中的基本术语
物理存储介质(The physical media): 可以使整个磁盘、磁盘分区、RAID阵列、SAN磁盘,这些设备必须初始化为LVM物理卷,才可以与LVM 结合使用
物理卷PV(Physical Volume):LVM基本的存储逻辑块,包含了物理介质没有的LVM相关的管理参数
卷组VG(Volume Group):由一个或多个PV组成
逻辑卷LV(Logical Volume):LV是建立在VG上,VG可以把部分磁盘空间给LV,也可以把全部的磁盘空间给LV,可以在LV上创建文件系统
PE(Physical extent):PV可以分配的最小存储单位
LE(Logical extent):LV中可以分配的最小存储单位,在同一个卷组中,LE与PE大小相同
lvm常用的命令
功能 PV管理命令 VG管理命令 LV管理命令
scan 扫描 pvscan vgscan lvscan
create 创建 pvcreate vgcreate lvcreate
display显示 pvdisplay vgdisplay lvdisplay
remove 移除 pvremove vgremove lvremove
extend 扩展 vgextend lvextend
reduce减少 vgreduce lvreduce
查看卷名 简单对应卷信息的查看 扫描相关的所有的对应卷 详细对应卷信息的查看
物理卷 pvs pvscan pvdisplay
卷组 vgs vgscan vgdisplay
逻辑卷 lvs lvscan lvdisplay
3.LVM的优点
1.使用VG对多个物理磁盘空间进行整合,变成一个大磁盘
2.使用LVM可以跨越多个磁盘分区,动态的调整逻辑卷的大小,扩容、缩减、删除
3.可以调整基于LVM上创建的文件系统的大小
4.可以创建快照,来备份文件系统
4.创建LVM
步骤:
创建PV——>创建VG——>创建LV——>格式化LV成文件系统——>挂载LV
先通过fdisk切割出磁盘分区
查看系统上的磁盘
[root@test01 Desktop]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda : 20G disk
├─sda1 : 300M part /boot
├─sda2 : .7G part
│ └─rhel-rootlv : .7G lvm /
├─sda3 : 2G part [SWAP]
├─sda4 : 1K part
└─sda5 8:5 0 300M 0 part ==>这是我新建的一个分区
创建PV:
创建PV:
[root@test01 Desktop]# pvcreate /dev/sda5
Physical volume "/dev/sda5" successfully created
扫描PV
[root@test01 Desktop]# pvscan
PV /dev/sda2 VG rhel lvm2 [14.64 GiB / free]
PV /dev/sda5 lvm2 [300.00 MiB] 显示PV的详细信息,后面不接PV名,会显示所有的PV信息
[root@test01 Desktop]# pvdisplay /dev/sda5
"/dev/sda5" is a new physical volume of "300.00 MiB"
--- NEW Physical volume ---
PV Name /dev/sda5
VG Name
PV Size 300.00 MiB
Allocatable NO
PE Size
Total PE
Free PE
Allocated PE
PV UUID YQbqqb-V3Wl-ot8s-SUR5-rsQL-oqdw-7fdzHa
创建VG:
创建VG
[root@test01 Desktop]# vgcreate -s 16m testvg /dev/sda5
Volume group "testvg" successfully created
-s:是为了指定VG的PE的大小为16m,testvg是VG的名字,/dev/sda5是成为PV的磁盘分区设备名,多个磁盘可以写成/dev/sda{5,6,7};
扫描VG
[root@test01 Desktop]# vgscan
Reading all physical volumes. This may take a while...
Found volume group "rhel" using metadata type lvm2
Found volume group "testvg" using metadata type lvm2
显示VG的详细信息,若后面不接VG名,会显示系统上所有VG的信息
[root@test01 Desktop]# vgdisplay testvg
--- Volume group ---
VG Name testvg
System ID
Format lvm2
Metadata Areas
Metadata Sequence No
VG Access read/write
VG Status resizable
MAX LV
Cur LV
Open LV
Max PV
Cur PV
Act PV
VG Size 288.00 MiB
PE Size 16.00 MiB ==>PE大小:16m
Total PE
Alloc PE / Size /
Free PE / Size / 288.00 MiB
VG UUID eaUhl0-LvkR-Ebou-BXHa-ZnIb-DEza-qFZYbO
创建LV:
创建LV:
方法一:-L:指定LV的大小为200M,-n:指定LV的名字为testlv ,最后指定的VG的名字
[root@test01 Desktop]# lvcreate -L 200M -n testlv testvg
Rounding up size to full physical extent 208.00 MiB
Logical volume "testlv" created
方法二:-l(小写的L):通过指定PE的个数来指定LV的大小,上面我们的设定PE是16M,这里指定10个单位的PE,则LV大小是160M
[root@test01 Desktop]# lvcreate -l -n testlv testvg
扫描LV
[root@test01 Desktop]# lvscan
ACTIVE '/dev/rhel/rootlv' [14.64 GiB] inherit
ACTIVE '/dev/testvg/testlv' [208.00 MiB] inherit 显示LV的详细信息,后面接的LV名得用绝对路径表示,不然报错找不到
[root@test01 Desktop]# lvdisplay testlv
Volume group "testlv" not found
Skipping volume group testlv [root@test01 Desktop]# lvdisplay /dev/testvg/testlv
--- Logical volume ---
LV Path /dev/testvg/testlv
LV Name testlv
VG Name testvg
LV UUID VpC2SC-qpos-mCWn-F44a-RE6e-XVcu-LUK1j2
LV Write Access read/write
LV Creation host, time test01, -- :: +
LV Status available
# open
LV Size 208.00 MiB
Current LE
Segments
Allocation inherit
Read ahead sectors auto
- currently set to
Block device :
格式化逻辑卷
格式化为ext4文件系统,也可以使用mkfs -t ext4
[root@test01 Desktop]# mkfs.ext4 /dev/testvg/testlv
mke2fs 1.42. (-Dec-)
Filesystem label=
OS type: Linux
Block size= (log=)
Fragment size= (log=)
Stride= blocks, Stripe width= blocks
inodes, blocks
blocks (5.00%) reserved for the super user
First data block=
Maximum filesystem blocks=
block groups
blocks per group, fragments per group
inodes per group
Superblock backups stored on blocks:
, , , , , Allocating group tables: done
Writing inode tables: done
Creating journal ( blocks): done
Writing superblocks and filesystem accounting information: done
挂载
[root@test01 Desktop]# mkdir /mnt/test
[root@test01 Desktop]# mount /dev/testvg/testlv /mnt/test
[root@test01 Desktop]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/rhel-rootlv xfs 15G .3G 11G % /
devtmpfs devtmpfs 481M 481M % /dev
tmpfs tmpfs 490M 140K 490M % /dev/shm
tmpfs tmpfs 490M 7.1M 483M % /run
tmpfs tmpfs 490M 490M % /sys/fs/cgroup
/dev/sr0 iso9660 .5G .5G % /mnt/cdrom
/dev/sda1 xfs 297M 109M 189M % /boot
/dev/mapper/testvg-testlv ext4 198M 1.8M 182M % /mnt/test
永久挂载,编辑/etc/fstab文件最后一行编辑
[root@test01 Desktop]# vim /etc/fstab
/dev/testvg/testlv /mnt/test ext4 defaults
5.LVM扩容,文件系统扩容,可以在线扩容
步骤:
1.vgdispaly查看VG的磁盘空间————>2.空间足够,直接 lvresize 增加LV空间容量————>3.调整文件系统大小,ext文件系统使用 resize2fs,xfs文件系统使用xfs_growfs
若空间不够,则需要1.先创建新的PV——>2.VG扩容,使用 vgextend ——>3.再给LV扩容——>4.再调整文件系统
先通过vgdisplay 命令查看该VG是否还有空余的空间,若剩余空间可以满足需求则直接调整LV的大小,再调整文件系统的大小,如若无法满足则需要新建一个PV,加入到VG中
[root@test01 Desktop]# vgdisplay testvg
--- Volume group ---
VG Name testvg
System ID
Format lvm2
Metadata Areas
Metadata Sequence No
VG Access read/write
VG Status resizable
MAX LV
Cur LV
Open LV
Max PV
Cur PV
Act PV
VG Size 288.00 MiB
PE Size 16.00 MiB
Total PE
Alloc PE / Size / 208.00 MiB
Free PE / Size 5 / 80.00 MiB ==> 还有5个PE,80M的空间
VG UUID eaUhl0-LvkR-Ebou-BXHa-ZnIb-DEza-qFZYbO
第一种情况:通过VG剩余的空间扩容
调整LVM的大小为250M,-L:250M
[root@test01 Desktop]# lvresize -L 250M /dev/testvg/testlv
Rounding size to boundary between physical extents: 256.00 MiB
Extending logical volume testlv to 256.00 MiB
Logical volume testlv successfully resized
[root@test01 Desktop]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rhel-rootlv 15G .3G 11G % /
devtmpfs 481M 481M % /dev
tmpfs 490M 140K 490M % /dev/shm
tmpfs 490M 7.1M 483M % /run
tmpfs 490M 490M % /sys/fs/cgroup
/dev/sr0 .5G .5G % /mnt/cdrom
/dev/sda1 297M 109M 189M % /boot
/dev/mapper/testvg-testlv 198M 1.8M 182M 1% /mnt/test ==>文件系统并未变化
该调整文件系统大小
[root@test01 Desktop]# resize2fs /dev/testvg/testlv
resize2fs 1.42. (-Dec-)
Filesystem at /dev/testvg/testlv is mounted on /mnt/test; on-line resizing required
old_desc_blocks = , new_desc_blocks =
The filesystem on /dev/testvg/testlv is now blocks long. [root@test01 Desktop]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rhel-rootlv 15G .3G 11G % /
devtmpfs 481M 481M % /dev
tmpfs 490M 140K 490M % /dev/shm
tmpfs 490M 7.1M 483M % /run
tmpfs 490M 490M % /sys/fs/cgroup
/dev/sr0 .5G .5G % /mnt/cdrom
/dev/sda1 297M 109M 189M % /boot
/dev/mapper/testvg-testlv 244M 2.1M 226M 1% /mnt/test ==>文件系统大小已变更
[root@test01 Desktop]# lvscan
ACTIVE '/dev/rhel/rootlv' [14.64 GiB] inherit
ACTIVE '/dev/testvg/testlv' [256.00 MiB] inherit
第二种情况:新建一个PV加入到VG中
[root@test01 Desktop]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda : 20G disk
├─sda1 : 300M part /boot
├─sda2 : .7G part
│ └─rhel-rootlv : .7G lvm /
├─sda3 : 2G part [SWAP]
├─sda4 : 1K part
├─sda5 : 300M part
│ └─testvg-testlv : 256M lvm /mnt/test
└─sda6 8:6 0 300M 0 part ==>新加的分区
新建一个PV
[root@test01 Desktop]# pvcreate /dev/sda6
Physical volume "/dev/sda6" successfully created
把新建的PV加入到VG中
[root@test01 Desktop]# vgextend testvg /dev/sda6
Volume group "testvg" successfully extended
[root@test01 Desktop]# vgs testvg
VG #PV #LV #SN Attr VSize VFree
testvg wz--n- 576.00m 320.00m
[root@test01 Desktop]# vgdisplay testvg
--- Volume group ---
VG Name testvg
System ID
Format lvm2
Metadata Areas
Metadata Sequence No
VG Access read/write
VG Status resizable
MAX LV
Cur LV
Open LV
Max PV
Cur PV
Act PV
VG Size 576.00 MiB
PE Size 16.00 MiB
Total PE
Alloc PE / Size 16 / 256.00 MiB
Free PE / Size 20 / 320.00 MiB ==>剩余的空间为320M
VG UUID eaUhl0-LvkR-Ebou-BXHa-ZnIb-DEza-qFZYbO
LV扩容
[root@test01 Desktop]# lvresize -L 480M /dev/testvg/testlv
Extending logical volume testlv to 480.00 MiB
Logical volume testlv successfully resized
[root@test01 Desktop]# lvscan
ACTIVE '/dev/rhel/rootlv' [14.64 GiB] inherit
ACTIVE '/dev/testvg/testlv' [480.00 MiB] inherit 调整文件系统大小
[root@test01 Desktop]# resize2fs /dev/testvg/testlv
resize2fs 1.42. (-Dec-)
Filesystem at /dev/testvg/testlv is mounted on /mnt/test; on-line resizing required
old_desc_blocks = , new_desc_blocks =
The filesystem on /dev/testvg/testlv is now blocks long. [root@test01 Desktop]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/rhel-rootlv xfs 15G .3G 11G % /
devtmpfs devtmpfs 481M 481M % /dev
tmpfs tmpfs 490M 140K 490M % /dev/shm
tmpfs tmpfs 490M 7.1M 483M % /run
tmpfs tmpfs 490M 490M % /sys/fs/cgroup
/dev/sr0 iso9660 .5G .5G % /mnt/cdrom
/dev/sda1 xfs 297M 109M 189M % /boot
/dev/mapper/testvg-testlv ext4 461M 2.3M 434M 1% /mnt/test ==>文件系统再一次变大
若是XFS文件系统,调整文件系统的命令则是
[root@test01 Desktop]# xfs_growfs /dev/testvg/testlv
6.LVM缩减,不支持在线缩减,必须先卸载文件系统
步骤:
卸载文件系统——>(e2fsck -f )检查文件系统——>调整文件系统大小——>调整LVM——>挂载文件系统
卸载文件系统
[root@test01 Desktop]# umount /mnt/test/
[root@test01 Desktop]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rhel-rootlv 15G .3G 11G % /
devtmpfs 481M 481M % /dev
tmpfs 490M 140K 490M % /dev/shm
tmpfs 490M 7.1M 483M % /run
tmpfs 490M 490M % /sys/fs/cgroup
/dev/sr0 .5G .5G % /mnt/cdrom
/dev/sda1 297M 109M 189M % /boot
变更文件系统大小
[root@test01 Desktop]# resize2fs /dev/testvg/testlv 160M
resize2fs 1.42. (-Dec-)
Please run 'e2fsck -f /dev/testvg/testlv' first.
得先强制检查一下文件系统,再调整文件系统大小
[root@test01 Desktop]# e2fsck -f /dev/testvg/testlv
e2fsck 1.42. (-Dec-)
Pass : Checking inodes, blocks, and sizes
Pass : Checking directory structure
Pass : Checking directory connectivity
Pass : Checking reference counts
Pass : Checking group summary information
/dev/testvg/testlv: / files (0.0% non-contiguous), / blocks
调整文件系统大小为160M
[root@test01 Desktop]# resize2fs /dev/testvg/testlv 160M
resize2fs 1.42. (-Dec-)
Resizing the filesystem on /dev/testvg/testlv to (1k) blocks.
The filesystem on /dev/testvg/testlv is now blocks long.
缩减LV
调整LVM的大小为160
[root@test01 Desktop]# lvresize -L 160M /dev/testvg/testlv
WARNING: Reducing active logical volume to 160.00 MiB
THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce testlv? [y/n]: y
Reducing logical volume testlv to 160.00 MiB
Logical volume testlv successfully resized
[root@test01 Desktop]# lvscan
ACTIVE '/dev/rhel/rootlv' [14.64 GiB] inherit
ACTIVE '/dev/testvg/testlv' [160.00 MiB] inherit ==>testvg大小变为160M
[root@test01 Desktop]# mount /dev/testvg/testlv /mnt/test
[root@test01 Desktop]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/rhel-rootlv xfs 15G .3G 11G % /
devtmpfs devtmpfs 481M 481M % /dev
tmpfs tmpfs 490M 140K 490M % /dev/shm
tmpfs tmpfs 490M 7.1M 483M % /run
tmpfs tmpfs 490M 490M % /sys/fs/cgroup
/dev/sr0 iso9660 .5G .5G % /mnt/cdrom
/dev/sda1 xfs 297M 109M 189M % /boot
/dev/mapper/testvg-testlv ext4 151M 1.6M 140M 2% /mnt/test ==>文件系统也变成160M了
7.LVM系统快照
快照就是把当前的系统信息记录下来,快照区LV与被快照区的LV必须在同一个VG上,当建立快照区LV时,系统会预留一个区域作为数据存放处,此时快照区无任何数据,快照区与系统区共享所有的PE数据,这时快照区的内容与文件系统是一样的;当系统区的数据有变化时,快照区则会备份变更之前的数据,其他未改变的数据还是处于共享状态,因此快照占用的容量很少
若快照区给的空间已容纳不了变更的数据时,快照会失效
创建文件系统/dev/testvg/testlv的快照
先查看将被快照的lv的大小,便于设定快照区的大小
[root@test01 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rhel-rootlv 15G .3G 11G % /
devtmpfs 905M 905M % /dev
tmpfs 914M 140K 914M % /dev/shm
tmpfs 914M 8.9M 905M % /run
tmpfs 914M 914M % /sys/fs/cgroup
/dev/sr0 .5G .5G % /mnt/cdrom
/dev/mapper/testvg-testlv 151M 9.1M 132M 7% /mnt/test ==>才9.1M
/dev/sda1 297M 109M 189M % /boot
[root@test01 ~]# ls /mnt/test/
grub2 lost+found passwd shadow
创建快照
[root@test01 ~]# lvcreate -l -s -n testlv_backup /dev/testvg/testlv
Logical volume "testlv_backup" created
-l:给快照区的PE的个数
-s:就是代表快照的意思
-n:快照的名字
/dev/testvg/testlv:被快照的LV的名字
查看快照信息
[root@test01 ~]# lvdisplay /dev/testvg/testlv_backup
--- Logical volume ---
LV Path /dev/testvg/testlv_backup
LV Name testlv_backup
VG Name testvg
LV UUID 1WuR1d-vpav-YQ9r-X8Rr-dpjW-ohTd-ffrebn
LV Write Access read/write
LV Creation host, time test01, -- :: +
LV snapshot status active destination for testlv
LV Status available
# open
LV Size 160.00 MiB ==>被快照的原LV的容量大小
Current LE
COW-table size 80.00 MiB ==>快照区的容量
COW-table LE 5 ==>快照区的PE个数
Allocated to snapshot 0.01% ==>快照的使用率,0.0.1%这是未使用
Snapshot chunk size 4.00 KiB
Segments
Allocation inherit
Read ahead sectors auto
- currently set to
Block device :
挂载这个快照看下内容是不是和原LV一样
[root@test01 ~]# mkdir /mnt/lvback
[root@test01 ~]# mount /dev/testvg/testlv_backup /mnt/lvback/
[root@test01 ~]# ls /mnt/lvback/
grub2 lost+found passwd shadow
[root@test01 ~]# ls /mnt/test/
grub2 lost+found passwd shadow
[root@test01 ~]# ll /mnt/test/
total
drwxr-xr-x. root root Dec : grub2
drwx------. root root Dec : lost+found
-rw-r--r--. root root Dec : passwd
----------. root root Dec : shadow
[root@test01 ~]# ll /mnt/lvback/
total
drwxr-xr-x. root root Dec : grub2
drwx------. root root Dec : lost+found
-rw-r--r--. root root Dec : passwd
----------. root root Dec : shadow
大小、权限、属性完全一样
进入testlv的挂载目录,删除里面的grub2目录
[root@test01 ~]# cd /mnt/test/
[root@test01 test]# ls
grub2 lost+found passwd shadow
[root@test01 test]# rm -rf grub2 可见grub2目录已被删除
[root@test01 test]# ls
lost+found passwd shadow
但是快照LV中依然存在grub2目录,这就是快照的功能,保存被更改数据的原数据
[root@test01 test]# ll ../lvback/
total
drwxr-xr-x. root root Dec : grub2
drwx------. root root Dec : lost+found
-rw-r--r--. root root Dec : passwd
----------. root root Dec : shadow [root@test01 test]# lvdisplay /dev/testvg/testlv_backup
--- Logical volume ---
LV Path /dev/testvg/testlv_backup
LV Name testlv_backup
VG Name testvg
LV UUID 1WuR1d-vpav-YQ9r-X8Rr-dpjW-ohTd-ffrebn
LV Write Access read/write
LV Creation host, time test01, -- :: +
LV snapshot status active destination for testlv
LV Status available
# open
LV Size 160.00 MiB
Current LE
COW-table size 80.00 MiB
COW-table LE
Allocated to snapshot 0.15% ==>快照区的使用空间变化了,从之前的0.0.1%到0.15%,说明被删除的文件已被移动给到快照区了
Snapshot chunk size 4.00 KiB
Segments
Allocation inherit
Read ahead sectors auto
- currently set to
Block device :
8. 利用快照备份数据,恢复数据
备份数据
创建备份目录
[root@test01 lvback]# mkdri /backup
进入快照LV挂载目录,备份所有数据
[root@test01 Desktop]# cd /mnt/lvback/
[root@test01 lvback]# ls
grub2 lost+found passwd shadow
[root@test01 lvback]# tar -jcvf /backup/testlv.tar.bz2 *
[root@test01 lvback]# ll /backup/
total
-rw-r--r--. root root Dec : testlv.tar.bz2
恢复数据
卸载需恢复的文件系统
[root@test01 ~]# umount /mnt/test/
格式化
[root@test01 ~]# mkfs.ext4 /dev/testvg/testlv
mke2fs 1.42. (-Dec-)
Filesystem label=
OS type: Linux
Block size= (log=)
Fragment size= (log=)
Stride= blocks, Stripe width= blocks
inodes, blocks
blocks (5.00%) reserved for the super user
First data block=
Maximum filesystem blocks=
block groups
blocks per group, fragments per group
inodes per group
Superblock backups stored on blocks:
, , , , Allocating group tables: done
Writing inode tables: done
Creating journal ( blocks): done
Writing superblocks and filesystem accounting information: done
重新挂载
[root@test01 ~]# mount /dev/testvg/testlv /mnt/test/
[root@test01 ~]# cd /mnt/test/
[root@test01 test]# ls
lost+found
把备份的数据解压到挂载目录下,可见数据已完全恢复,之前被删除的grub2目录也恢复了
[root@test01 test]# tar -jxvf /backup/testlv.tar.bz2 -C .
[root@test01 test]# ls
grub2 lost+found passwd shadow
9.移除LVM
步骤:
卸载文件系统——>移除LV——>使VG不具备Active标志——>移除VG——>移除PV——>修改磁盘分区ID号
卸载文件系统
[root@test01 ~]# umount /mnt/test/
移除快照LV
[root@test01 ~]# lvremove /dev/testvg/testlv_backup
Do you really want to remove active logical volume testlv_backup? [y/n]: y
Logical volume "testlv_backup" successfully removed
移除testlv
[root@test01 ~]# lvremove /dev/testvg/testlv
Do you really want to remove active logical volume testlv? [y/n]: y
Logical volume "testlv" successfully removed
让testvg不具有Active标志
[root@test01 ~]# vgchange -a n testvg
logical volume(s) in volume group "testvg" now active
移除testvg
[root@test01 ~]# vgremove testvg
Volume group "testvg" successfully removed
移除pv
[root@test01 ~]# pvremove /dev/sda{,}
Labels on physical volume "/dev/sda5" successfully wiped
Labels on physical volume "/dev/sda6" successfully wiped
修改磁盘分区ID号,使用t参数
[root@test01 ~]# fdisk /dev/sda
Welcome to fdisk (util-linux 2.23.). Changes will remain in memory only, until you decide to write them.
Be careful before using the write command. Command (m for help): t
Partition number (-, default ):
Hex code (type L to list all codes):
Changed type of partition 'Linux LVM' to 'Linux' Command (m for help): t
Partition number (-, default ):
Hex code (type L to list all codes):
Changed type of partition 'Linux LVM' to 'Linux'
linux逻辑卷管理(LVM)的更多相关文章
- Linux 逻辑卷管理LVM
LVM概述 Logical Volume Manager,逻辑卷管理 屏蔽了底层磁盘布局,便于动态调整磁盘容量 需要注意:/boot分区用于存放引导文件,不能应用LVM机制 LVM结构 目标:将sdb ...
- linux逻辑卷管理 (LVM)(转)
1.什么是 LVM LVM 是逻辑盘卷管理(Logical Volume Manager)的简称,它是 Linux 环境下对磁盘分区进行管理的一种机制,LVM 是建立在硬盘和分区之上的一个逻辑层,来为 ...
- Linux逻辑卷管理器(LVM)
LVM基础 通过使用Linux的逻辑卷管理器(Logical Volume Manager, LVM),用户可以在系统运行时动态调整文件系统的大小,把数据从一块硬盘重定位到另一块硬盘,也可以提高I/O ...
- linux逻辑卷管理
近期在进行linux充电,依据网络资料自己整理的资料,分享一下 ---------------------------------------------------------- Linux逻辑卷管 ...
- 逻辑卷管理lvm
逻辑卷管理LVM 一 创建逻辑卷 1准备分区或硬盘 这里使用/dev/sdb./dev/sdc两块硬盘和/dev/sda9./dev/sda10两个分区,大小都为1G,磁盘有限,我也不想这么抠的. 添 ...
- Linux逻辑卷管理器concept
Linux逻辑卷管理concept-------------------------转载2013/10/09 通过使用Linux的逻辑卷管理器(Logical Volume Manager, LVM) ...
- 逻辑卷管理LVM (Logical Volume Manager)
什么是LVM? LVM(Logical Volume Manager)逻辑卷管理,是一种将一个或多个硬盘的分区在逻辑上集合,相当于一个大硬盘来使用,当硬盘的空间不够使用的时候,可以继续将其它的硬盘的 ...
- 逻辑卷管理-LVM(Logical Volume Manager)
一. 概念与由来 LVM:逻辑卷管理(Logical Volume Manager) 普通的磁盘分区管理方式在逻辑分区划分好之后就无法改变其大小,当一个逻辑分区存放不下某文件时,这个文件因为受上层文件 ...
- 存储5——逻辑卷管理LVM
1. LVM概念 LVM是 Logical Volume Manager(逻辑卷管理)的简写,它由Heinz Mauelshagen在Linux 2.4内核上实现.LVM将一个或多个硬盘的分区在逻辑上 ...
随机推荐
- python itertools 模块
Python的内建模块itertools提供了非常有用的用于操作迭代对象的函数 首先,我们看看itertools提供的几个“无限”迭代器: >>> import itertools ...
- Serializable中的serialVersionUID
有序列化,就必然有反序列化!比如在A端为UserLogin(见上一篇对象序列化)做了序列化,然后在B端进行反序列化. 首先需要,A端和B端都定义有相同的UserLogin类.可是,万一两端的UserL ...
- bzoj4665 小w的喜糖(dp+容斥)
4665: 小w的喜糖 Time Limit: 10 Sec Memory Limit: 128 MBSubmit: 222 Solved: 130[Submit][Status][Discuss ...
- 误删除(重命名)libc.so.6的处理方法
LD_PRELOAD=/lib64/libc-2.12.so ln -s /lib64/libc-2.12.so /lib64/libc.so.6 ssh尚未断开的话可以直接这样操作,断开之后可以用l ...
- 迭代(遍历)时候不可以使用集合的remove和add方法,但可使用Java迭代器的remove和add方法
不要在 foreach 循环里进行元素的 remove/add 操作.remove 元素请使用 Iterator 方式. 反例: public class ForeachTest { private ...
- Bugku-CTF之Trim的日记本(不要一次就放弃)
Day19 Trim的日记本 http://123.206.87.240:9002/ hints:不要一次就放弃
- Ember.js 看法,精辟
https://ruby-china.org/topics/31451#reply43 都是大牛,或许还是vue适合小白!架不住人多啊!一个非常优秀的产品,客户百十号人,如何发展! 46楼的感想如下, ...
- springBoot整合jpa
https://blog.csdn.net/qq_35180973/article/details/82316438 总体来讲只是在service调用dao的时候用接口代替dao继承CrudRepos ...
- Java的异常机制
Java的异常机制 (一)异常的概念 异常是指程序在编译或运行时出现的导致程序不能继续编译或运行的状况.. (二)Throwable类 Throwable类继承自Object类,是Java中所有错误或 ...
- Windows 后台执行jar
我们都知道Linux下可用命令nohup /opt/jdk1.8.0_131/bin/java -jar xxx.jar &来后台执行jar 如果是Windows环境,要如何在后台执行呢 新建 ...