Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

can a directory be none writeable when a disk mounted into it disappears?

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
dieselnutjob
Posts: 133
Joined: 2011-04-12 10:25

can a directory be none writeable when a disk mounted into it disappears?

#1 Post by dieselnutjob »

The scenario:-
A small rootfs drive (like an SSD or something).
The rootfs has a directory like /data
There is a much larger many TB driver mounted as /data
So as far as applications are concerned /data is huge.
Now suppose that some application like syncthing is dumping a lot of data into /data
Let's say that something goes wrong with that big drive.
I want /data to be unusable, not for syncthing to fill up the entire rootfs.
Maybe permissions are the answer (so /data without anything mounted over it is only available to root)?

reinob
Posts: 1198
Joined: 2014-06-30 11:42
Has thanked: 99 times
Been thanked: 47 times

Re: can a directory be none writeable when a disk mounted into it disappears?

#2 Post by reinob »

You can remove write permissions to the rootfs /data, so that if the overlaid /data is unmounted writes will fail.

User avatar
wizard10000
Global Moderator
Global Moderator
Posts: 618
Joined: 2019-04-16 23:15
Location: southeastern us
Has thanked: 80 times
Been thanked: 94 times

Re: can a directory be none writeable when a disk mounted into it disappears?

#3 Post by wizard10000 »

I use "if mountpoint" to tell if something is actually mounted and if it's not mounted it bails out of the backup script. Looks like this -

Code: Select all

if /usr/bin/mountpoint -q /path/to/mountpoint
  then
    # backup script goes here
  else
    exit 1
fi
exit 0
Hope this helps -
we see things not as they are, but as we are.
-- anais nin

Post Reply