Saturday, April 27, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 1280  / 1 Year ago, fri, may 19, 2023, 1:47:11

I was wondering if it is possible to run a web server that has a small 80 GB hard drive for Ubuntu Server 13.04 and all the installations, etc. however have a separate 2 TB hard drive store the data.



How would I go about setting this up for Ubuntu and Apache work this? And if so, in the command line how would i access each drive.



Thanks,
Stephen


More From » server

 Answers
3

I'm assuming that you want to put the data for your web sites on this external hard drive. The best way to do this would probably be to mount the 2TB hard drive in the web server directory, which I'll assume to be /var/www/.



Once you have a file system in the 2TB drive, you can mount it with the mount command temporary, then permanently in the /etc/fstab file. Assuming that the larger drive is /dev/sdb and the filesystem is /dev/sdb1, the command to mount it is



sudo mount /dev/sdb1 /var/www/


and the line to add to fstab would be



/dev/sdb1 /var/www ext4 defaults 0 0


Note that when mounting, the directory where you mount it needs to exist before hand, and should be empty (the previous contents of that directory will not be accessible after mounting, so if you already have something there, copy over the files to somewhere else, or mount /dev/sdb1 somewhere else first to copy over the files).



Mounting a drive makes it become part of the file system, and from apache's perspective the directory might as well be on the same drive.



Even if this answer is not exactly what you want, I hope that it gives enough insight into mounting for you to apply it to your specific purposes.


[#30618] Friday, May 19, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ranquctive

Total Points: 391
Total Questions: 103
Total Answers: 104

Location: South Sudan
Member since Thu, Feb 4, 2021
3 Years ago
;