Answer the question
In order to leave comments, you need to log in
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
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.
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.
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 questionAsk a Question
731 491 924 answers to any question