1

I am a newbie and have a Ubuntu 20.04lts dual booted with windows 8.1 pro on

ssd and hdd
SanDisk SSD i100 24GB (11.56.04)
WDC WD5000LPVX-22V0TT0 (01.01A01)(500gb)

as you see my SSD size is small so I created a partition of 20gb for the root and mounted it on / and the rest of the free space i used it as a swap area(4 gb),

and then created a partition on my hdd of about 100gb and mounted it on /home

now the problem is that all the updates and software's I download via the terminal or Ubuntu store gets installed on the root and not on my home partition which is reducing my space on the SSD.

So what should I do so that only the OS stays on the root and the rest of the software's and updates get shifted/installed on the HDD rather than on the SSD

please tell a detailed method as I read a few articles about it and I am not able to guess what to do .i am afraid that i might not do anything that might corrupt my files

pls use the below devices name

hdd-    /dev/sda6   ,    mounted at -"/home"     ,    uuid-92dda774-f971-494a-a3ed-a4c7faeed5b8 
ssd-    /dev/sdb2   ,   mounted at -"Filesystem Root" , uuid-b302b753-d77e-47fd-9aaf-173edfc7ad6f
pwd-    "/home/lakshya"

also on the computer in the other location menu,can i just shift the /home/lakshya folder to my hdd or delete it?as i can access it in the files won't it be easier to do so

lakshya
  • 11

1 Answers1

1

How to change default download directory to /home rather than root

Impossible (mind that I assume you meant "installation of software" and not "download") as /home/ does not store installed software unless you switch to installing software from source and never use the software store. If you do that I would suggest using /opt/ as a mount point (as that makes the software available to all users and not just your user).

now the problem is that all the updates and software I download via the terminal or Ubuntu store gets installed on the root and not on my home partition which is reducing my space on the SSD.

These are 2 different issues:

  • The download is kept in a cache directory (/var/cache/apt/archives/). You can delete the contents of that directory to save up space (see for instance var/cache/apt/archives occupying huge space ).

    That cache can get large so removing those files might make the next part of this obsolete.

  • The installation of the download goes into several directories that reside in / (the main 3 are /usr/, /var/, and /etc/; more on that below) so it is impossible to move those locations to something like a /home/.

    In the old days to separate installed software we would create a mount point for /usr/ (software mostly goes to this directory) and for /var/ (location for log files, websites, mysql database) and /etc/ (configuration files). But even then that came with a warning to keep them on the same disk: if the hdd is too slow during boot when the system expects /usr/ and /var/ to be available you have a broken boot.

    So to do what you are asking you would need to create a mount point for /usr/ on the hdd. If you do that my advice would be to install ALL of Ubuntu on the HDD if you believe 20Gb is not enough and live with the fact booting is going to be a bit slower than when it would be done from the sdd.

Personal note:

SSD size is small so I created a partition of 20gb for the root

I have never ever needed more than 15Gb for root and I do things with my system you might not do (like coding websites, and converting databases).

Rinzwind
  • 309,379