Questions tagged [loop-device]

25 questions
23
votes
2 answers

loop device in a Linux container?

I'm attempting to use a loop device inside a container, to mount some image file: > sudo losetup /dev/loop0 test.img losetup: /dev/loop0: failed to set up loop device: No such file or directory /dev/loop0 indeed doesn't exist, and > sudo mknod…
Johannes Ernst
  • 1,037
  • 4
  • 16
  • 26
6
votes
1 answer

ZFS - Use a file as l2arc cache

I have a CentOS server that is using zfs to manage a big, slow, network attached volume. We read quite a lot from this volume, hence I would like to optimize the read performances. The idea is clearly a L2ARC cache. Unfortunately I only have a…
Siscia
  • 173
  • 3
6
votes
1 answer

Loop back mount a VMDK flat image on a Linux Box

I am trying to loop mount a VMDK flat image generated by VMware fusion. The VMDK file has the -flat extension. I am trying to use kpartx kpartx -av /path/to /my/vmdk but I get llseek error device-mapper: resume ioctl on loop0p1 failed: invalid…
user301916
  • 163
  • 1
  • 1
  • 5
5
votes
3 answers

Find out which loop device is behind a dev mapper block device

I'm using cryptsetup with loopback devices. I'm looking for a way, given a device mapping, to identify which loopback device is used by this device. i.e. get /dev/loop1 as a result of an operation on /dev/mapper/some_mapping How can this be done?
miluz
  • 161
  • 1
  • 5
4
votes
1 answer

How can I give access to loopback devices which are created dynamically to a Docker container?

I have a small Docker container from which I can access /dev/loop0. For this I've added to docker run: --device=/dev/loop-control:/dev/loop-control \ --device=/dev/loop0:/dev/loop0 \ On this loopback device I'm creating two or more partitions with…
emmerich
  • 53
  • 5
3
votes
2 answers

No write failure on an over-allocated sparse file

I've been working with sparse files in order to replicate Linux fs permissions on a Windows samba mount an idea from here: https://www.thanassis.space/backup.html. While testing sparse files though, I've discovered an, interesting, problem wherein a…
j. Doe
  • 33
  • 3
3
votes
1 answer

Cannot read device /dev/loop0

I'm trying to create a crypted drive on my loop0 device. For this command /sbin/cryptsetup create cryptedDrive /dev/loop0 I'm getting the following error Cannot read device /dev/loop0 Here's my strace output for the loop3 device: (for a better…
clinical
  • 133
  • 1
  • 6
3
votes
1 answer

Why make random file for loopback device for encrypted file system?

I have read a few tutorials on setting up an encrypted file system using cryptsetup. They all start with the following creation of a random file dd if=/dev/urandom of=/etc/cryptfile bs=1M count=10 This file would be further used to create a…
2
votes
2 answers

loop device does not auto detach on umount

I have a backup script in which I umount a squashfs file, I do backup then mount it back again. A simplified version of the script is: umount /home/backup/auto/mnt/os mksquashfs /src-dir /home/backup/auto/os.sqfs.img mount -t squashfs -o loop…
NickSoft
  • 248
  • 6
  • 22
2
votes
3 answers

Can I create a compressed loop-device filesystem that can expand to fit the data size?

I have large numbers of small log files that are essentially write-only, unless I have to look at them for some reason. Right now, they accumulate in day-specific subdirectories in a logging folder (e.g. 2018-12-29 for yesterday, 2018-12-30 for…
Christopher Schultz
  • 1,056
  • 1
  • 11
  • 20
2
votes
1 answer

Link Aggregation with 3 switches

I am new in networking. Sorry for my ignorance. I have three switches. Switch 1 has 4 ports. Two of them connected to switch 2. And the other two ports are connected to switch 3. All these four ports are in the same link aggregation group. (I am…
ysnfrk
  • 23
  • 4
1
vote
0 answers

A looped hub connected to a switch

---- We don't want to block the use of Hubs --- If two switches are connected to each other via a hub, STP detects and blocks alternate link (if available). But if a hub is connected to even one (single) switch, and the hub is LOOPED TO ITSELF, it…
1
vote
1 answer

kpartx device to image mapping

I am using kpartx to map the paritions of an image file to device mapper. kpartx maps the image to one of the free loop devices, for example, /dev/loop0 Is there a way to query what image is mapped to which device? for example a command that takes…
user301916
  • 163
  • 1
  • 1
  • 5
1
vote
1 answer

poor performance with vmdk mounted as loop device even after conversion to raw

Edit 13/12/12 - At this stage it would appear to be related to Western Digital (and possibly others) Advanced Format 4K block sizes. This link goes some way into describing the issue, however the disk I have reports 512 logical and 4096 physical…
jelloir
  • 41
  • 5
1
vote
1 answer

Why does this loopback device creation malfunction?

The stackoverflow people thought this was more appropriate here, I put it there as it is part of a program but I can see their POV, so here it is: At the bottom of the code you can see it failing. In fact, I'll put it here at the start too because…
user50118
  • 111
  • 2
1
2