• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

How to create partitions using LVM on Linux Mint 20

  • 00:44 lsb_release -a
  • 00:55 fdisk -l
  • 01:19 fdisk /dev/sdb
  • 01:58 fdisk /dev/sdb
  • 02:25 fdisk -l
  • 02:39 fdisk /dev/sdb
  • 03:11 fdisk /dev/sdb
  • 03:33 fdisk -l
  • 03:49 pvcreate pv /dev/sdb1
  • 04:13 pvcreate pv1 /dev/sdb2
  • 04:30 pvs
  • 04:42 vgcreate vg /dev/sdb1 /dev/sdb2
  • 05:09 vgs
  • 05:17 lvcreate -L +5G -n lv vg
  • 05:54 lvcreate -L +5G -n lv1 vg
  • 06:02 lvs
  • 06:16 fdisk -l
  • 06:34 lvextend -L +1G /dev/mapper/vg-lv
  • 07:00 fdisk -l
  • 07:12 mkfs.ext4 /dev/mapper/vg-lv
  • 07:21 mkfs.ext4 /dev/mapper/vg-lv1
  • 07:29 mount /dev/mapper/vg-lv /home/user /Downloads/
  • 07:49 mount /dev/mapper/vg-lv1 /home/user/Document/
  • 08:08 df -h
{{postValue.id}}

To create partitions using LVM on Linux Mint 20

Intoduction:

LVM is the Logical Volume Management tool that comprises allocating disks, segmenting, replication, and resize the logical volumes. It is used to allocate a hard drive or set of hard drives to one or more physical volumes which can be placed on other block devices that might span two or more disks.

Installation Procedure:

First Check the version of the Linux mint

root@LinuxHelp:~# lsb_release -a
No LSB modules are available.
Distributor ID:	Linuxmint
Description:	Linux Mint 20
Release:	20
Codename:	ulyana

List the disk by executing the following command

root@LinuxHelp:~# fdisk -l
Disk /dev/sda: 20 GiB, 21474836480 bytes, 41943040 sectors
Disk model: VMware Virtual S
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: dos
Disk identifier: 0x749a518b
Device     Boot   Start      End  Sectors  Size Id Type
/dev/sda1  *       2048  1050623  1048576  512M  b W95 FAT32
/dev/sda2       1052670 41940991 40888322 19.5G  5 Extended
/dev/sda5       1052672 41940991 40888320 19.5G 83 Linux
Disk /dev/sdb: 30 GiB, 32212254720 bytes, 62914560 sectors
Disk model: VMware Virtual S
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Now Create partitions by executing the following command

root@LinuxHelp:~# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.34).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
The old ext4 signature will be removed by a write command.
Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x4b24993c.
Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 
First sector (2048-62914559, default 2048): 
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-62914559, default 62914559): +10G
Created a new partition 1 of type 'Linux' and of size 10 GiB.
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.

Syncing disks.

root@LinuxHelp:~# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.34).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): n       
Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (2-4, default 2): 
First sector (20973568-62914559, default 20973568): 
Last sector, +/-sectors or +/-size{K,M,G,T,P} (20973568-62914559, default 62914559): +10G
Created a new partition 2 of type 'Linux' and of size 10 GiB.
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

After the partitions is created. List the disk by executing the following command

root@LinuxHelp:~# fdisk -l
Disk /dev/sda: 20 GiB, 21474836480 bytes, 41943040 sectors
Disk model: VMware Virtual S
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: dos
Disk identifier: 0x749a518b
Device     Boot   Start      End  Sectors  Size Id Type
/dev/sda1  *       2048  1050623  1048576  512M  b W95 FAT32
/dev/sda2       1052670 41940991 40888322 19.5G  5 Extended
/dev/sda5       1052672 41940991 40888320 19.5G 83 Linux
Disk /dev/sdb: 30 GiB, 32212254720 bytes, 62914560 sectors
Disk model: VMware Virtual S
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: dos
Disk identifier: 0x4b24993c
Device     Boot    Start      End  Sectors Size Id Type
/dev/sdb1           2048 20973567 20971520  10G 83 Linux
/dev/sdb2       20973568 41945087 20971520  10G 83 Linux

Change the type of the partitions by executing the following command

root@LinuxHelp:~# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.34).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): t
Partition number (1,2, default 2): 1
Hex code (type L to list all codes): 8e
Changed type of partition 'Linux' to 'Linux LVM'.
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
root@LinuxHelp:~# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.34).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): t
Partition number (1,2, default 2): 2
Hex code (type L to list all codes): 8e
Changed type of partition 'Linux' to 'Linux LVM'.
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

Check the disk by executing the following command

root@LinuxHelp:~# fdisk -l
Disk /dev/sda: 20 GiB, 21474836480 bytes, 41943040 sectors
Disk model: VMware Virtual S
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: dos
Disk identifier: 0x749a518b
Device     Boot   Start      End  Sectors  Size Id Type
/dev/sda1  *       2048  1050623  1048576  512M  b W95 FAT32
/dev/sda2       1052670 41940991 40888322 19.5G  5 Extended
/dev/sda5       1052672 41940991 40888320 19.5G 83 Linux


Disk /dev/sdb: 30 GiB, 32212254720 bytes, 62914560 sectors
Disk model: VMware Virtual S
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: dos
Disk identifier: 0x4b24993c
Device     Boot    Start      End  Sectors Size Id Type
/dev/sdb1           2048 20973567 20971520  10G 8e Linux LVM
/dev/sdb2       20973568 41945087 20971520  10G 8e Linux LVM

Create the physical volume by executing the following command

root@LinuxHelp:~# pvcreate pv /dev/sdb1 
  Device pv not found.
WARNING: ext4 signature detected on /dev/sdb1 at offset 1080. Wipe it? [y/n]: y
  Wiping ext4 signature on /dev/sdb1.
  Physical volume "/dev/sdb1" successfully created.
root@LinuxHelp:~# pvcreate pv1 /dev/sdb2
  Device pv1 not found.
WARNING: ext4 signature detected on /dev/sdb2 at offset 1080. Wipe it? [y/n]: y
  Wiping ext4 signature on /dev/sdb2.
  Physical volume "/dev/sdb2" successfully created.

Now list the physical volume

root@LinuxHelp:~# pvs
  PV         VG Fmt  Attr PSize  PFree 
  /dev/sdb1     lvm2 ---  10.00g 10.00g
  /dev/sdb2     lvm2 ---  10.00g 10.00g

Now create the volume groups by executing the following command

root@LinuxHelp:~# vgcreate vg /dev/sdb1 /dev/sdb2 
  Volume group "vg" successfully created

List the volume groups by executing the following command

root@LinuxHelp:~# vgs
  VG #PV #LV #SN Attr   VSize  VFree 
  vg   2   0   0 wz--n- 19.99g 19.99g

Now create the logical volume by execute the following commnd

root@LinuxHelp:~# lvcreate -L +5G -n lv vg
  Logical volume "lv" created.
root@LinuxHelp:~# lvcreate -L +5G -n lv1 vg
  Logical volume "lv1" created.

Now list the logical volume

root@LinuxHelp:~# lvs
  LV   VG Attr       LSize Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  lv   vg -wi-a----- 5.00g                                                    
  lv1  vg -wi-a----- 5.00g         

Now list the disk

root@LinuxHelp:~# fdisk -l
Disk /dev/sda: 20 GiB, 21474836480 bytes, 41943040 sectors
Disk model: VMware Virtual S
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: dos
Disk identifier: 0x749a518b
Device     Boot   Start      End  Sectors  Size Id Type
/dev/sda1  *       2048  1050623  1048576  512M  b W95 FAT32
/dev/sda2       1052670 41940991 40888322 19.5G  5 Extended
/dev/sda5       1052672 41940991 40888320 19.5G 83 Linux
Disk /dev/sdb: 30 GiB, 32212254720 bytes, 62914560 sectors
Disk model: VMware Virtual S
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: dos
Disk identifier: 0x4b24993c
Device     Boot    Start      End  Sectors Size Id Type
.
.
.

Now extend the size of the logical volume

root@LinuxHelp:~# lvextend -L +1G /dev/mapper/vg-lv
  Size of logical volume vg/lv changed from 5.00 GiB (1280 extents) to 6.00 GiB (1536 extents).
  Logical volume vg/lv successfully resized.

Now list the logical volume

root@LinuxHelp:~# fdisk -l
Disk /dev/sda: 20 GiB, 21474836480 bytes, 41943040 sectors
Disk model: VMware Virtual S
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: dos
Disk identifier: 0x749a518b
Device     Boot   Start      End  Sectors  Size Id Type
/dev/sda1  *       2048  1050623  1048576  512M  b W95 FAT32
/dev/sda2       1052670 41940991 40888322 19.5G  5 Extended
/dev/sda5       1052672 41940991 40888320 19.5G 83 Linux
Disk /dev/sdb: 30 GiB, 32212254720 bytes, 62914560 sectors
Disk model: VMware Virtual S
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: dos
Disk identifier: 0x4b24993c
Device     Boot    Start      End  Sectors Size Id Type
/dev/sdb1           2048 20973567 20971520  10G 8e Linux LVM
/dev/sdb2       20973568 41945087 20971520  10G 8e Linux LVM
Disk /dev/mapper/vg-lv: 6 GiB, 6442450944 bytes, 12582912 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/vg-lv1: 5 GiB, 5368709120 bytes, 10485760 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

Now list the logical volume

root@LinuxHelp:~# lvs
  LV   VG Attr       LSize Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  lv   vg -wi-a----- 6.00g                                                    
  lv1  vg -wi-a----- 5.00g        

Before mount the logical volume, format the partitions

root@LinuxHelp:~# mkfs.ext4 /dev/mapper/vg-lv
mke2fs 1.45.5 (07-Jan-2020)
Creating filesystem with 1572864 4k blocks and 393216 inodes
Filesystem UUID: 3607368c-4105-4b33-a526-539b9adc8b8d
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736
Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done 
root@LinuxHelp:~# mkfs.ext4 /dev/mapper/vg-lv1
mke2fs 1.45.5 (07-Jan-2020)
Creating filesystem with 1310720 4k blocks and 327680 inodes
Filesystem UUID: ab479b62-04f6-4324-b7b2-8c3674438dd8
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736
Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done 

Now list the logical volumes

root@LinuxHelp:~# lvs
  LV   VG Attr       LSize Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  lv   vg -wi-a----- 6.00g                                                    
  lv1  vg -wi-a----- 5.00g              

Now mount the logical volumes to the local disk by execute the following command

root@LinuxHelp:~# mount /dev/mapper/vg-lv /home/user /Downloads/

Check the disk by executing the following command

root@LinuxHelp:~# df -h
Filesystem          Size  Used Avail Use% Mounted on
udev                1.9G     0  1.9G   0% /dev
tmpfs               391M  1.6M  390M   1% /run
/dev/sda5            20G  6.9G   12G  39% /
tmpfs               2.0G     0  2.0G   0% /dev/shm
tmpfs               5.0M  4.0K  5.0M   1% /run/lock
tmpfs               2.0G     0  2.0G   0% /sys/fs/cgroup
/dev/sda1           511M  4.0K  511M   1% /boot/efi
tmpfs               391M   20K  391M   1% /run/user/1000
/dev/sr0            1.9G  1.9G     0 100% /media/netaxis/Linux Mint 20 Cinnamon 64-bit
/dev/mapper/vg-lv   5.9G   24M  5.6G   1% /home/user/Downloads
/dev/mapper/vg-lv1  4.9G   20M  4.6G   1% /home/user/Documents

With this method, to create partitions using LVM on Linux mint 20 is comes to an end.

Tags:
mason
Author: 

Comments ( 0 )

No comments available

Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

What is Logical Volume Management tool?

A

LVM is the Logical Volume Management tool that comprises allocating disks, segmenting, replication, and resize the logical volumes. It is used to allocate a hard drive or set of hard drives to one or more physical volumes which can be placed on other block devices that might span two or more disks.

Q

How to create physical volume?

A

The command is # pvcreate (name) /dev/sdb1(Physycal volume Path)

Q

How do we list the physical volume?

A

Use the following command # pvs

Q

How do we list out the volume group?

A

The following command is # lvs

Q

What are the steps to the LVM?

A

1. Physical volume
2. Volume Group
3. Logical Volume

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 Luke ?
workbench for debian

I am using workbench in CentOS whereas now I need to use Debian Operating system so could you please help to install and use in Debian?

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.