So yes, we need to now go through and take a look at using our losetup
command, so we might link these files through to device files. Now
moving out directly through to our command line,
we know that we're able to use, then our sudo losetup command.
And we're going to be able to see, then that we've got /dev/loop0, and
that's then linked through to the ISO file. We mounted the ISO file, but in
the background, it created the loop device for us.
So there's a little bit of under‑the‑hood activity that we can learn a little
bit more about. Now we do need to run with extended or elevated privileges
because the losetup command is creating our loop devices.
If I go through and look at ls/dev/loop*, we see we've got our loop0 device, and
we've got a special device, loop‑control used to look at devices that need
creating. So because we have to create a device file,
we're going to need to elevate our privileges.
I can go through and do a sudo.
And if we have a look at using losetup, first of all,
I'll just show you a very simple way where we can go through and say
that we want the /dev/loop1 to link through to our disk image. We can
add that through to our disk1.img. So I can run it straight like that
if I know the device I want to use.
But we can also, instead of specifying the device,
we can specify ‑f to find the next available, and then
‑‑show, so it will show us which one is used, and then we
can go through and link it to disk2.
Now when we go through, it used, then loop2 as being the next available.
And of course, if I go through and just run losetup by itself now, we can
see, then that we've got our loop0, loop1, and loop2 in use.
I only put the relative name, but that relative name has been extended to a full
path, so we're not going to get any issues locating our files later on. When I
run my ls ‑l and take a look inside of the dev directory and our loop devices
now, ls ‑l will show them one per line.
Obviously, we're going to have a few more now, so we can see that we've got
our loop0, 1, and 2, as well as the loop‑control device.
When we look at our lsblk command, of course, and we're able to see our block
devices. And again, we should be able to link the major and minor numbers
through to the long listing that we see with ls.
So that's given us a couple of extra loop devices to
play with, a couple of extra disks.
We're going to take a look in the next slides in setting up partitions, breaking our disks into smaller pieces.