You are here
wormchow - Tue, 2013/12/17 - 06:04
I have 2 hard drives,, and i want the system to run on the first hard drive and var/www/ to run on the second , how do I accomplish this? Either through webmin or terminal, Is this something I can do?
Forum:
and I am trying to do this with lamp appliance
sorry forgot to add i am trying to do this with the lamp appliance 13.0 and have already partitioned the second drive to ext4
Probably possible in Webmin but I think terminal easier...
In essence what you need to do is set your system to mount the new HDD at /var/www. This is how I would do it.
Assuming that you have already installed LAMP to your first HDD then you'll want to first work out what your new HDD is. Run
and see what shows up. Normally your existing HDD should be sda and your second should be sdb (so ensure that those 2 show up). To double check that your primary HDD is sda run
It should should mention sda1 in amoungst some other entries and there should be no mention of sdb. Assuming that is the case mount your new HDD (temporarily) like this
Now stop Apache and copy across the current contents of /var/www, then rename the current www folder (as a backup), recreate www and create an index file in the existing www so you'll know straight away if something is wrong later down the track...
Now you can restart Apache to check that your error file works
Now browse to http://<server-IP> and hopefully you should see the error message above ("Error - the drive that contains /var/www on this server is unmounted").
Assuming that is all good stop apache again
In this day and age you should probably do it via the UUID of the HDD - although personally I still use the standard identifiers (e.g. sdb1). You should be able to work out what your new HDD's UUID is with
Now you want to unmount the drive (from /mnt) and add a new enty to your fstab file
And add a new line using a format like this: UUID MountPoint FSType Options Dump Fsck
So it will look a little like this
Obviously subsitute MyUUID for the real UUID (that you discovered with the blkid command)
Save and exit (OTTOMH <Ctrl><X> then <Enter>x2). Now test your new entry with
And then run
to check that your HDD is there. Assuming all is well then restart Apache
and browse to http://<server-IP> and you should see the default TKL web landing page (or whatever you have replaced it with if you have already started work...)
Add new comment