OPERATING SYSTEMSOS Linux

What Are All These Loop Devices? (Ubuntu/Snap Users Often Ask This.)

What are loop devices? This is a question that comes up a lot these days, especially from Ubuntu users. This is due to the fact that Snap packages are mounted as loop devices.

A PAST VIDEO I MENTIONED IN THIS VIDEO:
► https://www.youtube.com/watch?v=tEnnEhziLn8 – Move Your Home Directory To A Second Drive

WANT TO SUPPORT THE CHANNEL?
💰 Patreon: https://www.patreon.com/distrotube
💳 Paypal: https://www.youtube.com/redirect?event=channel_banner&redir_token=QUFFLUhqazNocEhiaGFBT1l1MnRHbnlIcHFKbXJWVnpQd3xBQ3Jtc0tsLVZJc19YeFlwZ2JqbXVOa3g0Skw4TVhTV2otNm1tM3A1bUNnamh3S2V6OGQtLTBnSjBxYTlvUXMxeEVIS3o4US10NENHMUQ3STk2a01FOFBhUnZjZFctMEhFUTg1TVctQmFfVUdxZXJ4TDl0azlYNA&q=https%3A%2F%2Fwww.paypal.com%2Fcgi-bin%2Fwebscr%3Fcmd%3D_donations%26business%3Dderek%2540distrotube%252ecom%26lc%3DUS%26item_name%3DDistroTube%26no_note%3D0%26currency_code%3DUSD%26bn%3DPP%252dDonationsBF%253abtn_donateCC_LG%252egif%253aNonHostedGuest
🛍️ Amazon: https://amzn.to/2RotFFi
👕 Teespring: https://teespring.com/stores/distrotube

DONATE CRYPTO:
💰 Bitcoin: 1Mp6ebz5bNcjNFW7XWHVht36SkiLoxPKoX
🐶 Dogecoin: D5fpRD1JRoBFPDXSBocRTp8W9uKzfwLFAu
📕 LBC: bMfA2c3zmcLxPCpyPcrykLvMhZ7A5mQuhJ

DT ON THE WEB:
🕸️ Website: http://distrotube.com/
📁 GitLab: https://gitlab.com/dwt1
🗨️ Mastodon: https://fosstodon.org/@distrotube
👫 Reddit: https://www.reddit.com/r/DistroTube/
📽️ LBRY/Odysee: https://odysee.com/@DistroTube:2

FREE AND OPEN SOURCE SOFTWARE THAT I USE:
🌐 Brave Browser – https://brave.com/dis872
📽️ Open Broadcaster Software: https://obsproject.com/
🎬 Kdenlive: https://kdenlive.org
🎨 GIMP: https://www.gimp.org/
🎵 Tenacity: https://github.com/tenacityteam/tenacity
💻 VirtualBox: https://www.virtualbox.org/
🗒️ Doom Emacs: https://github.com/hlissner/doom-emacs

Your support is very much appreciated. Thanks, guys!

source

ubuntu

37 thoughts on “What Are All These Loop Devices? (Ubuntu/Snap Users Often Ask This.)

  • Linux is fun and all but honestly its so frustrating trying to remember specific or "quirky" commands/parameters for one scenario. Like "lsblk -e 7" who comes up with this stuff

  • This is incredible. So basically I can make a file and mount it as a virtual drive, use it to store data and then copy it on a new system? Copying just one file takes much less time, and I could use this method for my /home directory. This way I can take it anywhere. I could put in on a flash drive and copy to a new system and mout it there

  • I would've thought that it would be permanent, so it's good that you "diverged" and went over that as well

  • I hope u have a video on interactive shell setup, auto completion.. i need that

  • Derek, I think you missed the core reason why loop devices are useful.

    There is almost no benefit of using loop devices instead of just mounting the filesystem from the image directly if the file is a partition image and contains a valid filesystem. After all, block devices are also files in Unix and it works the same way for ordinary files as well.

    But the full disk images are trickier. On Linux, udev automatically creates device files for the individual partitions (sda1, sda2, sdb1, nvme0n1p1, mmcblk0p1, etc.), but there is no equivalent functionality for disk images by default, so you can't mount partitions when they are inside a disk image. One way to get around this is to create a loop device with the offset of that specific partition you want to mount using with -o option and then mounting the loop device — just like as you mount a partition.

  • Check out Shufflecake, it takes this Loopback concept and runs all the way away with it for hidden and recursive filesystems.

  • Why do snaps need the loop devices anyway? Can't they just mount the file directly? SInce everything is a file on Linux, what's the point of guiding the file through /dev/loop?

  • You can install so many programms that never need loop devices and then theres snap that uses them for stuff like a calculator. I think less people would complain about that if it was actually needed and not just spam when you run lsblk.

  • Hey DT, can you tell me your system dark gtk theme name which you use in your browsers, pcmanfm etc.. please 🥺.

  • Are there any alternatives to Mastadon? New users ruined it. Its like reddit now.

  • I immediately stopped watching and went on to try the commands, all in /tmp because I'm scared. I'm so glad you accidentally went over them! I put stuff in my image file and mounted and unmount it over and over

  • Should do an video on how Linux boots from power button to graphical application

  • i don't have any snaps because flatpaks do what i want them to also not a fan of snaps but if you want to use them that is fine

  • Just use Debian, guys. There’s such a thing as nonfree repos, backports, testing, and even appimages. There’s no reason to deal with middlemen.

  • DT I remember when you didn't like the idea of snaps or at least you gave that impression, Why all the snaps talk now? Are you moving to the dark side? lol

  • This is kinda half ass demo with all the “ I didn’t mean to …”😂 however I do appreciate many of your other videos

  • This video left me more confused about this topic than I was before.

  • I see that there are no snaps defined in fstab. Does that mean that snap system has separate tools to auto mount your snaps?

  • Who are these strange people that complain about snaps and lsblk working as intended?

  • "Pollute the output in lsblk." Lmao. People will complain about anything related to snaps.

    For people willing to learn, there are other methods to hide the "loop spam" when using lsblk. You can use lsblk -f zfs/ext4/xfs etc to list a specific filesystem. You could also simply use lsblk / to list your root directory.

  • Good reason to drop Ubuntu and switch to arch or at least Debian, or ventoy and combine the loops. Loop de doop hoolahoop got too many loops from my live oses. Hula hoop loop de doop hulahoop through the loop.

  • Hey DT enjoy your content please don't quit your day job!

  • Very nice video about disk images on linux.
    I do wonder they they are not all just installed on the main drives instead of just run on their own individually mounted disk image. This whole concept of snaps being mounted disk images where the application within is run seems rather pointless.

  • DT, I was thinking while I was watching this video. ( Which is very good. Perfect for my level. ) That you spoke about other viewers in a previous video had told you that you would be great doing voice work. I agree. You should seek out an agent involved with radio and television. One of my employees when I was a technical director at a large regional childrens theater, worked as voice over for local TV and radio as well as working as a scenic painter. She made more with the voice over work. Its out there, even in Louisiana. This was twnety years ago in Birmingham AL. Im sure you would get some offers. Thanks for all of the videos you make . You have taught me alot. Hopefully this finds you well and you can profit from it.

  • The loop-devices is actually one of the reasons I switched away from Ubuntu. Every time I wanted to do something to backup or anything with my hard drives, list or whatever, these loop-devices always spammed my workflow. And Ubuntu going harder and more on Snaps, this would become more and more of a problem for me.

  • I must be missing something but I just don't see the architectural need for Snap to use loop devices. Segregation can be achieved without it which seems more logical, but maybe that's just me.

Comments are closed.