Customise Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorised as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.

No cookies to display.

Increasing the size of Root Partition

Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
  • User AvatarKiran Dalvi
  • 11 Aug, 2022
  • 0 Comments
  • 2 Mins Read

Increasing the size of Root Partition

This blog describes how to increase the size of the default logical volume VolGroup00-LogVol00 mounted at the root “/” directory of a guest vServer.

  1. Create a volume (say 100gb)
  2. Attach the volume to the vServer, for which you want to modify the size of the root partition.
  3. Log in, as the rootuser, to the vServer.
  4. Examine the current partitioning by running the following commands: 
    1
    # df -h
  5. Examine the available physical volumes on the vServer by running the following command:
    1
    # cat /proc/partitions
  6. Run the fdisk command, 

    # fdisk /dev/xvdb

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
42
43
44
45
46
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
The number of cylinders for this disk is set to 13054.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): p
Disk /dev/xvdb: 107.3 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
    Device Boot      Start         End      Blocks   Id  System
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-13054, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-13054, default 13054):
Using default value 13054
  
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 8e
Changed system type of partition 1 to 8e (Linux LVM)
  
Command (m for help): p
  
Disk /dev/xvdb: 107.3 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
  
    Device Boot      Start         End      Blocks   Id  System
/dev/xvdb1               1       13054   104856223+  8e  Linux LVM
  
Command (m for help): w
The partition table has been altered!
  
Calling ioctl() to re-read partition table.
Syncing disks.

7. Create a physical volume:

1
# pvcreate /dev/xvdb1

8.  Extend the volume group VolGroup00with the physical volume /dev/xvdb1:

1
# vgextend VolGroup00 /dev/xvdb1 

9. Extend the logical volume LogVol00:

1
# lvextend -l +100%FREE /dev/VolGroup00/LogVol00

10. Resize the file system:

1
# resize2fs /dev/VolGroup00/LogVol00

11.   Check whether the root partition of the guest vServer has the updated size, by running the df -hcommand as shown in the following example:

1
# df -h