ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Resize Linux VM Ext4 File System Proxmox

    IT Discussion
    ext4 extend file system
    5
    9
    2.5k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      CloudKnight
      last edited by

      I've just completed this and didn't want to use Gparted. I've searched and couldn't find any guides on here so I've created the steps I took to extend an Ext4 partition without data loss. I extended the VM storage size in proxmox:

      WARNING!!!!!! -Backup all data first! accidentally entering the wrong commands could loose all your data on the partition, extreme caution should be used when extending partitions.

      You should also note to check your not using LVM file system. You can check by typing df -h -T – this will show if it’s a EXT4 or LVM partition.

      1. First shutdown VM
      2. extend VM storage by the amount you need
      3. Boot from latest Ubuntu CD (present time 20.04LTS)
      4. don’t go through installer, select help from top right corner
        Select enter shell option, you will now enter a bash shell
      5. get a list off filesystems by typing df -h -T – you should see something like root “/” type ext4
      6. you can type in fdisk -l to display attached drives.
      7. my drive is called sda – so type in fdisk /dev/sda
      8. press p to display partitions
      9. I have Sda1 and sda2 – sda1 is my boot partition
      10. You will also see start and end sectors, make a note in case of problems
      11. enter d to delete partition, so select 2 (we don’t want to delete our boot partition)
      12. enter p and you will now see the partition is deleted.
      13. press n to create partition it will say (default 2) just press enter
      14. it will display first sector with default of your previous partition – just press Enter (don’t change)
      15. It will then display last sector, once again just press Enter (don’t change)
      16. it will ask partition #2 contains an ext4 – just say NO to removing signature.
      17. enter w to write the partition data.
      18. once you are out of fdisk if you type df -h you will notice size hasn’t extended.
      19. we have to manually extend the file system with command resize2fs /dev/sda2
        you will now see the extended space added in root “/” by typing df -h
      M 1 Reply Last reply Reply Quote 3
      • M
        marcinozga @CloudKnight
        last edited by

        I see few issues above.

        • LVM is not a filesystem.
        • You don't need to shutdown VM to extend its disk size.
        • You don't need to boot from any installer CD to resize partitions, you can do it from within live system with fdisk, although if you have some unusual partition layout you're probably better off doing it offline.
        • You can also extend filesystem on a live system, no need for shutdown.
        D C 2 Replies Last reply Reply Quote 1
        • D
          Dashrender @marcinozga
          last edited by

          @marcinozga said in Resize Linux VM Ext4 File System Proxmox:

          I see few issues above.

          • LVM is not a filesystem.
          • You don't need to shutdown VM to extend its disk size.
          • You don't need to boot from any installer CD to resize partitions, you can do it from within live system with fdisk, although if you have some unusual partition layout you're probably better off doing it offline.
          • You can also extend filesystem on a live system, no need for shutdown.

          I thought his approach was over cautious. Windows will allow you to extend any partition except the 😄 drive live, and I'm guessing you can likely extend even / live in Linux OSes.

          M H 2 Replies Last reply Reply Quote 0
          • M
            marcinozga @Dashrender
            last edited by

            @dashrender said in Resize Linux VM Ext4 File System Proxmox:

            @marcinozga said in Resize Linux VM Ext4 File System Proxmox:

            I see few issues above.

            • LVM is not a filesystem.
            • You don't need to shutdown VM to extend its disk size.
            • You don't need to boot from any installer CD to resize partitions, you can do it from within live system with fdisk, although if you have some unusual partition layout you're probably better off doing it offline.
            • You can also extend filesystem on a live system, no need for shutdown.

            I thought his approach was over cautious. Windows will allow you to extend any partition except the 😄 drive live, and I'm guessing you can likely extend even / live in Linux OSes.

            Are you sure about extending c:? I've done it many times, on live systems. Although it was on bare metal desktops after cloning drive to a bigger one.

            D 1 Reply Last reply Reply Quote 0
            • D
              Dashrender @marcinozga
              last edited by

              @marcinozga said in Resize Linux VM Ext4 File System Proxmox:

              @dashrender said in Resize Linux VM Ext4 File System Proxmox:

              @marcinozga said in Resize Linux VM Ext4 File System Proxmox:

              I see few issues above.

              • LVM is not a filesystem.
              • You don't need to shutdown VM to extend its disk size.
              • You don't need to boot from any installer CD to resize partitions, you can do it from within live system with fdisk, although if you have some unusual partition layout you're probably better off doing it offline.
              • You can also extend filesystem on a live system, no need for shutdown.

              I thought his approach was over cautious. Windows will allow you to extend any partition except the 😄 drive live, and I'm guessing you can likely extend even / live in Linux OSes.

              Are you sure about extending c:? I've done it many times, on live systems. Although it was on bare metal desktops after cloning drive to a bigger one.

              You did it live with windows tools? OK that would be a new one on me.

              O 2 Replies Last reply Reply Quote 0
              • H
                hobbit666 @Dashrender
                last edited by

                @dashrender said in Resize Linux VM Ext4 File System Proxmox:

                I thought his approach was over cautious. Windows will allow you to extend any partition except the 😄 drive live, and I'm guessing you can likely extend even / live in Linux OSes.

                Did a C:\ drive on a SQL server VM month or two ago.

                1 Reply Last reply Reply Quote 1
                • O
                  Obsolesce @Dashrender
                  last edited by

                  @dashrender said in Resize Linux VM Ext4 File System Proxmox:

                  @marcinozga said in Resize Linux VM Ext4 File System Proxmox:

                  @dashrender said in Resize Linux VM Ext4 File System Proxmox:

                  @marcinozga said in Resize Linux VM Ext4 File System Proxmox:

                  I see few issues above.

                  • LVM is not a filesystem.
                  • You don't need to shutdown VM to extend its disk size.
                  • You don't need to boot from any installer CD to resize partitions, you can do it from within live system with fdisk, although if you have some unusual partition layout you're probably better off doing it offline.
                  • You can also extend filesystem on a live system, no need for shutdown.

                  I thought his approach was over cautious. Windows will allow you to extend any partition except the 😄 drive live, and I'm guessing you can likely extend even / live in Linux OSes.

                  Are you sure about extending c:? I've done it many times, on live systems. Although it was on bare metal desktops after cloning drive to a bigger one.

                  You did it live with windows tools? OK that would be a new one on me.

                  I've done it lots of times on C for physical and virtual using built in tools. That's not a new one.

                  1 Reply Last reply Reply Quote 1
                  • O
                    Obsolesce @Dashrender
                    last edited by

                    @dashrender said in Resize Linux VM Ext4 File System Proxmox:

                    @marcinozga said in Resize Linux VM Ext4 File System Proxmox:

                    @dashrender said in Resize Linux VM Ext4 File System Proxmox:

                    @marcinozga said in Resize Linux VM Ext4 File System Proxmox:

                    I see few issues above.

                    • LVM is not a filesystem.
                    • You don't need to shutdown VM to extend its disk size.
                    • You don't need to boot from any installer CD to resize partitions, you can do it from within live system with fdisk, although if you have some unusual partition layout you're probably better off doing it offline.
                    • You can also extend filesystem on a live system, no need for shutdown.

                    I thought his approach was over cautious. Windows will allow you to extend any partition except the 😄 drive live, and I'm guessing you can likely extend even / live in Linux OSes.

                    Are you sure about extending c:? I've done it many times, on live systems. Although it was on bare metal desktops after cloning drive to a bigger one.

                    You did it live with windows tools? OK that would be a new one on me.

                    Also did it live on Linux as well in both cases.

                    1 Reply Last reply Reply Quote 1
                    • C
                      CloudKnight @marcinozga
                      last edited by

                      @marcinozga said in Resize Linux VM Ext4 File System Proxmox:

                      I see few issues above.

                      • LVM is not a filesystem.
                      • You don't need to shutdown VM to extend its disk size.
                      • You don't need to boot from any installer CD to resize partitions, you can do it from within live system with fdisk, although if you have some unusual partition layout you're probably better off doing it offline.
                      • You can also extend filesystem on a live system, no need for shutdown.
                      1. correct, didn't think properly when I wrote that. Logical volumes can be put into logical groups that could contain pools of hdd's that can be sees as one, can also move space around easier and have snapshots.
                      2. I had errors when trying to write the new partition layout hence why I used a live CD. Probably could of looked into it more but didn't want to spend forever on it or mess up any partition data.
                      1 Reply Last reply Reply Quote 0
                      • 1 / 1
                      • First post
                        Last post