0

This question already has an answer here:

I'm doing this with VMs. I'm using virtualbox and I made the mistake of creating a server with a dynamic disk. I then proceeded to create another virtual disk, a fixed one, into which I cloned the server OS. This because sda1 would not grow in size as it's supposed to in a dynamic disk, instead creating an extended partition and some other.

Having the server on a fixed disk did not help as sda1 remained the same size, only the extended partition got bigger.

So, I added that disk to a desktop version VM I had so I could comfortably use gparted and make the partition bigger manually.

Now, the extended partition and the other one (sda5) I don't remember the filesystem of, had these key symbols, and even running gparted with root privileges wouldn't let me delete or change those in any way.

So I turned to fdisk. I was able to easily delete sda2 and sda5, and then use gparted to make sda1 bigger. I left 1Mb at the end.

The problem I'm having now comes in here. The server will still say it doesn't have enough space to do this or that, even though it does.

server@ubuntu:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            2.5G     0  2.5G   0% /dev
tmpfs           508M  7.3M  501M   2% /run
/dev/sda1       2.8G  2.7G     0 100% /
tmpfs           2.5G     0  2.5G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           2.5G     0  2.5G   0% /sys/fs/cgroup
/dev/sdb1        15G   47M   14G   1% /home/server/sxtngig
tmpfs           508M     0  508M   0% /run/user/1000
server@ubuntu:~$ lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0    8G  0 disk
└─sda1   8:1    0    8G  0 part /
sdb      8:16   0   15G  0 disk
└─sdb1   8:17   0   15G  0 part /home/server/sxtngig
sr0     11:0    1 1024M  0 rom

As you can see, it has 8Gb but df can't see it. Is there a way I can make the server refresh the disk space? Maybe something in a file I need to change?

marked as duplicate by Stephen Kitt, Archemar, Thomas Dickey, Ulrich Schwarz, countermode Oct 27 '16 at 10:05

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

You resized the partition (the container for the filesystem), but not the filesystem itself. (It's a bit like moving your papers to a bigger cabinet, but not telling anyone to use the new drawers.)

Assuming it's an ext4 filesystem resize2fs is what you need. (If it wasn't ext4 you need a different command, but modern filesystems should support resizing anyway.) See also e.g. https://access.redhat.com/articles/1196353

1

You have resized the partition, but not the filesystem on it. You need to run resize2fs.

Not the answer you're looking for? Browse other questions tagged or ask your own question.