2

I have a very small drive holding my OS. it's built in to my device, so I can't swap it out for a better one.

I would like to do something like use symbolic links, but rather than replacing them, basically merge the two disks, if possible. I've tried using symbolic links and that didn't work at all. is there something similar, but that will treat two directories as the same one?

Pablo Bianchi
  • 15,657
AJ Pink
  • 31

2 Answers2

1

Unless you truly need to treat two directories as the same one (unlikely) there's no need to use symbolic links or even LVM for that matter to accomplish your goals as the `nix filesystem is designed in such a way that any storage device partition can be mounted to any place on the tree. For instance you can mount /dev/sdb1 directly to /home, /boot, /home/Videos or anywhere where you are running out of space.

You will need to move the existing content to the new storage location prior to mounting but other than that it's a snap. I recommend using live media to boot from to perform the move.

Here's a general overview of Linux filesystem (Unix is the same or at least very similar).

Here's some more useful info from the official documentation. It details the steps necessary to move \home to another device or partition. The same approach can be taken for any folder on the tree. Usually what's required is to identify the directory that's hogging the majority of your space , copy it's contents to another more roomy device, and mount that device on the previous location.

If anything about this answer is unclear, please drop me a comment and I'll clarify to the best of my ability.

Elder Geek
  • 36,023
  • 25
  • 98
  • 183
  • Why would you do that instead of using a symbolic link? The latter seems more straightforward. – markling Apr 11 '23 at 08:26
  • @markling Because I can. Perhaps it's just my opinion, but to me, from an organizational standpoint, I'd rather not obfuscate which data is stored on which hardware. – Elder Geek Apr 12 '23 at 12:56
0

From: How to merge multiple hard drives?

Use LVM (Logical Volume Management) on Linux.

You can think of LVM as "dynamic partitions", meaning that you can create/resize/delete LVM "partitions" (they're called "Logical Volumes" in LVM-speak) from the command line while your Linux system is running: no need to reboot the system to make the kernel aware of the newly-created or resized partitions.

First of all you can use fdisk with -l option to get info about your current "Disks", then use it to partition your "Disks" and setting the system type of those partitions to "Linux LVM", after you finish the partitioning of the "Disks", use pvcreate to prepare your new partitions for "LVM".

For more info: https://www.howtoforge.com/linux_lvm