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).

Filter by
Sorted by
Tagged with
0
votes
0answers
42 views

WRITE_ZEROES not supported on loop devices

I ran into a strange problem where mkfs.ext4 won't work on loop devices backed by a temp file. tmp_file="$(mktemp)" fallocate -l 8M "$tmp_file" loop="$(losetup --show -f "...
1
vote
1answer
107 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
2answers
480 views

How to increase the size of a loop virtual disk?

I have generated an image file with dd. The image contains two partitions. I created a loop virtual disk: losetup -P /dev/loop0 $image_file. I mounted the two loop created partitions (loop0p1, loop0p2)...
1
vote
1answer
26 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 ...
2
votes
1answer
83 views

Why does mount -o loop return “No such device”?

I want to mount the contents of an iso9600 (CD) image via a loop to access its contents. To do so I execute mount -r -t iso9600 -o loop file.iso mountpoint/ and would expect the contents in the (...
0
votes
0answers
31 views

kpartx : Does not create device mapper

I am trying to map my image file as a block device by kpartx. OS: root@01565aeba581:/home/opnfv/repos/yardstick/tools# more /etc/os-release NAME="Ubuntu" VERSION="16.04.6 LTS (Xenial Xerus)" ID=...
0
votes
1answer
34 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 ...
2
votes
0answers
39 views

Is it safe to enable Direct I/O for a loop device backed by a sparse file?

I'd like to have a sparse file, and mount it as a filesystem. It'd be great if the performance overhead is negligible, but only if that doesn't come with a data-loss risk! Is it safe to mount the ...
2
votes
1answer
196 views

Mount a PV image as a readonly loop device (again - it used to work)

A couple of years ago I upgraded my netbook with a larger hard drive. I wanted to retain the contents of the old hard drive in case there was anything I still wanted off it. So I copied the the old ...
1
vote
1answer
415 views

Cannot mount dislocker-file loop: wrong fs type, bad option, bad superblock

I am trying to mount a bitlocker encrypted drive with dislocker. Here are the exact commands I ran: sudo dislocker -r -V /dev/sdb7 -u -- /media/bitlocker sudo mount -r -o loop /media/bitlocker/...
2
votes
0answers
101 views

A microSD card backup (Raspberry Pi) has always a corrupt ext4 filesystem although the original seems to be fine

Every backup image of my Raspberry Pi microSD card seems to be corrupt. It doesn't make a difference if I create an image file or if I backup the microSD card directly to some other microSD card. I'...
1
vote
0answers
95 views

How to properly boot ISO9660 looped image with latest GRUB versions?

I'm trying to boot Ubuntu live ISO9660 image with GRUB 2.04 using these instructions. It is failing to boot with GRUB error error: unknown filesystem, even though I can browse as well the boot ...
0
votes
0answers
58 views

OSX: how to mount raspberry pi image file?

BACKGROUND The loop device is available in Ubuntu and is the first step to processing the rPi image with zerofree. The goal is to reproduce the UBUNTU example with OSX High-Sierra: UBUNTU example ...
1
vote
1answer
37 views

Creating a grow-on-demand loop filesystem without sparse files

I wish to create a file to loop mount as a root filesystem that grows dynamically as required (up to a limit). The commonly quoted solution to this is to use a sparse file, which would do exactly ...
1
vote
1answer
617 views

Why is mount mounting the directory to /dev/loop0 instead of the device? Can't write all my files to the directory as a result (since it's too small)

I want to write about 38 MB of files to a partition that is 100 MB large. However, when I mount that partition to the directory, it mounts to /dev/loop0 instead of /dev/sdc1 (in my example). This ...
1
vote
2answers
114 views

Mounting a Luks partition

I have backed up a drive with all its partitions using the command dd if=/dev/sda of=/media/oshirowanen/external-drive/backups-2019/full_drive_backup.img /dev/sda is an ssd which has a Linux OS ...
1
vote
2answers
398 views

Raw disk image from VDI file can be mounted using qemu-nbd but not loop device?

I installed a very old Slack version (3.2) on VirtualBox and then converted it to RAW format (ext2). However, for some reason I'm unable to mount it using losetup but qemu-nbd works fine. Why? I ...
2
votes
2answers
199 views

Recover deleted but mounted loop file/filesystem

By mistake, I deleted an lxc image file. The container is still running and the file is therefore not yet actually deleted until I stop the container. I'd like to avoid stopping the container as it is ...
1
vote
0answers
69 views

Getting snap to mount loop devices using direct I/O

How can I get snap to mount its loop devices in direct I/O mode on CentOS 7? When setting up loop devices manually, I can use losetup --direct-io 1, but can't see where to provide mount options to ...
3
votes
1answer
774 views

what is maximum loop devices for linux kernel?

i can include loop module for supporting loop files. loop module supports max_loop option. I've found examples with options loop max_loop 256 . My question, what is maximal supported loop devices? I ...
0
votes
2answers
209 views

How to make logical volumes on loopback block device available?

I have a file hdd.img being raw image of a hard disk. The harddisk has a BIOS/DOS partition table and its second partition is setup to serve as a the one single physical volume from which LVM creates ...
1
vote
1answer
689 views

Why there are 3 loop devices on my system right after boot?

I'll start this question by listing all drives available on my system right after the login into my Linux Mint 19.2 Cinnamon: # fdisk -l Disk /dev/loop0: 89,1 MiB, 93454336 bytes, 182528 sectors ...
2
votes
0answers
735 views

Delete /dev/loopX entry after detaching loop device

I created a loop device using losetup /dev/loop90 /tmp/disk1, where /tmp/disk1 is a 512M file I have created. Then the loop device was detached using losetup -d /dev/loop90. It was removed from the ...
1
vote
0answers
198 views

Why “udisksctl” and “mount -o loop” giving different root permissions after mounting?

I am trying to mount an iso using udisksctl and it appears that the bash scripts inside these are having only read permission [root@hostname ~]# udisksctl loop-setup -r -f /root/test.iso Mapped file /...
2
votes
0answers
722 views

How to create/populate /dev/loop* devices?

Background: I am setting up loopaes (see http://loop-aes.sourceforge.net/loop-AES.README) on a new install of Devuan ASCII 2.0.0. I built kernel 4.9.184 with CONFIG_BLK_DEV_LOOP=n as was instructed by ...
0
votes
1answer
563 views

Mount iso -o loop select loop device

I have a bash script where I mount an ISO to loop devices: mount -o loop my.iso /tmp/foo And it happens that at the same time in my OS (Linux Mint 19) I have an ISO image mounted, using the GUI ...
1
vote
1answer
438 views

mounting loop not working with UUID

I have created a loop device and added it to /etc/fstab I got its UUID from the output of the blkid command (it does print a UUID for the particular device after running mkfs.ext4 /path/to/loop) ...
0
votes
0answers
263 views

ZFS Disk Image Performance

I am trying to move from LVM to ZFS as a backing store for raw virtual machine / disk images on a new server. I am using Ubuntu 18.04 and the SSDs are all Intel D3-S4510. The problem I am ...
5
votes
0answers
2k views

Buffer I/O error on loop device

Lately, I have been getting Buffer I/O errors during boot time. Seemingly, it appears randomly and I could not be able to reproduce it. However, it happens in every 5-8 boot on average. Here is the ...
1
vote
1answer
442 views

How to automatically mount at boot? [duplicate]

I have a file, called "some.img", created with fallocate, that has a filesystem on it. I can mount the img file using mount -o loop some.img /media/where, and I see the filesystem. When I reboot, ...
3
votes
0answers
2k views

Issue with loop devices in Docker

I'm trying to build a virtual disk image in Docker. I'm able to create my empty file with dd and create the partitions with parted but once I try to make my filesystem it fails saying the device could ...
1
vote
2answers
6k views

How can an image file be created for a directory?

How can an image file be created for a directory? For example: Create iso image from folder via terminal commands shows that genisoimage can create an iso image file for a directory. I only know that ...
0
votes
1answer
1k views

What do the partition table types and flags mean in the output of parted?

In the output of sudo parted -l: Model: WD My Passport 0748 (scsi) Disk /dev/sdb: 1000GB Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags: Number Start End Size ...
2
votes
1answer
302 views

Why does `losetup` need to associate loop devices with block devices? [duplicate]

man losetup says losetup is used to associate loop devices with regular files or block devices, to detach loop devices, and to query the status of a loop device. https://en.wikipedia.org/wiki/...
0
votes
1answer
30 views

Does “loopback” in a loopback file mean the same as in loopback IP address?

man pvcreate says pvcreate initializes a PV so that it is recognized as belonging to LVM, and allows the PV to be used in a VG. A PV can be a disk partition, whole disk, meta device, or loopback ...
0
votes
1answer
282 views

Dual Boot Linux Partition shows as Partition Table: loop in parted (Why?)

Recently I was checking into my partition scheme on my dual boot laptop (Peppermint OS, Windows 10). I was surprised by the output from parted /dev/sda12 (my Linux root partition) Model: Unknown (...
1
vote
1answer
2k views

How do I make `modprobe fuse` and `modprobe loop`, persistent?

This used to not be a problem, but now it is. I haven't changed anything significant so probably an update broke it. When I run VeraCrypt it complains that it couldn't set up loop device and suggests ...
1
vote
1answer
974 views

mkdir -p returns error if exists

Raspbian Stretch Lite: $ mkdir --help Usage: mkdir [OPTION]... DIRECTORY... Create the DIRECTORY(ies), if they do not already exist. Mandatory arguments to long options are mandatory for short ...
1
vote
1answer
495 views

Can't mount squashfs loop during initramfs

I am trying to mount a squashfs file during initramfs. I have included loop and squashfs modules. Currently using mount /foo.squashfs /mountpoint or mount -t squashfs -o loop /foo.squashfs /...
1
vote
0answers
1k views

losetup --detach not removing loopback device

I am trying to detach a loopback device. The losetup --detach presumably succeeds (no error message and return code 0) but the device is still there. Any ideas? root@Cassiopeia:~# losetup -a /dev/...
2
votes
1answer
5k views

Permanently mounting loop device

I created a file touch /datastore/virtual/pseudoblock created a loop device with it sudo losetup /dev/loop0 /datastore/virtual/pseudoblock (although I got a warning about its size) and then ...
0
votes
0answers
98 views

Loop Device eat up RAM [duplicate]

EDIT: Given link of another thread suggest that newer kernel do not have this issue but I am using latest kernel i.e. 4.18.5. Hence, this issue is either new or newer kernel have this bug In my setup,...
1
vote
0answers
144 views

loop device not matching file size

I have a sparse backing file (NTFS) (made via dd seek=) that's a partial image of a damaged disk. The size as given by ls matches the original disk. However, when looping it, /proc/partitions shows it ...
17
votes
4answers
6k views

Why does one need a loop device at all?

I previously used to create image files using dd, set up a filesystem on them using mkfsand mount them to access them as mounted partitions. Later on, I have seen on the internet that many examples ...
3
votes
1answer
2k views

What's the difference between direct-IO (“losetup --direct-io”) and “mount -o sync” for loop-devices?

I understand that without use of any flags, there are two caches involved with loop-devices. Once a page cache when writing to the file-system within the loop-device, and then again to the page cache ...
35
votes
3answers
25k views

What is the difference between mount and mount -o loop

I have a iso file named ubuntu.iso. I can mount it with the command: mount ubuntu.iso /mnt. After mounting it, I can see it from the outout of the command df -h: /dev/loop0 825M 825M 0 100% ...
0
votes
1answer
683 views

btrfs check /dev/loop0 -> ERROR: cannot open file system

I have a file formatted as a btrfs filesystem. I can loop mount it and use it normally. I'd like to run btrfs check on this file, but an error is generated. First I tried with just the file: $ ...
2
votes
2answers
671 views

Can losetup be made efficient with sparse files?

So my setup is like this. $ truncate -s 1T volume $ losetup -f --show volume /dev/loop0 $ mkfs.ext4 /dev/loop0 $ ls -sh volume 1.1G volume $ mount /dev/loop0 /mnt/loop Now I have a 1.1TB volume, as ...
2
votes
2answers
2k views

Cannot mount Matlab 2018a

I am using Ubuntu 18.04, and trying to moutn Matlab ISO using the following command: sudo mount R2018a_glnxa64_dvd1.iso /mnt/cdrom -o loop But terminal is responding back as: mount: /mnt/cdrom: ...
0
votes
1answer
519 views

Is it possible to boot a grub-mkstandalone created img file from cfg?

So I have a fully functional .img file created using grub-mkstandalone. I put this on a CD and it boots fine, the ISO loads great in a VM, etc... Now, what I want to do is link an existing grub.cfg ...