Questions tagged [loop-device]
A loop device allows any file to be mounted as a filesystem image. Not to be confused with a loopback interface in networking. Don't use this tag for questions regarding "for-loops" (use the "for" tag instead).
189 questions
12
votes
1
answer
881
views
Why does mkfs.ntfs count one Byte less?
Apparently, ntfs.mkfs counts one byte less when checking if the block device is large enough; or I have made some kind of mistake.
After creating a partition of 2048 512-byte sectors (exactly 1MiB ...
2
votes
1
answer
270
views
What is holding a file descriptor to this block device aka why didn't losetup -d remove a block device
There's a number of posts about losetup -d /dev/loop0 not removing a lookback device, even though it returned a successful return code. I believe the root cause of those posts is that the block device ...
2
votes
1
answer
129
views
Is it safe to use a loop device to circumvent EBUSY on a block device underlying device-mapper?
I’m trying to include the beginning of a disk block device (the GPT area) read-only in a device-mapper linear mapping. This block device also contains my root filesystem, as such the partition housing ...
0
votes
0
answers
26
views
how to check how many loop-devices in a linux system are possible to use? [duplicate]
how to check how many loop-devices in a linux system are possible to use?
i need this in a script, are not more than X possible, than end the script with some message...
0
votes
1
answer
69
views
join a specific number of files/devices in linear mode together in a linux system
For joining in Linux files/devices in linear mode together i have this script dm-joinlinear.sh from
join files/devices in linear mode together in a linux system , thanks telcoM
#!/bin/sh
usage() {
...
7
votes
0
answers
368
views
Why is a loop device called a "loop" device?
As far as I understand, a loop device is a regular file that acts as a block device.
It's used for various things like isolation in snap packages and installing ISOs over an existing filesystem.
But ...
3
votes
1
answer
103
views
Loop partitions disappear on rebind
When I create a 400MB file called /tmp/foo, then call losetup -f /tmp/foo, this creates a loop device /dev/loop15. If I then partition the loopdevice and format it to contain ext4,ntfs, and fat32 ...
0
votes
0
answers
238
views
parted not recognizing loop device
I created a loop device with
$ truncate -s 20G test.img
$ losetup -fP ./test.img
$ losetup -a
/dev/loop0: [0032]:4051 (/tmp/test/test.img)
lsblk is able to see it just fine
$ test]# lsblk
NAME ...
5
votes
1
answer
744
views
Can loop devices be automatically cleaned up when a process exits?
I'm trying to figure out a clean and safe way to use loop devices inside of a build script. To the best of my knowledge loop devices are required if you want to (GPT) partition and (FAT32, EXT3) ...
1
vote
1
answer
192
views
How to loop-mount Ubuntu boot drive backup LVM with duplicate UUID
I created a backup of my LUKS-encrypted Ubuntu installation's entire boot drive as a squashfs file.
The backup was performed by using Streaming Compression into a pseudo file, resulting in a ...
0
votes
1
answer
511
views
Why does 'mount' fails when trying to mount partitions of a virtual disk that has two parititons?
I am trying to make a virtual disk with two partitions. First a 100M FAT (type 0xC) and second a 2G Linux partition (type 83). I have a process that does this correctly with a real USB device. But I ...
0
votes
1
answer
248
views
EXT partition seen as unpartitioned space in loop device on Ubuntu 22.04.1
I am trying to create a disk image file with an EXT2 partition, however the partition is not found and entire loop device is seen as free/unpartitioned space.
My computer can read Ext2 formatted disks,...
5
votes
1
answer
11k
views
Can't remove or unmount loop device on Debian
I have a loop device which shows up when I do losetup --all that I have been unable to remove.
So, I basically got myself into this issue because a created a raw image of a microSD card and then I ...
0
votes
2
answers
1k
views
Boot loop device as root file system
I created an ext4-filesystem on a loop device with all necessary files to boot with, e.g.:
/bin /boot /dev /lib /mnt /etc ...
Now I want to boot from the loop device as an image (let's say ...
0
votes
1
answer
1k
views
How to recover an iSCSI disk
I run an iSCSI disk on a Linux server (RHEL7). The disk has a normal ext4 partition containing a loop device called disk01.img, which is mapped to a virtual disk with a Windows NTFS file system. All ...
0
votes
1
answer
412
views
Why do we need to set loop devices when mounting ddrescue images?
In various tutorials I see the following command:
mount -o ro,loop,offset=123 harddrive.img /mnt/loop
but from reading the documentation I can't understand what are loop devices.
Why would harddrive....
4
votes
1
answer
6k
views
losetup: How to use the -f option?
For example, I would like to setup mydata.img to /dev/loop5, I would expect using the command below. However it gives the error losetp: unexpected arguments.
losetup --show -Pvf /dev/loop5 mydata.img
...
1
vote
0
answers
23
views
How to mount partition of .img as loop back device Ubuntu 20.04 [duplicate]
I need to create a bootable disk image on a remote computer but keep getting errors trying to mount partitions created on the .img file
I have tried many different utilities but the basic steps I am ...
3
votes
2
answers
2k
views
Why is it possible to "loop" a filesystem by mounting it to one of its folders?
/dev/sda5 is mounted at / and it's my filesystem
piotr@thinkpad:~$ sudo mkdir /home/mpoint
piotr@thinkpad:~$ sudo mount /dev/sda5 /home/mpoint
so now I can do:
piotr@thinkpad:~$ cd /home/mpoint/home/...
1
vote
1
answer
3k
views
A lot of loop devices in the system
I have the following picture:
$ sudo lsblk -f
NAME FSTYPE LABEL UUID MOUNTPOINT
loop0 squashfs /snap/code/58
loop1 ...
0
votes
0
answers
53
views
Filesystem image made with dd sometimes fails--How to Analyze? [duplicate]
I've googled this extensively and can't quite come up with an answer.
Overview
I created two image files of a filesystem I'm actively using (/) and it sometimes is ok, and othertimes is not.
What I do
...
2
votes
0
answers
763
views
How to sync a loop device when the backing file is changed
The data being displayed on a loop device mount is incorrect when the data in the underlying file is changed.
Example:
$ mkdir drv
$ dd if=/dev/zero of=data.ext4 bs=1M count=10
$ mkfs.ext4 data.ext4
$ ...
2
votes
1
answer
6k
views
How to shrink a file image, produced with dd?
I tried the process from this post resize partition on an image file. I didn't succeed in understanding why it goes wrong in my case.
I produced a 8GB image using dd. The image contains two partitions....
2
votes
1
answer
2k
views
Mounting as <user>, a loop still assigns root ownership
I am trying to set up a virtual drive from a file. This file will then be written to a flash device (not relevant). Because creating and manipulating the virtual drive will be in a script, I need to ...
0
votes
1
answer
605
views
how to mount and read from the .img file used by usb_gadget/g_multi/mass_storage?
the pocket beagle, using debian9.9, shows up as a mass storage device on my windows machine. I have found the backing file (i'll call it a drive) used by the mass storage device. I would like to mount ...