• Categories
    Category
  • Categories
    Category
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial Comments FAQ Related Articles

How to Create and Manage LVM on Oracle Linux 8.5

  • 00:32 cat /etc/os-release
  • 00:51 lsblk
  • 01:04 fdisk /dev/sda
  • 02:13 pvcreate /dev/sda1
  • 02:28 vgcreate vg /dev/sda1
  • 02:58 lvcreate -n lv -L 2G vg
  • 03:57 mkdir /home/linuxhelp/part
  • 04:16 mkfs.ext4 /dev/vg/lv
  • 04:54 vi /etc/fstab
  • 05:45 mount /dev/vg/lv
  • 06:23 umount /dev/vg/lv
  • 07:03 lvremove /dev/vg2/lv2
  • 07:23 vgremove /dev/vg2
  • 07:35 pvremove /dev/sda1
7074

To Create and manage LVM on Oracle Linux 8.5

Introduction:

A logical volume manager (LVM) is a type of storage virtualization that combines multiple hard drives or partitions into a single volume group (VG), which then can be subdivided into logical volumes (LV), or can be used as a single large volume.

Installation Steps:

Step 1: Check the Oracle Linux Version by using the below command.

[root@linuxhelp linuxhelp]# cat /etc/os-release
NAME="Oracle Linux Server"
VERSION="8.5"
ID="ol"
ID_LIKE="fedora"
VARIANT="Server"

Step 2: Check current Disk status by using the below command.

[root@linuxhelp linuxhelp]# lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda           8:0    0   10G  0 disk 
sr0          11:0    1 1024M  0 rom  
nvme0n1     259:0    0   20G  0 disk 
├─nvme0n1p1 259:1    0    1G  0 part /boot
└─nvme0n1p2 259:2    0   19G  0 part 
  ├─ol-root 252:0    0   17G  0 lvm  /
  └─ol-swap 252:1    0    2G  0 lvm  [SWAP]

Step 3: Create new Partition by using the below command.

[root@linuxhelp linuxhelp]# fdisk /dev/sda

Welcome to fdisk (util-linux 2.23.2).
Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): 
Using default response p
Partition number (1-4, default 1): 
First sector (2048-41943039, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039): +5G
Partition 1 of type Linux and of size 5GiB is set
Command (m for help): wq

Selected partition 1
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

Step 4: Create a physical volume by using the below command.

[root@linuxhelp linuxhelp]# pvcreate /dev/sda1
Physical volume "/dev/sda1" successfully created.

Step 5: Create a volume group by using the below command.

[root@linuxhelp linuxhelp]# vgcreate vg /dev/sda1
 Volume group "vg" successfully created

Step 6: Create a logical volume by using the below command.

[root@linuxhelp linuxhelp]# lvcreate -n lv -L 2G vg
 Logical volume "lv" created.

Step 7: Create a Directory by using the below command.

[root@linuxhelp linuxhelp]# mkdir /home/linuxhelp/part

Step 8: Create File System by using the below command.

[root@linuxhelp linuxhelp]# mkfs.ext4 /dev/vg/lv
mke2fs 1.45.6 (20-Mar-2020)
Creating filesystem with 524288 4k blocks and 131072 inodes
Filesystem UUID: ad44c4a1-6c8b-4335-96fe-56e68916c4b4
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912
Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done 

Step 9: Make insert the file path to mount by using the below command.

[root@linuxhelp linuxhelp]# vi /etc/fstab
/dev/vg/lv             /home/linuxhelp/part        vfat    defaults        0 0

Step 10: Update mount by using the below command.

[root@linuxhelp linuxhelp]# mount /dev/vg/lv

Step 11: Once all the modification is done in the partition, you can restart it by make use of the below command.

[root@linuxhelp linuxhelp]# partprobe

Step 12: Check the Mount point by using the below command.

[root@linuxhelp linuxhelp]# lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda           8:0    0   10G  0 disk 
└─sda1        8:1    0    5G  0 part 
  └─vg-lv   252:2    0    2G  0 lvm  /home/linuxhelp/part

Step 13: Remove the entry in vi/etc/fstab and If you want to remove Logical volume, run the below command.

[root@linuxhelp11 /]# lvremove  /dev/vg/lv

Step 14: You can remove volume group by making use of the below command.

[root@linuxhelp11 /]# vgremove /dev/vg

Step 15: Remove Physical volume by making use of the below command.

[root@linuxhelp11 /]# pvremove /dev/sda1

With this the creating and managing lvm on oracle linux 8.5 has come to an end.

Tags:
connor
Author: 

Comments ( 0 )

No comments available

Add a comment

Frequently asked questions ( 5 )

Q

How to list the available physical volumes in LVM?

A

Use pvs command to list the available physical volumes.

Q

How to list the imported volume groups?

A

Use vgs command to display the imported volume group.

Q

How to list the available logical volumes on the system?

A

Use lvs command to list the available logical volumes on the system.

Q

Is it possible to increase the logical volume?

A

yes, we can increase the logical volume without umount it.

Q

How to scan a logical volume from the existing volume group?

A

Using lvscan we can scan a logical volume from the existing volume group.

Related Tutorials in How to Create and Manage LVM on Oracle Linux 8.5

Related Tutorials in How to Create and Manage LVM on Oracle Linux 8.5

How to Manage and Create LVM on CentOS 7
How to Manage and Create LVM on CentOS 7
Mar 6, 2018
How to create and setup LUNs using LVM
How to create and setup LUNs using LVM
Jun 1, 2016
How to migrate from LVM Partitions to New Logical Volume
How to migrate from LVM Partitions to New Logical Volume
May 6, 2016
How to Install and configure the Samba server on oracle linux
How to Install and configure the Samba server on oracle linux
Jun 16, 2022
How to install FTP server on oracle Linux
How to install FTP server on oracle Linux
May 17, 2022
How To Manage LVM in Debian
How To Manage LVM in Debian
May 3, 2016
How to Install and Configure Mysql Server on Oracle Linux
How to Install and Configure Mysql Server on Oracle Linux
Dec 27, 2021
How to Create and Manage LVM on Parrot OS 3.9
How to Create and Manage LVM on Parrot OS 3.9
Dec 9, 2017

Related Forums in How to Create and Manage LVM on Oracle Linux 8.5

Related Forums in How to Create and Manage LVM on Oracle Linux 8.5

LVM (Logical Volume Manager)
connor class=
How to activate and deactivate Logical volumes, Volume group and Physical volume
Feb 16, 2017
pv command
muhammad class=
pvcreate command not found error
May 9, 2017
LVM (Logical Volume Manager)
caden class=
How to increase LVM size without unmounting
Feb 16, 2017
LVM (Logical Volume Manager)
dylan class=
How to rename Volume group in LVM without unmount
Feb 15, 2017
LVM (Logical Volume Manager)
daniel class=
To remove LVM partition in Linux
Feb 15, 2017
LVM (Logical Volume Manager)
john class=
How to create LVM for two Disks
Feb 15, 2017
LVM (Logical Volume Manager)
david class=
What is physical volume, Volume group and Logical volume concepts
Feb 15, 2017
LVM (Logical Volume Manager)
michael class=
How to display the Logical volumes created
Feb 16, 2017
Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Owen ?
How to add SSH key to my Gitlab account

I need to add the SSH key in my gitlab account. How to do so ????

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.