I have a ubuntu vmware guest with 30Gb root partition, but it's not enough after restore data from production environment, so I have to enlarge it.
- shutdown ubuntu
- enlarge partition on vmware guest setting
- start ubuntu, it's better use text mode
-
sudo fdisk /dev/sda(I have only one device in ubuntu,sda) - delete swap partition and root partition with
dcommand (yes, delete all partitions) - create root partition (primary partition) with
ncommand, be careful the start selector must be as same as old root partition (default is good), end selector is the size what you want the partition be, e.g.+45G, is a 45Gb partiton - (optional) create swap partition if you need, with
ncommand, and then change swap partition type withtcommand, swap type code is82 - write changes with
w - reboot ubuntu
-
sudo resize2fs /dev/sda1, enlargesda1to default new size, e.g. 45Gb - (optional)
sudo mkswp /dev/sda2if you create swap partition - (optional) change swap partition record in
/etc/fstab, new swap partition uuid or label could be found onsudo blkid
Top comments (0)