linux-逻辑卷
来源:互联网 发布:华道数据徐州分公司 编辑:程序博客网 时间:2024/04/29 07:02
物理卷-》卷组-》逻辑卷
添加分区
Command (m for help): nAll primary partitions are in useAdding logical partition 9First sector (50341888-62914559, default 50341888): Using default value 50341888Last sector, +sectors or +size{K,M,G} (50341888-62914559, default 62914559): +1GPartition 9 of type Linux and of size 1 GiB is set修改分区格式Command (m for help): tPartition number (1-9, default 9): 9Hex code (type L to list all codes): 8eChanged type of partition 'Linux' to 'Linux LVM'Command (m for help): p/dev/sda7 46143488 48240639 1048576 8e Linux LVM/dev/sda8 48242688 50339839 1048576 8e Linux LVM/dev/sda9 50341888 52439039 1048576 8e Linux LVM保存退出Command (m for help): w系统识别:[root@localhost Desktop]# partprobe创建物理卷:
[root@localhost Desktop]# pvcreate /dev/sda{8,9} Physical volume "/dev/sda8" successfully created Physical volume "/dev/sda9" successfully created详细查看
[root@localhost Desktop]# pvdisplay "/dev/sda8" is a new physical volume of "1.00 GiB" --- NEW Physical volume --- PV Name /dev/sda8 VG Name PV Size 1.00 GiB Allocatable NO PE Size 0 PE大小显示为0 Total PE 0 Free PE 0 Allocated PE 0 PV UUID ttpcEb-kAXo-hbJP-wzRq-Xzr5-Ggu4-O0K9Jm查看个数
[root@localhost Desktop]# pvscan PV /dev/sda8 lvm2 [1.00 GiB] PV /dev/sda9 lvm2 [1.00 GiB] Total: 2 [2.00 GiB] / in use: 0 [0 ] / in no VG: 2 [2.00 GiB]删除物理卷
[root@localhost Desktop]# pvremove /dev/sda{9,8} Labels on physical volume "/dev/sda9" successfully wiped Labels on physical volume "/dev/sda8" successfully wiped创建查看卷组
[root@localhost Desktop]# vgcreate -s 8M myvg /dev/sda{8,9} Volume group "myvg" successfully created[root@localhost Desktop]# vgs VG #PV #LV #SN Attr VSize VFree myvg 2 0 0 wz--n- 1.98g 1.98g添加删除卷组
[root@localhost Desktop]# vgreduce myvg /dev/sda8 Removed "/dev/sda8" from volume group "myvg"[root@localhost Desktop]# vgextend myvg /dev/sda10 Physical volume "/dev/sda10" successfully created Volume group "myvg" successfully extended创建查看逻辑卷
[root@localhost Desktop]# lvcreate -n testlv -L 1G myvgWARNING: dos signature detected on /dev/myvg/testlv at offset 510. Wipe it? [y/n]: y Wiping dos signature on /dev/myvg/testlv. Logical volume "testlv" created.[root@localhost Desktop]# lvs LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert testlv myvg -wi-a----- 1.00g删除逻辑卷
[root@localhost Desktop]# lvremove /dev/myvg/testlv Do you really want to remove active logical volume testlv? [y/n]: y Logical volume "testlv" successfully removed格式化,挂载
[root@localhost Desktop]# mount /dev/myvg/testlv test7[root@localhost Desktop]# ls /test7ls: cannot access /test7: No such file or directory[root@localhost Desktop]# ls test7/lost+found创建快照卷[root@localhost Desktop]# cp test6 test7[root@localhost Desktop]# ls test7lost+found test6[root@localhost Desktop]# lvcreate -s -p r -L 20M -n testlv-na /dev/myvg/testlv Rounding up size to full physical extent 24.00 MiB Logical volume "testlv-na" created.挂载快照卷
[root@localhost Desktop]# mkdir test8[root@localhost Desktop]# mount /dev/myvg/testlv test8[root@localhost Desktop]# ls test8lost+found test6[root@localhost Desktop]#必须删除快照卷才可以增加逻辑卷 物理增加[root@localhost Desktop]# lvextend -L +200M /dev/myvg/testlv Size of logical volume myvg/testlv changed from 1.00 GiB (128 extents) to 1.20 GiB (153 extents). Logical volume testlv successfully resized.[root@localhost Desktop]# df -lhFilesystem Size Used Avail Use% Mounted on/dev/sda3 18G 4.7G 14G 27% /devtmpfs 475M 0 475M 0% /devtmpfs 489M 156K 489M 1% /dev/shmtmpfs 489M 7.1M 482M 2% /runtmpfs 489M 0 489M 0% /sys/fs/cgroup/dev/sda1 297M 144M 154M 49% /boottmpfs 98M 28K 98M 1% /run/user/1000/dev/mapper/myvg-testlv 976M 1.3M 924M 1% /home/hzk/Desktop/test7
逻辑增加[root@localhost Desktop]# lvresize -p /dev/myvg/testlv [root@localhost Desktop]# df -lh/dev/mapper/myvg-testlv 1.2G 1.6M 1.1G 1% /home/hzk/Desktop/test7
0 0
- linux建立逻辑卷
- linux逻辑卷管理
- Linux逻辑卷
- LINUX 扩展逻辑卷
- linux 逻辑卷管理
- Linux LVM逻辑卷
- Linux创建逻辑卷
- linux 逻辑卷
- Linux的逻辑卷
- linux-逻辑卷
- Linux逻辑卷管理
- Linux逻辑卷扩展
- linux逻辑卷使用
- Linux逻辑卷
- linux 分区 物理卷 逻辑卷
- 【Linux】逻辑卷 物理卷 快照
- LINUX下逻辑卷管理
- linux逻辑卷管理 (LVM)
- base64解密
- 膨胀与腐蚀算法
- ZigBee 3.0 《Base-Device-Behavior-Specification》--Network steering(在网)
- WPF:ListBox的默认ItemContainerStyle
- Agent和Broker的差别是什么?
- linux-逻辑卷
- POJ_1111_Image Perimeters【DFS】
- return用处
- Leaflet加载Portable Basemap Server的WMTS服务
- 免安装版jdk
- nyoj 236 心急的C小加
- 增加 tenant(租客)服务
- 声音识别动画(下)-----线形(曲线)声音识别动画
- 初识Memcache---(2)使用memcache