简体   繁体   中英

Using external drive for PHP storage

I have a PHP application, running on a centos box, that stores a large amount of user-uploaded files.

Right now I am storing the data in a folder /uploads, but I am running out of space on the server.

I have the option of adding storage drives of 100GB. For example, drives /dev/XXXX, /dev/YYYY, and /dev/ZZZZ each have 100 GB.

I would like to know the best way to store user-uploaded files across multiple drives. Is there a Centos directive that can join drives into one available space for PHP? Or should I just have PHP upload files to the first drive, and when fills up, have it save to the second, etc?

Thanks! Ben

Logical Volume Manager (LVM) is a tool to easily expand or combine multiple hard drives into a single pool of storage and makes it easy to dynamically resize and create new partitions, even without restarting the process or without removing the volume. You need to do following steps:

  • Installation of lvm2 .
  • Make a new partition and set the type of the partition as LVM.
  • Create physical volume
  • Create Volume group (VG)
  • Create a Logical Volume (LV)
  • Create a file system on the logical volume group that is just created. That it is.

Here you can find complete procedure for it. For Live demo of procedure, watch here .

You can use LVM (Logical Volume Manager) that enables you to create a logical volume from multiple physical volumes , but i would advise against it as if a hard drive fails, the whole logical volume might be compromised.

Have a look at AWS S3 storage , it might do the job for your project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM