Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save cloud-inetum/2c7872a4eb875623512ebb5a2cf3b56a to your computer and use it in GitHub Desktop.

Select an option

Save cloud-inetum/2c7872a4eb875623512ebb5a2cf3b56a to your computer and use it in GitHub Desktop.

Revisions

  1. @paranlee paranlee revised this gist Mar 24, 2022. 1 changed file with 3 additions and 5 deletions.
    8 changes: 3 additions & 5 deletions Ubuntu disk resize Hyper-V Quick.md
    Original file line number Diff line number Diff line change
    @@ -29,19 +29,17 @@ sudo apt install cloud-guest-utils
    ## 6. Expand the sda1 partition into the free space:

    ```console
    ~$ sudo growpart /dev/sda 1
    # (Note the space between sda and 1!)
    ~$ sudo growpart /dev/sda 1
    ```

    (Note the space between sda and 1!)

    ## 7. Finally run resize2fs:

    ```console
    # (No space between sda and 1 here!)
    ~$ sudo resize2fs /dev/sda1
    ```

    (No space between sda and 1 here!)

    Now your Ubuntu drive is 128 GB.

    referenced [expand-ubuntu-disk-after-hyper-v-quick-create](http://linguist.is/2020/08/12/expand-ubuntu-disk-after-hyper-v-quick-create/)
  2. @paranlee paranlee revised this gist Mar 24, 2022. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions Ubuntu disk resize Hyper-V Quick.md
    Original file line number Diff line number Diff line change
    @@ -16,7 +16,9 @@ Use Hyper-V Manager to select the Settings of the Virtual Machine, select the Ha

    ## 4. Start the VM again. Install Guest Utils:

    ```
    sudo apt install cloud-guest-utils
    ```

    ## 5. If not using English, override locale settings to avoid issues with non-English locales:

  3. @paranlee paranlee revised this gist Jul 1, 2021. 1 changed file with 9 additions and 3 deletions.
    12 changes: 9 additions & 3 deletions Ubuntu disk resize Hyper-V Quick.md
    Original file line number Diff line number Diff line change
    @@ -20,17 +20,23 @@ sudo apt install cloud-guest-utils

    ## 5. If not using English, override locale settings to avoid issues with non-English locales:

    $ LC_ALL=C
    ```console
    ~$ LC_ALL=C
    ```

    ## 6. Expand the sda1 partition into the free space:

    sudo growpart /dev/sda 1
    ```console
    ~$ sudo growpart /dev/sda 1
    ```

    (Note the space between sda and 1!)

    ## 7. Finally run resize2fs:

    sudo resize2fs /dev/sda1
    ```console
    ~$ sudo resize2fs /dev/sda1
    ```

    (No space between sda and 1 here!)

  4. @paranlee paranlee created this gist Jul 1, 2021.
    39 changes: 39 additions & 0 deletions Ubuntu disk resize Hyper-V Quick.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,39 @@
    # Expand Ubuntu disk after Hyper-V Quick Create

    It is quick and easy to use Hyper-V Quick Create to get an Ubuntu virtual machine running on a Windows 10 computer. However, if this method is used, you may end up with a tiny Ubuntu virtual disk that will not be useful for any serious work and it is less obvious than the initial setup how to increase the size of this disk.

    These steps fix the problem:

    ## 1. Turn off the VM.

    ## 2. Hyper-V Manager Settings Virtual hard disk.

    Use Hyper-V Manager to select the Settings of the Virtual Machine, select the Hard Drive option and Edit under Virtual hard disk.

    (If this option is disabled, you need to go back and delete any checkpoints for the VM in the Hyper-V Manager; just select the VM and right click the checkpoint in the checkpoint field below.)

    ## 3. Use the GUI to expand the drive to something reasonable, like 128 GB. Ubuntu now has space to expand into.

    ## 4. Start the VM again. Install Guest Utils:

    sudo apt install cloud-guest-utils

    ## 5. If not using English, override locale settings to avoid issues with non-English locales:

    $ LC_ALL=C

    ## 6. Expand the sda1 partition into the free space:

    sudo growpart /dev/sda 1

    (Note the space between sda and 1!)

    ## 7. Finally run resize2fs:

    sudo resize2fs /dev/sda1

    (No space between sda and 1 here!)

    Now your Ubuntu drive is 128 GB.

    referenced [expand-ubuntu-disk-after-hyper-v-quick-create](http://linguist.is/2020/08/12/expand-ubuntu-disk-after-hyper-v-quick-create/)