How to install programs to a seperate HDD Im using 240 GB SSD as my primary drive?

Here I was trying to install VS Code to a seperate HDD but couldn’t do .
So Is there any solution to accomplish this task ??
Pls tell what to do
As in Windows there is a flexibility to install programs in another drive or wherever you feel like

1 Like

No, we won’t sort it out for you. You have to sort it out.

All we can do is help you in sorting it out yourself.

3 Likes

There are several ways to achieve what you want. However, it might not be a smart idea to do so.

Generally speaking, I’d say, it’s better to have your programs and their libraries on the SSD, in order to speed up access to them.

240 GB on your SSD should be plenty to install the core system and any kind of program.
So, if you’re running out of disk space, I’d rather look elsewhere, namely multimedia files. It makes far more sense to move these to the HDD.

If you don’t know how to figure out where all your disk space has gone, feel free to ask again. We’ll try to help you as good as we can.

3 Likes

I know SSDS are fast and more reliable than HDDS but still I want to know how to install programs to different drive .

Its ok
But would you tell me how to do that in a different drive

Talking about Debian and derivatives, excluding flatpaks and snaps:
Installing a program means basically copying new files to somewhere in the filesystem.
It it the package managers task to put those files into their intended place.
The package manager will extract the files from the .deb archive, and put them into the place, but that place is taken from the .deb archive as well.
So it won’t be as easy as on Windows, where you click next-next-choose install dir-next-finish.
What you could do is to look into the .deb, and see what files it will install, and where.
Then create an appropriate directory structure on your target drive, and links on your system drive where the .deb intends to install files to your target drive appropriate directories.
Then do the install.
However, this won’t move dependencies to your target drive.
I wouldn’t mess with this kind of install, and recommend against it.

Edit:
If you find your system drive gets filled up, check /var/log.
My experience is, that something working abnormal can put tons of error messages in syslog.

1 Like

Yes
You can of course manually configure and compile a program from its source code to have it install the binary and data parts wherever you’d like, while still installing configuration files to the FHS compliant locations, but this is something I’d only recommend for advanced users. If you are going to compile from source, have a look at checkinstall, a tool that automatically creates debian packages.

Or I can do this ??

What I wanted to suggest is something like this:
Say, the .deb tells dpkg to put files in /usr/lib/magicalprogram
You could create a magicalprogram folder on your target, and simlink /usr/lib/magicalprogram.
Example, ln -s /usr/lib/magicalprogram /mnt/targetdrive/magicalprogram
(assuming, your targetdrive is mounted at /mnt/targetdrive)
Alternatively, you could move the installed dir after installation, and simlink the similar way.
That would be doable without altering the binaries.
I think both method would work to a certain point, but why do you want to install something to a different location, than it was designed?

1 Like

Because I have 1 TB SSD too in my computer and one terabytes is enough for me to use

I mean I want to utilize both SSDS for my work .
:blush: :slight_smile:

Easy and common use of multiple drives:
Have a smaller drive (partition) for your system and programs.
Have a larger drive (partition) for your /home, and keep your data there.
So you can utilize all your drives for your work to their full potential, but without messing around with things you don’t really understand :wink:

1 Like

Yes
But the only thing is that you should know how to do that without taking help further
:slight_smile:

There is no “standard way” to install a single program on a specific drive.

It depends very much on the kind of installation (appimage, flatpack, normal package, source, etc.). It also depends on the specific setup of your system.

It is possible to create a symbolic link from one specific directory on one physical drive to another on a different physical device. Furthermore, it is also possible to create a separate partition for a dedicated purpose and to mount it at a specific location in the Linux file system.

There are infinite possibilities, and yet, I wouldn’t recommend any of them, unless you really know what you are doing. Explaining all the theory goes well beyond the scope of an answer in a forum.

If it is curiosity that drives this question, this might be an excellent motivation to learn the theory and to write your own tutorial (30-50 pages should cover it) which you can share publicly with others.

If there is a real problem behind the question, you should let us know the underlying problem, not a problem with what you perceive as the solution.

2 Likes

I fully support this.

@Aman_Bhatnagar

Please study software installation and write a guide for everyone to profit from. Thank you.

3 Likes

And nobody’s even started thinking outside the box yet. For example, since the advent of LVM2, it is child’s play to combine both of those drives into a single logical volume, meaning you don’t have to worry about dividing up the space at all, you just have “all of it”.

(You do have to get over micromanaging exactly where any particular data ends up, which can in all seriousness be the toughest hurdle to clear for many of the more technologically-minded. Control-freak-ism is definitely a pandemic-level affliction. But it’s honestly sooo worth it.)

If you use a distribution that does not set up its filesystems as a volume group by default, then I feel very sorry for you, because it is the shiznits. I actually still keep separate partitions for the root filesystem vs. /home/, for systems-management and backup/integrity purposes, but these days I tend to UNDER-allocate my free storage, only giving each filesystem the space it needs “right now” and leaving the rest as free, unallocated space. That way, I can easily extend any full volume into the available free space at a moment’s notice, whenever I need, and without even unmounting it!

Hell, I can be transferring files while the volume is resizing, and the only impact will be slightly slower transfers. All it takes is:

lvextend -v -r -L +50G vg_00/lv_home

…and a few minutes’ wait.

“Install to a different drive?” Hah! Crazy-talk.
There Is Only The Volume Group.
It Is All The Volume Group.
Worship The Volume Group.

2 Likes

@FeRDNYC
Everything is possible
Nothing impossible
Well I’m do searching for the ways to install it to a different drive and doing practicals maybe I might come up with different ways to do that.

You must have heard of Narcotics Hackers recovering the chats that were being done 3 years back of Indian criminals so
I still say that there are possibilities of installing it to a different drive .
:slight_smile:

@kovacslt
I have tried this method on Virtual Machine
It’s working .