Resize hard disk

Feb 21, 2023
39
0
11
I have an docker running in an VM and it need more storage.

I have resized it here;
1693320156732.png

But in the VM cant use it...
1693320185145.png

/dev/sba2 is the extra space...
 
Hi,
you will have to increase:
  1. The disk itself (which you already did)
  2. The partition on the disk (not sure what you changed or didn't change there)
  3. The filesystem on that partition
It is easiest to use a Linux Live CD with tools such as gparted [0] to perform steps 2 and 3.

[0] https://gparted.org/livecd.php
 
In the unlikely event this lack of forward capacity planning happens to me (cough, cough) I tend to just add another disk, move existing stuff from /var/lib/docker to that and then make it a sym-link to the new disk.

Of course that means shutting down Docker for a moment... no reboot required, though.

You may want to prune the original disk manually so its free space is reclaimed (fstrim).

Sounds easier than messing with a live CD to me and net storage consumption would be the same.