check that the partition is actually a mountpoint before enabling it for greyhole
When I made a change to my shares, to re-generate the greyhole.conf and the smb.conf (see #610), Amahi created a .greyhole_uses_this file on my / partition, in /mnt/hdd7/gh/
This path (/mnt/hdd7) normally has a drive mounted there, but it wasn't mounted at this time, because I was fsck'ing it.
Before Amahi creates .greyhole_uses_this and the gh folder, it should make sure that it's doing it in the root of a mount point...
i.e. if / is a mount point, it's ok to create a /gh folder, and the /gh/.greyhole_uses_this file, if / was selected in the Storage Pool page.
Same if I have a drive mounted in /mnt/hdd7, and it's selected in the Storage Pool page: mkdir /mnt/hdd7/gh && touch /mnt/hdd7/gh/.greyhole_uses_this
But if the Amahi DB says I have /mnt/hdd7 selected, but nothing is mounted there (i.e. it's in fact the root partition), it shouldn't create the gh folder, and .greyhole_uses_this file!
Because it did, my root partition has been filled to capacity, and my server crashed hard.
#1 Updated by cpg almost 12 years ago
doing the check is a good thing.
so ... it created the dot file inside some other disk (the one where things were mounted), deep in the file structure (not in the root).
How, or more to the point, why, would that affect GH operation??
Or why would that cause bad operations?
Wouldn't it only matter when the dot file is in the root of the partition?
i.e. not in this case?
What am I missing?
#2 Updated by gboudreau almost 12 years ago
It matters because it makes Greyhole use a partition I might not have included in my pool, for good reasons.
In this particular case, /mnt/hdd7 is inside the root partition, when nothing is mounted in /mnt/hdd7 like it should.
So that makes Greyhole use the root partition in the pool, which most likely will fill it to capacity.
When my drive is correctly mounted, /mnt/hdd7 is the root of that partition, and it's fine to create gh folder in there, and the .greyhole_uses_this file in that folder.
#6 Updated by cpg over 11 years ago
is this the way to test? ... basically, try to add a partition that is not a mount point:
- visit with web interface to add to the pool, then
- behind the scenes unmount the partition you are about to add to the pool
- add the partition to the pool through the previously opened web interface
- add the partition to the pool
Also available in: Atom