After increasing the disk size from 200GB to 300GB of a Hyper-V VM in which Ubuntu Server is installed lsblk
shows the following
root@ubuntu:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 15G 0 disk
├─sda1 8:1 0 243M 0 part /boot
├─sda2 8:2 0 1K 0 part
└─sda5 8:5 0 14.8G 0 part
├─ubuntu--vg-root (dm-0) 252:0 0 14.2G 0 lvm /
└─ubuntu--vg-swap_1 (dm-1) 252:1 0 508M 0 lvm [SWAP]
sdb 8:16 0 300G 0 disk
└─sdb1 8:17 0 200G 0 part /media/storage
sr0 11:0 1 1024M 0 rom
Now we simply want that sdb1
which is currently mounted at /media/storage
(but could be temporarily unmounted without problems) gets increased to 300GB so that it uses all space on sdb
.
Simply using resize2fs
doesn't seem to work. What does work is booting from a GParted CD and performing a resize operation. However, as this is a non-root partition which can be unmounted this seems to be an overkill. So is there a simple way to this with the command line? (Unfortunately googling brings up really lots of stuff with GParted or about root partitions etc. pp. which does not apply here.)