0644.html 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Resizing/Extending Logical Volumes (LVM) in Proxmox</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <meta charset="UTF-8">
  7. <meta name="keywords" content="Home Lab,Hypervisor,Linux,Proxmox Tutorial,Proxmox,Ubuntu,Debian,Virtualization,How To Resize Proxmox Root Volume,How To Resize Proxmox LVM,LVM,Linux Volume Management,Volumes Groups,Logical Volumes,Disks,Physical Disk,Disk Partitioning,Partition Resizing,Volume Resizing,LVM Resizing,Proxmox Storage,How To,Tutorial,i12bretro">
  8. <meta name="author" content="i12bretro">
  9. <meta name="description" content="Resizing/Extending Logical Volumes (LVM) in Proxmox">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  11. <meta name="revised" content="08/21/2022 09:24:47 AM" />
  12. <link rel="icon" type="image/x-icon" href="includes/favicon.ico">
  13. <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  14. <script type="text/javascript" src="includes/js/steps.js"></script>
  15. <link href="css/steps.css" rel="stylesheet" type="text/css" />
  16. </head>
  17. <body>
  18. <div id="gridContainer">
  19. <div class="topMargin"></div>
  20. <div id="listName" class="topMargin">
  21. <h1>Resizing/Extending Logical Volumes (LVM) in Proxmox</h1>
  22. </div>
  23. <div></div>
  24. <div id="content">
  25. <h2>What is LVM?</h2>
  26. <blockquote><em>LVM stands for Logical Volume Management. It is a system of managing logical volumes, or filesystems, that is much more advanced and flexible than the traditional method of partitioning a disk into one or more segments and formatting that partition with a filesystem. - <a href="https://wiki.ubuntu.com/Lvm" target="_blank">https://wiki.ubuntu.com/Lvm</a></em></blockquote>
  27. <h2>WARNING</h2>
  28. <blockquote>Below are the steps I took when I replaced my Proxmox 32GB microSD with a 64GB and cloned the installation from the old card to the new one. Do not attempt these steps without first having a backup as there is a high risk of data loss if the partition changes are unsuccessful</blockquote>
  29. <h2>Extending a LVM Volume</h2>
  30. <ol>
  31. <li>Log into the device using LVM, in this example I&#39;ll be extending the pve-root and data volumes in Proxmox</li>
  32. <li>Run the following commands in terminal
  33. <div class="codeBlock"># login as root if needed (not needed for proxmox)<br />
  34. sudo su<br />
  35. # list disks and partitions<br />
  36. fdisk -l<br />
  37. # list volume groups<br />
  38. vgdisplay<br />
  39. # list logical volumes<br />
  40. lvdisplay<br />
  41. # edit partitions with fdisk, change device id as needed<br />
  42. fdisk /dev/sda<br />
  43. # print the partition table<br />
  44. p<br />
  45. # delete a partition<br />
  46. d<br />
  47. # enter the lvm partition number<br />
  48. 3<br />
  49. # create a new partition<br />
  50. n<br />
  51. # enter the new partition number, same as the number deleted<br />
  52. 3<br />
  53. # press enter to accept the default first sector<br />
  54. # press enter to accept the default last sector<br />
  55. # when prompted about removing the LVM signature, enter N<br />
  56. n<br />
  57. # set the partition type<br />
  58. t<br />
  59. # enter the partition number<br />
  60. 3<br />
  61. # set the type to Linux LVM<br />
  62. 30<br />
  63. # write the changes<br />
  64. w<br />
  65. # list disks and partitions, noting the size increase<br />
  66. fdisk -l<br />
  67. # extend the existing physical volume<br />
  68. pvresize /dev/sda3<br />
  69. # extend the pve-root logical volume to 100% available free space<br />
  70. lvresize -L +8GB /dev/pve/root<br />
  71. # extend the underlying file system<br />
  72. resize2fs /dev/mapper/pve-root<br />
  73. # list logical volumes, noting root is now 8GB larger<br />
  74. lvdisplay<br />
  75. # extend the data to 100% available free space<br />
  76. lvextend -l +100%FREE pve/data<br />
  77. # list logical volumes, noting data is now over 35GB<br />
  78. lvdisplay</div>
  79. </li>
  80. </ol>
  81. <p>Further Reading: <a href="https://wiki.ubuntu.com/Lvm" target="_blank">https://wiki.ubuntu.com/Lvm</a></p> </div>
  82. </div>
  83. </body>
  84. </html>