The problem with... The disk devices that we have been
using we've connected to loop devices,
but these loop devices do not persist after a reboot,
so it's going to cause us a little bit of problem if
we needed to continue using these.
To overcome this problem, we can create a systemd service unit,
and this essentially is scripting the device creation upon a system startup,
running both the losetup and partprobe command.
Now when we go through and take a look at the service unit that we create,
here I'm just calling it losetup.service,
the Unit header is really setting up common parameters that
we're going to find in all systemd units.
We're setting a description, we say we don't need to worry about dependencies,
but we want this then loaded before our local file system target
and after we've done our hardware detection.
As this is a service unit, we add in a Service header.
The type=oneshot means that we just execute the commands and we
don't worry about those commands staying running.
So we can see then we run our losetup and partprobe.
As we said, we're then only running what oneshot.
We don't have to worry about the service then continuing to run afterwards.
The Install header is there so we can enable this service,
and we group services together in target unit files.
Here we're grouping this as part of the local file system target,
so once we reach that target, this service unit will be loaded.
Now the best way to see systemd and how great it can be
for you is to practice this yourself, and that's exactly what we're going to do in our next demonstration.