Question

Need Help Managing My Hard Drives

Hello Everyone. First i am inexperienced with Linux and Cent-OS. So please forgive my ignorance.

I will try my best to explain my problem and what i actuaclly want.

I have a dedicated server with 3 Hard Drives and 1 SSD. The Centos 7 is installed on the 80 GB SSD and now three hard drives are free.

Among these three hard drives two are on raid controller. Which logically means i have two extra hard drives, (As raid will show two same hard drives as one).

Now i have two hard drives free which i want to use to store my data. But the problem is that, previously i was storing my data in /var/www/html

And now if i start uploading my files to /var/www/html the SSD will get full which i dont want. Even if i bind one of my hard drives to that directory the SSD will get full.

So Here IS The Question.

  1. How Can I Use Both Of My These Extra hard Drives to work on a same directory. I made a previous thread about this and one of the mod also replied thanks to him, but i messed up and had to reinstall OS.
  2. After making these two hard drives work together, where should i point them? so that my SSD dosent gets full.

Or in simple words, I want my two extra hard drives work together and i upload files to them and users access them through Nginx web server but i dont want to upload files to my SSD.

I hope i made clear what i want.** And please if you have solution type all of the commands because i am inexperienced.** http://prntscr.com/e7cab6


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Do you initialized and partitioned your 2 hard drives? I see that you have 3 partitions on SSD, but I don’t see any on other hard drives. If you didn’t, you can follow DigitalOcean tutorial - How To Partition and Format Storage Devices in Linux.

Once you do this, or if you are already done, you can proceed.

/var/ and all other directories and files there (/var/www/html and so on) are on root / file system. Your root file system is on your SSD. To overcome this, you have two possibilities. You can change your nginx server block to use another location for /var/www/html. Location of files are defined by root directive. Example server block:

server {
        listen 80 default_server;
        listen [::]:80 default_server;

        root /var/www/html;
        index index.html index.htm index.nginx-debian.html;

        server_name _;

        location / {
                try_files $uri $uri/ =404;
        }
}

Root directive is what you want to change. After change is:

server {
        listen 80 default_server;
        listen [::]:80 default_server;

        root /mnt/www/html;
        index index.html index.htm index.nginx-debian.html;

        server_name _;

        location / {
                try_files $uri $uri/ =404;
        }
}

This is most easiest solution. Change /mnt/www/html with location where you mounted hard drive. There you also need to upload files.

Second and riskier solution is to try to mount your hard drive to /var/www. In that case, you can go with default nginx config, but you should change /mnt/data from above linked tutorial to /var/www. Please be very careful when doing so! There is risk behind this, I didn’t tested this myself, but AFAIK it should work in theory!

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Because i always found helpful guides here. am i doing something wrong?

Why are you asking this on the DigitalOcean community?