CentOS項目執行個體之五--LVM配置

來源:互聯網
上載者:User

標籤:lv vg pv

1. ZZSRV2上的LVM配置1.1. 磁碟配置
# fdisk -lDisk /dev/sda: 21.5 GB, 21474836480 bytes, 41943040 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk label type: dosDisk identifier: 0x00012974   Device Boot      Start         End      Blocks   Id  System/dev/sda1   *        2048     1026047      512000   83  Linux/dev/sda2         1026048    41943039    20458496   8e  Linux LVMDisk /dev/mapper/centos-swap: 2147 MB, 2147483648 bytes, 4194304 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/mapper/centos-root: 18.8 GB, 18798870528 bytes, 36716544 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytes添加100GB的磁碟。讓Linux系統掃描重新整理磁碟配置:# echo "- - -" > /sys/class/scsi_host/host0/scan# echo "- - -" > /sys/class/scsi_host/host1/scan# echo "- - -" > /sys/class/scsi_host/host2/scan# fdisk -l看到新的盤了Disk /dev/sdb: 107.4 GB, 107374182400 bytes, 209715200 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytes

1.2. LVM配置
# fdisk /dev/sdb建立分區# fdisk -l /dev/sdbDisk /dev/sdb: 107.4 GB, 107374182400 bytes, 209715200 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk label type: dosDisk identifier: 0x8dee9f3a   Device Boot      Start         End      Blocks   Id  System/dev/sdb1            2048   209715199   104856576   8e  Linux LVM  建立PV# pvcreate /dev/sdb1  Physical volume "/dev/sdb1" successfully created建立VG# vgcreate DATAVG /dev/sdb1  Volume group "DATAVG" successfully created# vgdisplay DATAVG  --- Volume group ---  VG Name               DATAVG  System ID  Format                lvm2  Metadata Areas        1  Metadata Sequence No  1  VG Access             read/write  VG Status             resizable  MAX LV                0  Cur LV                0  Open LV               0  Max PV                0  Cur PV                1  Act PV                1  VG Size               100.00 GiB  PE Size               4.00 MiB  Total PE              25599  Alloc PE / Size       0 / 0  Free  PE / Size       25599 / 100.00 GiB  VG UUID               xxKwGK-FDbT-elLy-yU7A-gKfj-j3hc-7Cq76o# lvcreate -n LVSMB -L 40G DATAVG  Logical volume "LVSMB" created# lvcreate -n LVFTP -L 30G DATAVG  Logical volume "LVFTP" created查看VG是未使用PE數量# vgdisplay DATAVG  --- Volume group ---  VG Name               DATAVG  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               0  Max PV                0  Cur PV                1  Act PV                1  VG Size               100.00 GiB  PE Size               4.00 MiB  Total PE              25599  Alloc PE / Size       17920 / 70.00 GiB  Free  PE / Size       7679 / 30.00 GiB  VG UUID               xxKwGK-FDbT-elLy-yU7A-gKfj-j3hc-7Cq76o將所有未使用的PE全部分配給最後一個LV# lvcreate -n LVNFS -l 7679  DATAVG  Logical volume "LVNFS" created# vgdisplay DATAVG  --- Volume group ---  VG Name               DATAVG  System ID  Format                lvm2  Metadata Areas        1  Metadata Sequence No  4  VG Access             read/write  VG Status             resizable  MAX LV                0  Cur LV                3  Open LV               0  Max PV                0  Cur PV                1  Act PV                1  VG Size               100.00 GiB  PE Size               4.00 MiB  Total PE              25599  Alloc PE / Size       25599 / 100.00 GiB  Free  PE / Size       0 / 0 全部使用完了  VG UUID               xxKwGK-FDbT-elLy-yU7A-gKfj-j3hc-7Cq76o# lvscan  ACTIVE            ‘/dev/DATAVG/LVSMB‘ [40.00 GiB] inherit  ACTIVE            ‘/dev/DATAVG/LVFTP‘ [30.00 GiB] inherit  ACTIVE            ‘/dev/DATAVG/LVNFS‘ [30.00 GiB] inherit  ACTIVE            ‘/dev/centos/swap‘ [2.00 GiB] inherit  ACTIVE            ‘/dev/centos/root‘ [17.51 GiB] inherit

1.3. 檔案系統配置

建立檔案系統

# mkfs.ext4 /dev/DATAVG/LVSMB# mkfs.ext4 /dev/DATAVG/LVFTP# mkfs.ext4 /dev/DATAVG/LVNFS建立Mount Point# mkdir /smb# mkdir /ftp# mkdir /nfs# vi /etc/fstab添加/dev/DATAVG/LVSMB  /smb  ext4 defaults  0 0/dev/DATAVG/LVFTP  /ftp  ext4 defaults  0 0/dev/DATAVG/LVNFS  /nfs  ext4 defaults  0 0測試一下# mount /smb/# mount /ftp# mount /nfs# mount..... /dev/mapper/DATAVG-LVSMB on /smb type ext4 (rw,relatime,data=ordered)/dev/mapper/DATAVG-LVFTP on /ftp type ext4 (rw,relatime,data=ordered)/dev/mapper/DATAVG-LVNFS on /nfs type ext4 (rw,relatime,data=ordered)



本文出自 “劉瓊@天道酬勤” 部落格,請務必保留此出處http://lqiong.blog.51cto.com/8170814/1559071

CentOS項目執行個體之五--LVM配置

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.