Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
freem
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Openai/690f5a8f-e6b0-800f-9707-b301528ae1f3
(section)
Add languages
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== == {| class="wikitable" |- ! ! |- | | |- | | |- | | |- | | |- | | |} Would you like me to show a sample /etc/fstab entry for this setup, so it auto-mounts correctly on boot? '''Prompt:''' When you create a folder to a mergerfs volume, doesn't it automatically generate that same folder on all drives? '''ChatGPT:''' Excellent observation — and this is where MergerFS behavior can be unintuitive if you haven’t dug into how it handles new directories. The short answer is: <blockquote></blockquote> It only creates the folder on one underlying drive, according to the create policy you’ve set. Let’s break this down clearly: === === When you do something like: <syntaxhighlight lang="bash"> mkdir /mnt/pool/NVR </syntaxhighlight> MergerFS decides which drive gets the real /NVR folder based on your category.create policy. So for example: * With category.create=eplfs (existing path, least free space): * It looks for drives that already have the parent path (in this case /mnt/diskX/) * Among those, it picks the one with the least free space (i.e. the fullest) * It creates /mnt/diskX/NVR only on that drive No other disks get the folder until something explicitly creates it there later. === === If /NVR exists on multiple drives already (e.g. /mnt/disk1/NVR, /mnt/disk2/NVR, /mnt/disk3/NVR), then: * MergerFS will see all those paths as “existing”. * When writing to /mnt/pool/NVR/..., it must check all drives to find where it can place files — and that can spin up all drives. So you want to avoid that situation for your power-saving goal. === === # Make sure only the first drive has the folder initially: <syntaxhighlight lang="bash"> mkdir /mnt/disk1/NVR </syntaxhighlight> (Don’t create /NVR on the others yet.) # Mount MergerFS with: <syntaxhighlight lang="bash"> mergerfs /mnt/disk* /mnt/pool -o defaults,use_ino,category.create=eplfs,moveonenospc=true,cache.files=off,dropcacheonclose=true </syntaxhighlight> # Now when Reolink writes to /mnt/pool/NVR, it’ll create and fill files only on /mnt/disk1/NVR. # When disk1 fills up: <syntaxhighlight lang="bash"> mkdir /mnt/disk2/NVR </syntaxhighlight> Then MergerFS starts writing new files there. # disk1 can now spin down completely. === === Imagine 3 disks: <pre> /mnt/disk1/ /mnt/disk2/ /mnt/disk3/ </pre> Mount: <syntaxhighlight lang="bash"> mergerfs /mnt/disk* /mnt/pool -o category.create=eplfs </syntaxhighlight> Then run: <syntaxhighlight lang="bash"> mkdir /mnt/pool/NVR </syntaxhighlight> Check each: <syntaxhighlight lang="bash"> ls /mnt/disk*/NVR </syntaxhighlight> You’ll see: <pre> /mnt/disk1/NVR ls: cannot access '/mnt/disk2/NVR': No such file or directory ls: cannot access '/mnt/disk3/NVR': No such file or directory </pre> So only one got created. === === {| class="wikitable" |- ! ! |- | | |- | | |- | | |} Would you like me to show a script that automatically creates <code>/NVR</code> on the next drive once the current one is full (so you never have to do it manually)? '''Prompt:''' yes please show that script '''ChatGPT:''' Perfect 👍 — here’s a simple, reliable script that automatically creates the /NVR folder on the next drive only when the current drive is nearly full. This keeps your MergerFS pool running smoothly and allows older drives to sleep.
Summary:
Please note that all contributions to freem are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 (see
Freem:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)