ubuntu_extend_default_lvm_space

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ubuntu_extend_default_lvm_space [2023/06/29 19:37] wikiadminubuntu_extend_default_lvm_space [2023/06/29 20:01] (current) wikiadmin
Line 1: Line 1:
 ====== Ubuntu - Extend Your Default LVM Space ====== ====== Ubuntu - Extend Your Default LVM Space ======
  
-So, like me, you installed Ubuntu and accepted the default use of lvm and now your operating volume is very small and the Ubuntu installer did not utilize the entire physical drive. There is a ton of free space that is not being utilized.  And,  possibly, your freshly installed cloud application (NextCloud) will soon exceed the allotted space within the first week or so as a result of data uploading or synchronization.+So, like me, you installed Ubuntu and accepted the installers default selections for lvm and now your operating volume is very small and the Ubuntu installer did not utilize the entire physical drive. There is a ton of space that is not being utilized.  And,  possibly, your freshly installed cloud application (NextCloud) will soon exceed the allotted space within the first week or so as a result of data uploading or synchronization. 
 + 
 +All credit for the concepts and sequences of commands goes to the publishers of the article that you can find by clicking the following link:
  
-All credit goes to  this article: 
 [[https://packetpushers.net/ubuntu-extend-your-default-lvm-space/]] [[https://packetpushers.net/ubuntu-extend-your-default-lvm-space/]]
  
 +
 +This first example below involves a 1TB physical drive of which Ubuntu's default partitioning only allotted 98GB to the operating volume shown as 'ubuntu--vg-ubuntu--lv' below.
 +
 +First run df -h 
  
 <code> <code>
Line 20: Line 25:
 tmpfs                              791M  4.0K  791M   1% /run/user/1000 tmpfs                              791M  4.0K  791M   1% /run/user/1000
 </code> </code>
 +
 +Next run vgdisplay
  
 <code> <code>
Line 50: Line 57:
 </code> </code>
  
 +Next run lvdisplay
  
 <code> <code>
Line 73: Line 81:
   Block device           253:0   Block device           253:0
 </code> </code>
 +
 +Switching to root user
  
 <code> <code>
Line 79: Line 89:
 root@svr1:~# root@svr1:~#
 </code> </code>
 +
 +Run the following to extend the LV to the maximum size usable.
  
 <code> <code>
Line 121: Line 133:
  
 This is a continuation of the above: now extending the file system to utilize the entire resized volume on a 1TB physical drive. This is a continuation of the above: now extending the file system to utilize the entire resized volume on a 1TB physical drive.
 +
 +Re-established remote ssh connection and want to again switch to root user.
  
 <code> <code>
Line 127: Line 141:
 root@svr1:/home/user# cd root@svr1:/home/user# cd
 </code> </code>
 +
 +Run df -h to see where we are.  Notice that ubuntu--vg-ubuntu--lv   is still only 98G.  We still need to extend the filesystem to match the resized LV.
  
 <code> <code>
Line 138: Line 154:
 tmpfs                              791M  4.0K  791M   1% /run/user/1000 tmpfs                              791M  4.0K  791M   1% /run/user/1000
 </code> </code>
 +
 +Let's check vgdisplay
  
 <code> <code>
Line 165: Line 183:
   VG UUID               rF3fw2-13h2-kAiL-aeWA-KyDZ-5HQU-GwvKDe   VG UUID               rF3fw2-13h2-kAiL-aeWA-KyDZ-5HQU-GwvKDe
 </code> </code>
 +
 +Let's check lvdisplay
  
 <code> <code>
Line 188: Line 208:
   Block device           253:0   Block device           253:0
 </code> </code>
 +
 +Now, run the following command to resize the file system to the full size of the resized volume.
  
 <code> <code>
Line 199: Line 221:
 </code> </code>
  
-End of resizing on the 1TB physical drive.  IF EVERYTHING WENT WELL, THEN STOP HERE.+Run df -h 
 + 
 +And notice that 'ubuntu--vg-ubuntu--lv'  is now 914G 
 + 
 +<code> 
 +root@svr1:~# df -h 
 +</code> 
 + 
 +<code> 
 +Filesystem                         Size  Used Avail Use% Mounted on 
 +tmpfs                              791M  1.2M  790M   1% /run 
 +/dev/mapper/ubuntu--vg-ubuntu--lv  914G  7.0G  869G   1% / 
 +tmpfs                              3.9G      3.9G   0% /dev/shm 
 +tmpfs                              5.0M      5.0M   0% /run/lock 
 +/dev/sda2                          2.0G  130M  1.7G   8% /boot 
 +tmpfs                              791M  4.0K  791M   1% /run/user/1000 
 +root@svr1:~# 
 + 
 +</code> 
 + 
 +**End of resizing on the 1TB physical drive.  IF EVERYTHING WENT WELL, THEN STOP HERE.**
  
  
 FOLLOWING IS ANOTHER UNRELATED EXAMPLE OF THE SECOND PART OF THE PROCESS: FOLLOWING IS ANOTHER UNRELATED EXAMPLE OF THE SECOND PART OF THE PROCESS:
  
-Note:  The following operations and output involves a 2TB physical drive instead of 1TB (like above).  This is a different server where only the second part of this resizing job is depicted below, likewise properly finished by extending the file system on top of the block volume that you just extended. +Example 2: 
 + 
 +Note:  The following operations and output involves a 2TB physical drive instead of 1TB (like above).  This is a different server where **only the second part of this resizing job is depicted below**, likewise properly finished by extending the file system on top of the block volume that you just extended. 
  
 Again, at this point we have increased the size of the block volume where your root filesystem resides, but you still need to extend the filesystem on top of it.  Again, at this point we have increased the size of the block volume where your root filesystem resides, but you still need to extend the filesystem on top of it. 
ubuntu_extend_default_lvm_space.1688067438.txt.gz · Last modified: 2023/06/29 19:37 by wikiadmin