5

I want to grow an ext4 volume on a host, but I noticed that there is no valid partition table to delete and remake:

fdisk -u /dev/vdb
/dev/vdb: device contains a valid 'ext4' signature; it is strongly recommended to wipe the device with wipefs(8) if this is unexpected, in order to avoid possible collisions

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xd2971c02.

root@host:~# lsblk
NAME   MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda    253:0    0  20G  0 disk 
`-vda1 253:1    0  20G  0 part /
vdb    253:16   0   1T  0 disk /mnt/redacted
vdc    253:32   0  64M  0 disk 

If I grow the size of the underlying disk to add a few hundred GB, how am I supposed to let the OS know about the increase before resize2fs? I'm not seeing a partition table to grow in the first place.

Could I essentially just grow the disk, then create a new partition of the entire disk, write the changes, and resize2fs?

1 Answer 1

11

I'm not seeing a partition table to grow in the first place.

Because there isn't one. In general partition table is not needed, you can format a disk to ext4 (or other filesystem) and use it directly without partitions. It's a perfectly valid use case if you want to use the entire disks without partitioning it. Just resize the disk, reboot the VM (or disconnect and connect the disk back) and resize the filesystem using resize2fs without the size parameter to resize it to the size of the disk.

2
  • 3
    Don't forget to snapshot/backup first! Oct 12, 2020 at 20:08
  • I joined just to up vote this answer! I do disk partitions so infrequent I couldn't remember all of the details about ext4 when it comes to partitions and such. This was the needed info. Thank you. Jan 21, 2023 at 23:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .