I am trying to create an init script which queries
losetup -f for a free loop device. Within the init script I have a
start() which queries
losetup -f for the free loop device to setup some stuff, and there is also a
The problem I can't figure out is how can I store the output of
losetup -f in a persistent matter which is safe from user accidents (overwriting environment variables, etc) so that when
stop() is called at any point I can have access to this particular init scripts loop device that it was assigned.
The reason I need persistence on which loop device is assigned is that there are 2-3 init scripts which are going to be dealing with loop devices (at least 2 loop devices per init script) and each needs to keep track of itself.
Should I assign the output of the multiple
losetup -f to a file so that I can read them back via loop when I need to detach/work with them? If so what is a standard directory for this kind of data.