M
M
Max2018-08-03 22:12:17
linux
Max, 2018-08-03 22:12:17

Binding directories of one drive to a directory of another drive, is it possible?

Good afternoon! I have a server with SSD + HDD drives on it.

SSD mounted to /
HDD mounted to /mnt/

Now there are 20 sites, I plan to develop up to 100, the weight of each site is 5-50 GB. Storing on an SSD is expensive and unnecessary.
I want to store it like this:
/home/user/domain1.com/ to SSD
/home/user/domain1.com/wp-content/uploads/ to HDD

Similarly for other domains.
/home/user/domainN.com/ > SSD /home/user/domainN.com/wp-content/uploads/ > HDD
Is it possible to do this, and how? Maybe some symlinks, or bind/mount/fstab ?
That is, the output should be something like this:
/home/user/domain1.com/wp-content/uploads/ points to /mnt/domain1.com/
/home/user/domain20.com/wp-content/uploads/ points to /mnt/domain20.com/

Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2018-08-03
@wtfowned

/home/user/domainN.com/ > SSD /home/user/domainN.com/wp-content/uploads/ > HDD
bind/mount/fstab ?

Yes, perhaps, yes, bind.
mount:
mount --bind /mnt/domainN.com /home/user/domainN.com/wp-content/uploads

Can be done after the SSD and HDD are mounted.
fstab:
/mnt/domainN.com   /home/user/domainN.com/wp-content/uploads    none    bind    0       0

Must come after the /mnt and /home/user/domainN.com mount lines.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question