V
V
vadimstroganov2016-04-27 10:11:00
Ruby on Rails
vadimstroganov, 2016-04-27 10:11:00

Can I upload Carrierwave photos to two HDDs?

Hello!
There is such a problem, there is a server, on that two HDDs of 2TB
each Photos are loaded via Carrierwave on the 1st HDD, the place there is coming to an end.
Is it possible to somehow continue uploading photos, then already on the second HDD, but so that Carrierwave knows that there are also photos on the 1m HDD?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Roman Mirilaczvili, 2016-04-27
@2ord

I think that you can somehow mount two folders from different drives into one. Maybe use some kind of distributed file system or somehow through FUSE.
Then you can point to the new storage location in Carrierwave.

A
Alexey Abramenko, 2016-04-28
@AlekseyKota

As for me. so the best option is raid 0
I did this on my server: 4x3TB in raid 0 total 12TB and mounted it as a separate folder.

T
Timur Talipov, 2016-04-28
@ClickF1

If you are not satisfied with the option of abstracting from the disk, then you can try to rewrite

class MyUploader < CarrierWave::Uploader::Base
  # этот метод, чтобы он динамически проверял размер первого диска
  # если он полон, то отдавал пусть на второй диск
  def store_dir
    'public/my/upload/directory'
  end
end

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question