0

I am using 2 hard drives: 100 Gb SSD (1) and 1Tb SATA (2). 70 Gb of (1) are taken for other purposes. I have installed Ubuntu on the rest of 30 Gb of (1) and soon faced a problem: all the apps I need are much more than 30 Gb. Also I understood that apt-get is not going to install my programs to the other drives (for example, to (2)).

What is the correct way to solve the problem? I see here two ways:

1) Use some hint to make the second disk visible to apt-get. I am not quite sure, if it is possible. Maybe symlink can work, but I am a bit inexperienced in Ubuntu to think of a good way to do it.

2) Install Ubuntu to larger drive. What I am concerned about is that it is less fast.

To sum up, the question is whether there is a good, true way to make first idea work or reasons why I should abandon it and choose second option.

sooobus
  • 101
  • Perhaps the method suggested in this answer – Charles Green Feb 03 '19 at 21:30
  • #1 is possible, but not for beginners: You must understand the filesystem, learn how to use the mount command, and learn how to edit /etc/fstab. Go ahead and try it and learn. #2 is simpler if you need more space today, or if you are unwilling to learn. Beyond that, it's a matter of preference. – user535733 Feb 04 '19 at 01:17

2 Answers2

-1

There are many ways to partition drives for limited space.

Manual partitioning: Look in the root partition ( / ) and you will find several directories that can be put on separate partitions for the exact problems you are having (as well as for other reasons).

My new ubuntu install (Bionic) currently uses about 6 GB of space. On my newest laptop, when looking at the output of du I find that /var uses about (at present) 30% of the 6 GB total.
The users home directory tree ( /home ) often uses a considerable amount of space as well. Om my main computer I have 3 TB allocated to /home and am using more than half.

Both /var and /home can be quite volatile in space demands and when the primary installation partition is limited those two can (and probably should) be placed on another partition to distribute space requirements. In the early days when disk drives were expensive and space was at a premium it was found necessary (for servers) to place /var on its own partition because mail, software cache, files being served, etc would fill up the space and cause a system crash if no space was remaining for the OS partition. Malicious individuals would deliberately shut down ISPs and others if they were not prepared for such an attack.

LVM: If you are using LVM to manage your disks, changes can be quite painless.
If you are doing it manually some careful planning and partitioning in advance can easily distribute the data to manage disk space as well. Changes without LVM are painful.

Having both drives (or at least the used 30 GB of drive 1 and all of drive 2 ) as part of an LVM will allow seamless usage of the second drive as space demands.

As a side note: You did not state what you are using the original 70 GB of the ssd for. If I correctly assume that it is a install of another os then it is probably not movable. If it is purely data then it could easily be relocated.

Good luck!

BTW, Some things are accessed frequently and speed becomes a factor. Others are read by the system once or very infrequently and for those speed is really immaterial.

-1

Placement of swap on SSD is a key element of efficiently working system.

While it will not help much for boot time and first run of programs, having swap on SSD may make work as painless as everything is on SSD.

Placement of other system parts is secondary problem.

Edit: I just understand, how green are you to ask such question. So, in such case, answer is: No. No, on Linux you cannot install stuff anywhere you want, like on Windows. Everything has a fixed place. Apt-get cannot put some things "elsewhere".

Install everything on bigger disk.