Changing partition on Ubuntu 17.10
Date: January 21, 2018
-
Description of the problem.
It is quite a popular tool to launch Ubuntu on virtual machine in order to test some features or new tools. I personally use VirtualBox for it and Ubuntu 17.10 x64 distribution.
But, that’s a common mistake to make a small drive partition (like 15-20 GB). And, after a while, when you have a plenty of software installed there, you get a message “Low Disk Space”
So, the typical step is to shut down virtual machine and change the virtual disk size via Virtual Media Manager.
But it doesn’t help on Ubuntu start, it freezes with a black screen. And on the screen you can see the line “Started User Manager for UID 121”, which means that Ubuntu can’t load the graphic interface.
-
Fixing the problem.
Firstly, you need to press “ESC” on Virtual Machine start (which will take you to Ubuntu book menu), and load Ubuntu in recovery mode.
The tool
dpkg
will show exactly, if the problem is a lack of free place and how much free space operating system needs just to load GUI.Further steps are briefly described here. So, your Ubuntu can fix this problem by its own means, no LiveCD required. Just use the tool
root
from Recovery Menu list, and paste following commands there:sudo fdisk /dev/sda
– to run necessary tool;p
– to view listed partitions;d
– to delete dev/sda1;n
– to create a new one with partition typep
and without removing the signature;a
– to make partition bootable;w
– to write changes.After that command I additionally ran
sudo mount -o remount, rw /
because my hard drive was mounted in read-only mode, andsudo partprobe
– cause simple reboot, as it was adviced on Stackoverflow, didn’t take an effect.sudo reboot
;sudo mount -o remount, rw /
andsudo resize2fs /dev/sda1
– to make the filesystem to take all available space on the partition.After these steps Ubuntu loads successfully.