• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Want to resize a Linux partition via CLI

Jeff7181

Lifer
I have Ubuntu Server 12.04 running in a VM. /dev/sda1 is mounted on / and is running out of free space. I've already resized the disk in VMware to a much larger size, but I'm having some trouble figuring out how to resize the partition. In Windows, I'd just go to disk management and extend the partition into the free space on the disk. I'm just not sure how to do that via command line in Linux. Can anyone help?
 
I can't help with the cli resize, but perhaps you can delete your apt cache to free up some space on /. All your downloaded packages get kept, and it can take a tremendous amount of room. sudo apt-get clean will delete those packages. apt-get autoclean is a bit more conservative, as it only removes packages that aren't available anymore. Your choice, but I always use clean.
 
Does it have to be CLI? There is a GUI boot CD tool you can use (gparted) that is like Partition Magic and works great. I think in the back end it does use CLI so there may be a way you can see the command it issued. You can probably open a console and do ps aux while it's running.
 
I guess it doesn't have to be. But I figured there should be a way to do it at the command line rather than use a boot CD. If not, then I guess I'll use a boot CD... but even Windows is capable of the same task via command line. I'd be shocked if there wasn't a way to do it in Linux without a boot CD.
 
Either parted or a combination of fdisk and a filesystem resize tool should work from a live system as long as the filesystem supports online resizing.
 
Back
Top