LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-24-2016, 06:25 AM   #1
nibraz
Member
 
Registered: Oct 2008
Posts: 219

Rep: Reputation: 18
Mount secondary hard drive to upload directory


Hi

I run a webserver and my /var/www/html/uploads directory is eating my primary hard disk space.

I am looking into buying a 1TB additional HD and install this to my server.

How can I point my new hard drive to the /var/www/html/uploads directory and use my new hard disk as storage?

Many Thanks
 
Old 10-24-2016, 08:32 AM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,330
Blog Entries: 3

Rep: Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726
Which distro do you have on your web server?

The general way would be to mount it. Look at the utility "mount" and its manual page to see how to do that, and try it manually. Then once you have all the options and location settled, you can add it to fstab, see the fstab manual page for details of that file. Inside fstab you can refer to the partition by device name or by UUID. The latter is more precise. The utility "blkid" can tell you the UUID of a partition.

You can also make more than one partition on your new drive and mount them in different places if more space is needed elsewhere, too.
 
Old 10-24-2016, 01:50 PM   #3
tofino_surfer
Member
 
Registered: Aug 2007
Posts: 483

Rep: Reputation: 153Reputation: 153
>>>How can I point my new hard drive to the /var/www/html/uploads directory and use my new hard disk as storage?

Actually you have this backwards. You point the /var directory to the new partition UUID or text label in your fstab. If you use lvm you would use links such as /dev/vgname/lvname where the names are strings you specify.

As the previous poster said your first decision is whether you want to use the whole 1 TB drive for the /var directory or reserve space for other directories in the future. I personally would leave some space unallocated for future use.

>>> Inside fstab you can refer to the partition by device name or by UUID.

There are more options than this. You can specify a filesystem label with either MBR or GPT partitioning. If using GPT partitioning you can specify a text partition label.

https://wiki.archlinux.org/index.php/Fstab

As described in the page above the four options are:

Filesystem text label
Filesystem UUID
GPT partition text label
GPT partition UUID
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mount point of encrypted secondary hard drive EStyles Linux - General 7 10-15-2015 01:28 PM
Booting Windows on secondary hard drive with Grub on primary drive mpmackenna Linux - General 1 11-09-2008 06:16 PM
cannot mount already formatted secondary hard drive on newly installed debian angmar Debian 8 08-05-2005 01:12 PM
How can I mount my secondary hard drive on boot? Scorlibrian Linux - Hardware 1 02-26-2005 11:36 AM
how do i mount my windows partitions and secondary hard drive in RH9 kasperl Linux - Newbie 5 10-22-2003 05:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration