Skip to content

growpart doesn't work with nvme devices #67

Closed

Description

@purpleidea

...because it expects partition to be a number.

root@hostname:~# lsblk
NAME                                          MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
zram0                                         251:0    0     8G  0 disk  [SWAP]
nvme0n1                                       259:0    0 953.9G  0 disk
├─nvme0n1p1                                   259:1    0   600M  0 part  /boot/efi
├─nvme0n1p2                                   259:2    0     1G  0 part  /boot
└─nvme0n1p3                                   259:3    0    70G  0 part
  └─luks-xxx-xxx 252:0    0    70G  0 crypt /
root@hostname:~# growpart --dry-run /dev/nvme0n1 p3
FAILED: partition-number must be a number
root@hostname:~# growpart --version
FAILED: unknown option --version
root@hostname:~# dnf info cloud-utils-growpart
Updating and loading repositories:
Repositories loaded.
Installed packages
Name            : cloud-utils-growpart
Epoch           : 0
Version         : 0.33
Release         : 10.fc42
Architecture    : noarch
Installed size  : 74.9 KiB
Source          : cloud-utils-0.33-10.fc42.src.rpm
From repository : fedora
Summary         : A script for growing a partition
URL             : https://github.com/canonical/cloud-utils
License         : GPL-3.0-only
Description     : This package provides the growpart script for growing a partition.
                :  It is
                : primarily used in cloud images in conjunction with the dracut-modu
                : les-growroot
                : package to grow the root partition on first boot.
Vendor          : Fedora Project

Activity

  1. dermotbradley commented on Sep 16, 2025

    @dermotbradley
    Contributor

    You should not run:

    growpart --dry-run /dev/nvme0n1 p3
    

    you run:

    growpart --dry-run /dev/nvme0n1 3
    

    growpart knows whether or not a "p" should be added to create the full device name for the partition.

  2. purpleidea commented on Sep 17, 2025

    @purpleidea
    Author

    growpart knows whether or not a "p" should be added to create the full device name for the partition.

    !

    This is incredibly helpful, thanks. Would you accept a doc patch from me clarifying this?

  3. dermotbradley commented on Sep 18, 2025

    @dermotbradley
    Contributor

    This is incredibly helpful, thanks. Would you accept a doc patch from me clarifying this?

    I'm not sure what could be improved in the docs, the growpart manpage clearly describes that argument as "PARTITION-NUMBER" and states:

    The number of the partition to resize (counting from 1)
    
  4. purpleidea commented on Sep 27, 2025

    @purpleidea
    Author

    I'm not sure what could be improved in the docs, the growpart manpage clearly describes that argument as "PARTITION-NUMBER" and states:

    I didn't even know this was a thing. For example, the classic /dev/sda3 doesn't have a "p" ... Is this something that is added only for nvme devices? Are there other devices that have this kind of different pattern? Happy to have learned something today!

  5. purpleidea commented on Sep 27, 2025

    @purpleidea
    Author

    Modulo a doc patch, this can be closed.

    I've build a script in https://github.com/purpleidea/mgmt/ so if you run:

    mgmt tools grow --mount / --exec (for example) then it will grow the root fs, the parent LUKS, and the parent partition. (In the correct order of course!)

    It does the part stuff with growpart.

    This is meant for provisioning environments because it seems many "cloud images" and also the Fedora installs don't fill up the harddrive. Maybe I'm missing a flag somewhere. IDK, anyways!

  6. dermotbradley commented on Oct 6, 2025

    @dermotbradley
    Contributor

    This is meant for provisioning environments because it seems many "cloud images" and also the Fedora installs don't fill up the harddrive. Maybe I'm missing a flag somewhere.

    Assuming the "cloud images" you refer to come with cloud-init enabled then typically cloud-init does automatically enlarge the rootfs to fill the storage device by default (hint: cloud-init makes use of growpart).

  7. purpleidea commented on Oct 6, 2025

    @purpleidea
    Author

    Yeah I'm not running cloud-init. The stock Fedora kickstart for either Workstation or Server flavours seems to leave me with a not 100% utilized disk! So now I have a working solution that incorporates growpart and also the luks and ext4/xfs growing too =D

    Your partition # comment was very helpful. If you don't want a doc patch, feel free to close this ticket. Thanks again!

  8. dermotbradley commented on Oct 6, 2025

    @dermotbradley
    Contributor

    I was referring to your comment about "cloud-images" - I'd expect most/all of those to use cloud-init which would use growpart.

  9. holmanb commented on Oct 6, 2025

    @holmanb
    Member

    Thanks @dermotbradley.

    @purpleidea Since the original concern has been resolved, I'm going to close this issue. If an improved doc change is proposed, we would consider it (don't forget to sign the CLA first).

  10. purpleidea commented on Oct 6, 2025

    @purpleidea
    Author

    don't forget to sign the CLA first

    Oh! Thanks for the heads up. I guess not then, sorry I'm not allowed to sign CLA's.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions