Permission denied to resize filesystem

Posted May 15, 2020 6.3k views
UbuntuUbuntu 16.04

As described in the doc page I tried to resize my droplet running Ubuntu 16

root@ubuntu:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.6 LTS
Release:        16.04
Codename:       xenial

I resized from:

  • 15$ 1vcpu 3gb ram 60gb disk to
  • 20$ 2vcpu 4gb ram 80gb disk

So I turned off the droplet, launched resize and turned back on.

Then I run df -h and I don’t see 80gb but 60gb.

root@ubuntu:~# df -Th /dev/vda1
Filesystem     Type  Size  Used Avail Use% Mounted on
/dev/vda1      ext4   58G   25G   34G  43% /

So as described in the doc page I tried to resize the disk checking that i use ext4:

root@ubuntu:~# gdisk -l /dev/vda
GPT fdisk (gdisk) version 1.0.1

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/vda: 167772160 sectors, 80.0 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 18451246-590F-4CCF-88A0-81943A03E074
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 167772126
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1          227328       167772126   79.9 GiB    8300  
  14            2048           10239   4.0 MiB     EF02  
  15           10240          227327   106.0 MiB   0700 

But the partition is not resized:

root@ubuntu:~# df -Th /dev/vda1
Filesystem     Type  Size  Used Avail Use% Mounted on
/dev/vda1      ext4   58G   25G   34G  43% /

When I do:

root@ubuntu:~# growpart /dev/vda 1
NOCHANGE: partition 1 is size 167544799. it cannot be grown


root@ubuntu:~# resize2fs /dev/vda1
resize2fs 1.42.13 (17-May-2015)
Filesystem at /dev/vda1 is mounted on /; on-line resizing required
old_desc_blocks = 4, new_desc_blocks = 5
resize2fs: Permission denied to resize filesystem

I have no luck and I can’t expand the disk.

any help?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

Hello, @tonydangelo123

What you can do is to first run a file system check for the partition and then resize the file system. You can check if everything is okay with this command:

e2fsck -f /dev/vda1

and then run the resize command:

resize2fs /dev/vda1

You can also check our official documentation for resizing droplets:

Let me know how it goes.


Hi @alexdo,

thank you for your message.

I did follow the documentation, and my main problem is that I’m trying to resize the partition where my root folder is mounted /

So when I run:

root@ubuntu:~# e2fsck -f /dev/vda1
e2fsck 1.42.13 (17-May-2015)
/dev/vda1 is mounted.
e2fsck: Cannot continue, aborting.

I can’t unmount my root folder.