Score:0

Resize blocks of linux filesystem

de flag

I use UbuntuServer on an Dedicated Server in Version 21.04 and just resized my HDD in the HyperViser. But now I can't change the blocksize of the sda2 (my Linux Filesystem). I tried few diffrent things but nearly everything get's the same error.

For example:

sudo resize2fs -p /dev/sda2
resize2fs 1.45.7 (28-Jan-2021)
The filesystem is already 16776448 (4k) blocks long.  Nothing to do!

Furthermore here are the blocks sizes of the sda, sda1 and 2.

cat /proc/partitions
major minor  #blocks  name
 8       0  268435456 sda
 8       1       1024 sda1
 8       2   67105792 sda2

Y'all would be awesome if you could give me any hint where I wen't wrong.

Jannes Botis avatar
in flag
1st try to reboot the server, and then try again.
Score:0
es flag

So you resized your disk from the outside (on the host system); that's the first step.

As the next step, you need to resize the partition that your filesystem is on. The filesystem can only grow as large as the partition that it's on; that's what that message tells you.

You can use the resizepart sub-command of parted. See also https://unix.stackexchange.com/questions/169395/how-do-i-resize-partitions-and-filesystems-on-them

When you are done with that, you can use that resize2fs command.

de flag
Thank you very much, that help me a lot :)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.