How to manage multiple data disks as a logical disk based on LVM in Ubuntu 18.04

How to manage multiple data disks as a logical disk based on LVM in Ubuntu 18.04

Overview

在这里插入图片描述

Fdisk

lwk@qwfys:~$ ssh 192.168.31.22
Welcome to Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-55-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Thu Nov  7 00:54:34 CST 2019

  System load:    0.1               Processes:             118
  Usage of /home: 0.1% of 91.17GB   Users logged in:       1
  Memory usage:   3%                IP address for enp0s3: 192.168.31.22
  Swap usage:     0%


0 packages can be updated.
0 updates are security updates.


Last login: Thu Nov  7 00:52:54 2019
lwk@huanghe:~$ sudo fdisk -l
[sudo] password for lwk: 
Disk /dev/sda: 100 GiB, 107374182400 bytes, 209715200 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: gpt
Disk identifier: 3571AE56-3E87-4BD4-955D-EF56E96A98AA

Device       Start       End   Sectors  Size Type
/dev/sda1     2048   1171455   1169408  571M EFI System
/dev/sda2  1171456 209713151 208541696 99.5G Linux LVM


Disk /dev/sdb: 200 GiB, 214748364800 bytes, 419430400 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: gpt
Disk identifier: B9E19FD1-AF4B-4A3C-AFDF-4532D5B4AB5C

Device     Start       End   Sectors  Size Type
/dev/sdb1   2048 419428351 419426304  200G Linux LVM


Disk /dev/mapper/ubuntu--vg-root: 55.4 GiB, 59525562368 bytes, 116260864 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/ubuntu--vg-swap: 1.9 GiB, 1996488704 bytes, 3899392 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/ubuntu--vg-user: 74.5 GiB, 79997960192 bytes, 156246016 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/ubuntu--vg-var: 74.5 GiB, 79997960192 bytes, 156246016 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/ubuntu--vg-home: 93.1 GiB, 99996401664 bytes, 195305472 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
lwk@huanghe:~$ df -h
Filesystem                   Size  Used Avail Use% Mounted on
udev                         1.9G     0  1.9G   0% /dev
tmpfs                        395M  748K  394M   1% /run
/dev/mapper/ubuntu--vg-root   55G  757M   51G   2% /
/dev/mapper/ubuntu--vg-user   73G  758M   69G   2% /usr
tmpfs                        2.0G     0  2.0G   0% /dev/shm
tmpfs                        5.0M     0  5.0M   0% /run/lock
tmpfs                        2.0G     0  2.0G   0% /sys/fs/cgroup
/dev/sda1                    570M  6.1M  564M   2% /boot/efi
/dev/mapper/ubuntu--vg-var    73G  121M   69G   1% /var
/dev/mapper/ubuntu--vg-home   92G   61M   87G   1% /home
tmpfs                        395M     0  395M   0% /run/user/1000
lwk@huanghe:~$

Lvm

lwk@huanghe:~$ sudo vgdisplay 
  --- Volume group ---
  VG Name               ubuntu-vg
  System ID             
  Format                lvm2
  Metadata Areas        2
  Metadata Sequence No  6
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                5
  Open LV               5
  Max PV                0
  Cur PV                2
  Act PV                2
  VG Size               299.43 GiB
  PE Size               4.00 MiB
  Total PE              76655
  Alloc PE / Size       76655 / 299.43 GiB
  Free  PE / Size       0 / 0   
  VG UUID               6CEPpR-MbFz-M4pG-qXVI-hRUO-9F7l-v9owkf
   
lwk@huanghe:~$ sudo lvdisplay 
  --- Logical volume ---
  LV Path                /dev/ubuntu-vg/user
  LV Name                user
  VG Name                ubuntu-vg
  LV UUID                EN2s0F-5BmP-yHv1-eG5B-AItY-Uw3e-ZkwW6c
  LV Write Access        read/write
  LV Creation host, time huanghe, 2019-11-07 00:38:27 +0800
  LV Status              available
  # open                 1
  LV Size                74.50 GiB
  Current LE             19073
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:2
   
  --- Logical volume ---
  LV Path                /dev/ubuntu-vg/var
  LV Name                var
  VG Name                ubuntu-vg
  LV UUID                yTb9vt-SzgN-O7Py-f9Pb-fdlK-IfGl-77lkEV
  LV Write Access        read/write
  LV Creation host, time huanghe, 2019-11-07 00:39:14 +0800
  LV Status              available
  # open                 1
  LV Size                74.50 GiB
  Current LE             19073
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:3
   
  --- Logical volume ---
  LV Path                /dev/ubuntu-vg/swap
  LV Name                swap
  VG Name                ubuntu-vg
  LV UUID                ptcwcL-939N-402d-yvcJ-awdj-6DAi-ee252f
  LV Write Access        read/write
  LV Creation host, time huanghe, 2019-11-07 00:40:00 +0800
  LV Status              available
  # open                 2
  LV Size                <1.86 GiB
  Current LE             476
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:1
   
  --- Logical volume ---
  LV Path                /dev/ubuntu-vg/home
  LV Name                home
  VG Name                ubuntu-vg
  LV UUID                1gubHh-xBRX-6VmE-eIyK-edGE-uyTh-3j0PLi
  LV Write Access        read/write
  LV Creation host, time huanghe, 2019-11-07 00:40:35 +0800
  LV Status              available
  # open                 1
  LV Size                <93.13 GiB
  Current LE             23841
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:4
   
  --- Logical volume ---
  LV Path                /dev/ubuntu-vg/root
  LV Name                root
  VG Name                ubuntu-vg
  LV UUID                Zr0Lth-9qTx-hIpj-XTTW-Y21b-TVJd-FLhlyt
  LV Write Access        read/write
  LV Creation host, time huanghe, 2019-11-07 00:41:04 +0800
  LV Status              available
  # open                 1
  LV Size                <55.44 GiB
  Current LE             14192
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0
   
lwk@huanghe:~$ sudo pvdisplay 
  --- Physical volume ---
  PV Name               /dev/sda2
  VG Name               ubuntu-vg
  PV Size               99.44 GiB / not usable 3.00 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              25456
  Free PE               0
  Allocated PE          25456
  PV UUID               pEcVkw-bL3L-iwZu-XTyV-yWC4-FGgj-Jx9Pye
   
  --- Physical volume ---
  PV Name               /dev/sdb1
  VG Name               ubuntu-vg
  PV Size               <200.00 GiB / not usable 2.00 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              51199
  Free PE               0
  Allocated PE          51199
  PV UUID               gJvM7L-iaHQ-C6J1-8grU-U9IZ-KvnY-tEeF8G
   
lwk@huanghe:~$ 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

qwfys200

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值