码迷,mamicode.com
首页 > 其他好文 > 详细

VG有空间,创建逻辑卷

时间:2017-12-06 13:09:24      阅读:176      评论:0      收藏:0      [点我收藏+]

标签:super   fst   mpi   mys   dba   1.3   sys   tun   and   


1.查看VG空间

[root@CNSZ22PL2787 ~]# vgs
VG         #PV #LV #SN Attr   VSize VFree
VolGroup00   1   7   0 wz--n- 1.63t 1.37t

[root@CNSZ22PL2787 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LVroot
                       30G  2.2G   26G   8% /
tmpfs                 253G     0  253G   0% /dev/shm
/dev/sda1             190M   40M  141M  22% /boot
/dev/mapper/VolGroup00-LVhome
                       30G   45M   28G   1% /home
/dev/mapper/VolGroup00-LVkdump
                       50G   52M   47G   1% /kdump
/dev/mapper/VolGroup00-LVtmp
                       20G   45M   19G   1% /tmp
/dev/mapper/VolGroup00-LVvar
                       20G  481M   19G   3% /var

2.查看LV

[root@CNSZ22PL2787 ~]# lvs
LV      VG         Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
LVhome  VolGroup00 -wi-ao---- 30.00g                                                    
LVkdump VolGroup00 -wi-ao---- 50.00g                                                    
LVroot  VolGroup00 -wi-ao---- 30.00g                                                    
LVswap  VolGroup00 -wi-ao---- 20.00g                                                    
LVtmp   VolGroup00 -wi-ao---- 20.00g                                                    
LVvar   VolGroup00 -wi-ao---- 20.00g  

3.创建lv(以100G为例)

[root@CNSZ22PL2787 ~]# lvcreate -L 100G --name LVdba VolGroup00  
allocation/use_blkid_wiping=1 configuration setting is set while LVM is not compiled with blkid wiping support.
Falling back to native LVM signature detection.
Logical volume "LVdba" created.
[root@CNSZ22PL2787 ~]# lvs
LV      VG         Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
LVdba   VolGroup00 -wi-a----- 100.00g                                                    
LVhome  VolGroup00 -wi-ao----  30.00g                                                    
LVkdump VolGroup00 -wi-ao----  50.00g                                                    
LVroot  VolGroup00 -wi-ao----  30.00g                                                    
LVswap  VolGroup00 -wi-ao----  20.00g                                                    
LVtmp   VolGroup00 -wi-ao----  20.00g                                                    
LVvar   VolGroup00 -wi-ao----  20.00g  

4.格式化

[root@CNSZ22PL2787 ~]# mkfs.ext4 /dev/mapper/VolGroup00-LVdba
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=1 blocks, Stripe width=0 blocks
6553600 inodes, 26214400 blocks
1310720 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
800 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
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 20 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

5.创建挂载目录

[root@CNSZ22PL2787 ~]# mkdir /dba
[root@CNSZ22PL2787 ~]# ll /
total 126
dr-xr-xr-x.    2 root  root   4096 Dec  1 14:48 bin
dr-xr-xr-x.    5 root  root   1024 Dec  1 13:18 boot
drwxr-xr-x.    2 root  root   4096 Mar 23  2016 cgroup
drwxr-xr-x     4 mysql mysql  4096 Dec  6 10:47 dba
drwxr-xr-x    18 root  root   3940 Dec  6 10:42 dev
drwxr-xr-x.  107 root  root  12288 Dec  6 10:48 etc
drwxr-xr-x.   14 root  root   4096 Dec  6 10:22 home
drwxr-xr-x.    4 root  root   4096 Dec  1 13:18 kdump
dr-xr-xr-x.   13 root  root   4096 Dec  1 14:48 lib
dr-xr-xr-x.   10 root  root  12288 Dec  1 14:48 lib64
drwx------.    2 root  root  16384 Dec  1 13:01 lost+found
drwxr-xr-x.    2 root  root   4096 Sep 23  2011 media
drwxr-xr-x.    2 root  root   4096 May 11  2016 misc
drwxr-xr-x.    2 root  root   4096 Sep 23  2011 mnt
drwxr-xr-x.    2 root  root   4096 May 11  2016 net
drwxr-xr-x.    5 root  root   4096 Dec  1 13:58 opt
dr-xr-xr-x  1652 root  root      0 Dec  5 02:11 proc
dr-xr-x---.    5 root  root   4096 Dec  5 19:34 root
dr-xr-xr-x.    2 root  root  12288 Dec  1 14:48 sbin
drwxr-xr-x.    2 root  root   4096 Dec  1 13:01 selinux
drwx------     2 root  sys    4096 Dec  6 10:48 sfroot
drwxr-xr-x.    2 root  root   4096 Sep 23  2011 srv
drwxr-xr-x    13 root  root      0 Dec  5 02:11 sys
drwxrwxrwt.    5 root  root   4096 Dec  6 03:51 tmp
drwxr-xr-x.   13 root  root   4096 Dec  1 13:02 usr
drwxr-xr-x.   23 root  root   4096 Dec  1 13:50 var

6.编辑fstab表

[root@CNSZ22PL2787 ~]# vim /etc/fstab
/dev/mapper/VolGroup00-LVdba /dba                    ext4    defaults        1 2

7.生效fstab配置

[root@CNSZ22PL2787 ~]# mount -a

8.给挂载目录授权

[root@CNSZ22PL2787 ~]# chown -R mysql:mysql /dba
drwxr-xr-x     4 mysql mysql  4096 Dec  6 10:47 dba

8.检查是否完成

[root@CNSZ22PL2787 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LVroot
                       30G  2.2G   26G   8% /
tmpfs                 253G     0  253G   0% /dev/shm
/dev/sda1             190M   40M  141M  22% /boot
/dev/mapper/VolGroup00-LVhome
                       30G   45M   28G   1% /home
/dev/mapper/VolGroup00-LVkdump
                       50G   52M   47G   1% /kdump
/dev/mapper/VolGroup00-LVtmp
                       20G   45M   19G   1% /tmp
/dev/mapper/VolGroup00-LVvar
                       20G  482M   19G   3% /var
/dev/mapper/VolGroup00-LVdba
                       99G   60M   94G   1% /dba

VG有空间,创建逻辑卷

标签:super   fst   mpi   mys   dba   1.3   sys   tun   and   

原文地址:http://www.cnblogs.com/dragon7421/p/7991925.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!