• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » How to Increase Logical Volume on a GNU/Linux Server

By Abhishek Ghosh April 16, 2023 7:20 pm Updated on April 16, 2023

How to Increase Logical Volume on a GNU/Linux Server

Advertisement

The big advantage of a dedicated server is the disk space it offers. In the case of cloud/virtual, we rarely need to think about how to distribute the space to SSD, traditional hard disk and NVMe. Commonly, on a dedicated server with multiple hard disks, you’ll get the server configured with various directories mapped to various hard disks with limited space. This is because the web host does not know your purpose for using the server. For a web server or database server, usually we need a faster working larger /var/ directory, whereas our backup directory can be slow. We can configure the directories to different FTP accounts.

 

Required Commands to Increase Logical Volume

 

We can check the present sizes and space used by simply running df -h command:

Vim
1
df -h

Example output:

Advertisement

---

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Filesystem            Size  Used Avail Use% Mounted on
udev                  7.8G     0  7.8G   0% /dev
tmpfs                 1.6G  1.3M  1.6G   1% /run
/dev/md1              3.9G  400M  3.6G  11% /
/dev/ssd/usr           15G  3.3G   11G  24% /usr
tmpfs                 7.8G     0  7.8G   0% /dev/shm
tmpfs                 5.0M     0  5.0M   0% /run/lock
tmpfs                 7.8G     0  7.8G   0% /sys/fs/cgroup
/dev/mapper/ssd-home  4.8G   40K  4.6G   1% /home
/dev/mapper/ssd-var    54G   33G   19G  64% /var
/dev/loop0            117M  117M     0 100% /snap/core/14946
/dev/loop1             73M   73M     0 100% /snap/core22/607
/dev/loop2             55M   55M     0 100% /snap/lxd/12631
/dev/loop4             73M   73M     0 100% /snap/core22/583
/dev/loop3            163M  163M     0 100% /snap/lxd/24643
/dev/mapper/hdd-data  3.9G   24K  3.6G   1% /data
tmpfs                 1.6G     0  1.6G   0% /run/user/0

How to Increase Logical Volume on a linux server

However, the above command does not give a clear-cut idea about logical volumes and logical volumes. Hence, we will run:

Vim
1
vgdisplay -v

Example output:

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
--- Volume group ---
  VG Name               hdd
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  2
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               1
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               931.51 GiB
  PE Size               4.00 MiB
  Total PE              238467
  Alloc PE / Size       1024 / 4.00 GiB
  Free  PE / Size       237443 / 927.51 GiB
  VG UUID               LhWox9-igoc-2c7v-DxDH-QUoP-t0PA-STcsoL
 
  --- Logical volume ---
  LV Path                /dev/hdd/data
  LV Name                data
  VG Name                hdd
  LV UUID                iN3zRj-HEz7-UcNk-BBvG-WCnM-1xLP-y8XMbK
  LV Write Access        read/write
  LV Creation host, time ,
  LV Status              available
  # open                 1
  LV Size                4.00 GiB
  Current LE             1024
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:3
 
  --- Physical volumes ---
  ...
## output truncated

Take that, we want to increase the size of the /var directory by 10GB. /var, in this case, is a LOGICALVOLUME, belonging to ssd VOLUMEGROUP. You need the correct path in this format:

Vim
1
/dev/VOLUMEGROUP/LOGICALVOLUME

In our example, it is:

Vim
1
/dev/ssd/var

This is the command to increase the partition size by 10GB:

Vim
1
lvextend -L +10G /dev/VOLUMEGROUP/LOGICALVOLUME

In our case, it will be:

Vim
1
lvextend -L +10G /dev/ssd/var

After the correct execution of the command, After entering the command, the following message will be displayed:

Vim
1
2
Extending logical volume var to 64.00 GB
Logical volume var successfully resized

Next, we need to know the file system of the volume. In order to use the increased space, we must enlarge the file system. Running a command such as blkid will give you an idea of whether the partition’s filesystem is ext3, ext4 or something else. Different file systems will need different commands. For ext2, ext3, ext4, we will run:

Vim
1
resize2fs /dev/ssd/var

Example commands for other file systems:

Vim
1
2
3
4
# ReiserFS
resize_reiserfs -f /dev/ssd/var
# XFS
xfs_growfs /var

We can check the present size:

Vim
1
df -h /var/

This will finish our work.

Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to How to Increase Logical Volume on a GNU/Linux Server

  • Arduino and LED Bar Display : Circuit Diagram, Code

    Here is a Guide Explaining the Basics, Circuit Diagram, Code on Arduino and LED Bar Display. LED Bar Display is Actually Like Multiple LED.

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • Command Prompt Commands : Alphabetical list of all commands in Windows 7

    Command Prompt Commands in Windows 7 provides the user access to 180+ command line commands. Here is a list of 200 Command Prompt Commands in Windows 7.

  • Mount wp-content Directory into RAM Memory (HP Cloud, Nginx)

    Virtual Instances on Bad Quality Hardware Can Die Instead of Performance Boost. We Can Mount wp-content Directory into RAM Memory For Testing.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy