growpart "failed to get start sector" on expanding partition

Viewed 33

Using the instructions located: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html

I can run:

lsblk
nvme0n1                                                                                            
259:1    0  200G  0 disk
├─nvme0n1p1                                                                                        
259:2    0    1M  0 part
└─nvme0n1p2                                                                                        
259:3    0  100G  0 part /

I then attempt to grow nvme0n1p2 by running:

growpart /dev/nvme0n1 3
FAILED: disk=/dev/nvme0n1 partition=3: failed to get start sector

Any thoughts on what I could be doing wrong? Running this as root. I read the other similar threads but was unable to resolve based on them.

1 Answers

This is because partition 3 does not exist.

The command you run is

growpart /dev/nvme0n1 3

How ever the first device is the drive. The number ( in this case 3 ) is the partition number. As you can see by the output of the lsblk command there is only 2 partitions. Hence the output of can't find partition

  nvme0n1    -> device                                                                                        
259:1    0  200G  0 disk
├─nvme0n1p1                                                                                        
259:2    0    1M  0 part -> first partition ( leave this alone )
└─nvme0n1p2                                                                                        
259:3    0  100G  0 part / -> your root partition and what we want to grow in order to add room

The command you need to run is

growpart /dev/nvme0n1 2

As this will enlarge the partition assigned to /. You can continue to follow this guide after this

Related