1

I have a 1TB computer on Unix that is full mounted at /. I have installed a new 10TB HDD and mounted it at /hdd .

I would like to know if I could still write in /home/usr and have the storage used from the new one, or should I:

  • copy /home to my new HDD / somewhere else and then use it as it is.

OR

  • mount the new one at / and use it as it is. I found that there should be no issue to have two HDD mounted in the same dir from from this post, is it true?

What would be the best practices? It is my first time mounting a new HDD to a computer.

Thanks

2 Answers 2

2

I would like to know if I could still write in /home/usr and have the storage used from the new one

No, because the disk is currently mounted at /hdd, not at /home/usr.

If you want to use the HDD for /home/usr, you should first move all data from the existing /home/usr to the HDD, then re-mount the HDD there.

(That is, if the disk is suitable for use with /home – i.e. fast enough that it won't get annoying. Personally, I would continue to use an SSD for /home and keep the HDD at /hdd, creating symlinks like "/home/user/Movies → /hdd/Movies" for convenience.)

mount the new one at / and use it as it is. I found that there should be no issue to have two HDD mounted in the same dir from from this post, is it true?

Yes and no. It's true in the sense that it won't damage anything… but that doesn't mean it'll do anything useful at all. So mostly "no".

In Linux (as in most other systems), mounts are opaque. If you mount disk 2 at /, then only the contents of disk 2 will be visible at / – the previous contents of disk 1 will be covered up and inaccessible. (In fact, the /bin/umount command will become inaccessible as well, so the only thing you can do is reboot.)

(Hence the suggestion to move data instead of copying.)

However, it may be useful to do the opposite: you can mount the same HDD on two directories. (This is usually done indirectly via "bind mounts" which start from an existing mount, but I'm quite sure Linux allows starting two mounts from /dev/sdX as well.) For example, if you want to keep the new disk to be mounted at /home/usr and at /hdd at the same time (e.g. for organizational purposes), that's possible.

Finally, if you want a "merged" mount that allows accessing files from both disks at the same location, that's technically possible – but I wouldn't recommend doing that for /home. You could, however, use something like MergerFS to combine e.g. /hdd1 and /hdd2.

1
  • 1
    It's also possible (on Linux) to bind mount a directory under the mounted /hdd on /home/usr. (Or, if the filesystem on the HDD is btrfs, a subvolume with "normal" mounting.) But indeed, symlinks are probably easier anyway.
    – Tom Yan
    Sep 27 at 5:05
0

There are lots of ways of solving this problem - but it appears you are missing some important basics. You really want to know how the hard drive is structured - if you have LVM (which is abstracted disk management and is quite common), then the best solution is different to if you don't.

YOU CAN'T HAVE 2 HDD's ACCESSIBLE AND MOUNTED FROM THE SAME DIR - The post you refer to is correct, but misleading. As per the answer you can mount both drives, but the later command will make the earlier one inaccessible.

If all of the data you want to store on the new drive is in /home/usr then a good, simple solution and fairly safe solution for a newbie would be to do the following (There are ways to do this with only 2 steps, but they are more risky at your technical level) -

  1. mkdir -p /hdd/home/usr # This will create a new subdirectory on the second disk.
  2. cp -var /home/usr/* /hdd/home/usr # Copy your data across.

If command 2. above works

  1. mv /home/usr /home/oldusr # Rename the old homedir
  2. Change your /etc/fstab file - change /hdd to /home/usr
  3. Reboot, log in, type df and check that the 10tb partition/drive is mounted as /home/usr
  4. rm -r /home/oldusr # This is the dangerous bit, and deletes the data from your old drive - only do this once you are certain the data is now being accessed from the 10tb partition.

An alternative way to handle this is to use symlinks - this will allow you to graft multiple parts of your system onto the new disk, and doesn't required editing /etc/fstab

  1. mkdir -p /hdd/home
  2. cp -var /home/usr /hdd/home # Copy your data across to new location
  3. Check your data has been copied across
  4. rmdir /home/usr/ # If this fails then your data likely didn't fully migrate.
  5. ln -s /hdd/home/usr /home/usr # Create A symlink so that when people go into /home/usr they are actually referring to /hdd/home/usr

You can move other parts of your filesystem in a similar way - just avoid special directories (eg virtual directories like /dev and other directories which may be required early in the boot process like /etc)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .