I recently installed Ubuntu 19.04 and allocated 50 GB of the SSD to Ubuntu using LVM; the remaining 190 GB is not allocated to a partition. Now I use programs consuming a lot of RAM, such as Android Studio and other developer tools which take up space. Can I store and run those programs, by placing them in the free space, or if there is a method to extend the Ubuntu partition size without going through the whole installation process?
- 3Do you remember if you used LVM for your 50gb partition when you installed 19.04?Jeff– Jeff2019-04-20 11:16:57 +00:00Commented Apr 20, 2019 at 11:16
- 2If you're not sure, open a terminal and run 'blkid' and/or 'sudo lsblk -f /dev/sda' replacing sda with your device name.Jeff– Jeff2019-04-20 11:22:53 +00:00Commented Apr 20, 2019 at 11:22
- Yes I used lvm when I installeduser6917305– user69173052019-04-20 11:59:19 +00:00Commented Apr 20, 2019 at 11:59
- 2Are you confusing RAM and disk space? It sounds like you already have the software installed, so what is your issue? If you are running out of RAM, then moving things around on disk won't help very much.Kusalananda– Kusalananda ♦2019-04-20 13:42:36 +00:00Commented Apr 20, 2019 at 13:42
3 Answers
I'll start by saying that you should have good backups before doing any manipulation of your partitions and filesystems.
Since you used LVM during the install, you can grow the size of your current 50GB Logical Volume (LV).
Start by making a new partition of the size that you want to grow by, in the free space. You can use fdisk or gdisk from the terminal for this.
Next you'll use the pvcreate command on the new partition to create a new physical volume (PV).
Then use vgextend to add the new PV to your existing Volume Group (VG). Use vgdisplay to see existing VGs.
Now there are more physical extents available within your VG that can be allocated to LVs. Use lvextend to do this.
Finally, the "container" of your filesystem is now larger but you need to grow your existing filesystem to fill the now larger LV. If you used ext4, use resize2fs and if you used xfs you'll instead use xfs_growfs
You have a few options, but you seem to be asking about two things (heavy RAM usage, and file storage). I will address both.
Not enough RAM
If you don't have enough RAM, then adding a swap partition can help (you can also use a swap file, but partition is (I think) more efficient. Use gparted program, to add a swap partition.
More space for files
You can extend the current partition, or add a new partition. There are advantages to each strategy.
- With more partitions there is more opportunity to wast space (In the future these may be free space on the wrong partition), however there are ways to deal with this.
- Having a separate root and home partition, makes it easier to manage, when you upgrade the Operating System. You don't have to change the home partition.
- Adding a partition to the free space can be done easily (with gparted program).
- Resizing / extending a partition requires you to take it off-line, so for the root partition you will have to shutdown and use a live OS (boot from USB or CD, the gparted program, in the gparted distro is a good for this job).
- If you add a new partition, you way want to move all of the /home into it, and then mount it over /home.
- 1It may not be necessary to take his device offline in order to grow the partition, if he used LVM.Jeff– Jeff2019-04-20 11:24:31 +00:00Commented Apr 20, 2019 at 11:24
- I understand the available ways stated here but I wish to know how to extend my ubuntu drive or store programs into the free space drive. Is there a way to do it?user6917305– user69173052019-04-20 11:54:57 +00:00Commented Apr 20, 2019 at 11:54
- gparted live distro boot from USB, if you choose to resize. or gparted program, to add a new partition. If you tell us which root you are planning to do, then I may add more detail.ctrl-alt-delor– ctrl-alt-delor2019-04-20 15:25:02 +00:00Commented Apr 20, 2019 at 15:25
I found out that Ubuntu offers an option to resize the partition size on disks. I could hence do it and upgrade my partition size to 150 gb
- Can you tell us a little more, what program. (in case someone else finds this in a search).ctrl-alt-delor– ctrl-alt-delor2019-04-20 15:28:43 +00:00Commented Apr 20, 2019 at 15:28