Rabu, 24 April 2019

How to extend physical volume disk mapper root

  Tidak ada komentar
Check the disk block
[[email protected] ~]# lsblk
NAME          MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda             8:0    0  50G  0 disk
├─sda1          8:1    0   4M  0 part
├─sda2          8:2    0   1G  0 part /boot
└─sda3          8:3    0  49G  0 part
  ├─rhel-root 253:0    0  44G  0 lvm  /
  └─rhel-swap 253:1    0   4G  0 lvm  [SWAP]
sr0            11:0    1   3G  0 rom
[[email protected] ~]#
[[email protected] ~]#
Check disk size
[[email protected] ~]# df -h
Filesystem             Size  Used Avail Use% Mounted on
/dev/mapper/rhel-root   17G  4.3G   13G  26% /
devtmpfs               7.5G     0  7.5G   0% /dev
tmpfs                  7.5G     0  7.5G   0% /dev/shm
tmpfs                  7.5G   18M  7.5G   1% /run
tmpfs                  7.5G     0  7.5G   0% /sys/fs/cgroup
/dev/sda2             1014M  198M  817M  20% /boot
tmpfs                  1.5G     0  1.5G   0% /run/user/0
[[email protected] ~]#
Check disk mapper
[[email protected] ~]# fdisk -l

Disk /dev/sda: 53.7 GB, 53687091200 bytes, 104857600 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 label type: dos
Disk identifier: 0x000ab94b

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048       10239        4096   41  PPC PReP Boot
/dev/sda2           10240     2107391     1048576   83  Linux
/dev/sda3         2107392   104857599    51375104   8e  Linux LVM

Disk /dev/mapper/rhel-root: 47.2 GB, 47236251648 bytes, 92258304 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/rhel-swap: 4294 MB, 4294967296 bytes, 8388608 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

[[email protected] ~]#
Check the logical volume
[[email protected] ~]# lvs
  LV   VG   Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root rhel -wi-ao---- 43.99g
  swap rhel -wi-ao----  4.00g
[[email protected] bin]# pvs
  PV         VG   Fmt  Attr PSize  PFree
  /dev/sda3  rhel lvm2 a--  48.99g 1.00g
[[email protected] bin]#
[[email protected] bin]# xfs_growfs /dev/rhel/root
meta-data=/dev/mapper/rhel-root  isize=512    agcount=4, agsize=1113600 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=0 spinodes=0
data     =                       bsize=4096   blocks=4454400, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal               bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
data blocks changed from 4454400 to 11532288
[[email protected] ~]#
Check the disk size again
[[email protected] ~]# df -h
Filesystem             Size  Used Avail Use% Mounted on
/dev/mapper/rhel-root   44G  5.6G   39G  13% /
devtmpfs               7.5G     0  7.5G   0% /dev
tmpfs                  7.5G     0  7.5G   0% /dev/shm
tmpfs                  7.5G   18M  7.5G   1% /run
tmpfs                  7.5G     0  7.5G   0% /sys/fs/cgroup
/dev/sda2             1014M  198M  817M  20% /boot
tmpfs                  1.5G     0  1.5G   0% /run/user/0
[[email protected] ~]#

Tidak ada komentar :

Posting Komentar