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
1
vote
0answers
35 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
73 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
94 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 ...
0
votes
1answer
34 views

How to execute a script on several nodes using Slurm?

I have a R code that I want to execute on several nodes using Slurm, with each iteration of my paramater which goes on a node. This is my Slurm code : #!/bin/bash #SBATCH -o job-%A_task.out #SBATCH -...
0
votes
0answers
31 views

How to split a bash loop on several nodes with Slurm?

I would like to split this loop : for i in $subset do srun Rscript my_script.R --subset $i done where $subset corresponds to seq 1 number . I would like to execute each value of i on multiple nodes....
0
votes
0answers
39 views

Can I specify a size space while using mount command?

I mount a *.img file, and want to copy some new files into it. But there is not enough space for me to place new files. Can I specify more size space while I use mount. ./Image: No space left on ...
1
vote
1answer
66 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
85 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 ...
1
vote
0answers
32 views

Redirect http->https, but exclude subdomain

I use Drupal, with a complicated multi-Domain setup, and have a local development site, that uses (locally) the dev. subdomain. So I want a .htaccess file that can be used on production AND ...
0
votes
0answers
14 views

Merge multiple files with different extensions using a loop in bash script [duplicate]

I have 100's of files of the form filename.0 filename.1 filename.2 filename.3 And they all have identical layouts which I want to merge together into one file using a loop in my bash script, I have ...
5
votes
0answers
623 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 ...
0
votes
1answer
30 views

Bash script to link networked account directories to local account directories

I'm working on a script that will create a local user account, and link local account directories to networked account directories. The only directories I would like to be created and linked are the ...
1
vote
1answer
40 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, ...
0
votes
1answer
51 views

Understanding $() (and for-loops) in bash

I have a directory with git inside and git branch gives me the following output: $ git branch branch1 * branch2 master The * marks the current branch. I would like to use this output in a script....
2
votes
0answers
394 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 ...
0
votes
2answers
825 views

How can an image file be created for a directory?

How can an image file be created for a directory? For example: https://unix.stackexchange.com/a/90794/674 shows that genisoimage can create an iso image file for a directory. I only know that an ...
0
votes
1answer
241 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
116 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
24 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
0answers
116 views

mount failing when mounting ewf1 as a loop device

I am trying to mount an EWF image on Debian. From the original E01 format, I used ewfmount to mount it and it worked fine. Now, I need to mount the ewf1 file, and it claims that I do not have the ...
0
votes
1answer
40 views

Perpetually ping 3 devices from startup [duplicate]

I wish to ping three local devices, every 5 min, without stopping, from a Raspberry Pi running Raspbian OS. When my Pi powers on, I want that to automatically start. I saw an old post about it, ...
0
votes
1answer
66 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
444 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 ...
0
votes
2answers
115 views

Command substitution not working inside for loop condition

for (( a=1;a<=$(wc -l sedtest1);a++ ));do echo $a; done Gives me an error: -bash: ((: a<=21 sedtest1: syntax error in expression (error token is "sedtest1")
1
vote
1answer
288 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 ...
2
votes
1answer
247 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
451 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
3k 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
54 views

Mapping part of a block device: dmsetup vs losetup

Suppose I want to create a virtual block device from an area on already existing block device. I can use either dmsetup (device mapper) or losetup for this purpose. What are practical differences ...
0
votes
0answers
58 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
68 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 ...
12
votes
4answers
4k 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
726 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 ...
23
votes
3answers
11k 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
437 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: $ ...
1
vote
2answers
261 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 ...
1
vote
2answers
1k 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
1k views

Loop to create subdirectories in multiple directories

I want to create subdirectories into each of directories below. I used the following loop: #! bash /# dir m3z m3t m3t2 m3g m3g2 m3g3 ... n dir for d in m3z m3t m3t2 m3g m3g2 m3g3 ... n ...
0
votes
1answer
286 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 ...
0
votes
0answers
1k views

How to take read all the partitions from eMMC dump

We have Beaglebone Black based custom board with 4GB eMMC and 256MB RAM. eMMC is partitioned as follows # parted --list Model: MMC MMC04G (sd/mmc) Disk /dev/mmcblk0: 3842MB Sector size (logical/...
-1
votes
1answer
380 views

partition table on a disk partition; how to access?

I've made a TrueOS VM in VirtualBox, using a vmdk that virtualises a physical harddisk partition (sda5) as a complete disk. As a result, I now have a GPT/GUID partition table on that sda5 partition (...
1
vote
1answer
241 views

How to set ddrescue image sector size?

I have ddrescue image and want to recover data from it. But the image is taking wrong sector size it should take 4096 and the partitions are btrfs partitions. How to change the sector size? $sudo ...
1
vote
2answers
2k views

Debian. Can't umount loop device

Debian 8.2. I want to umount the /dev/loop5 device that I mounted, but I can't. I'm getting the message that /dev/loop5 is not mounted. Could anyone explain to me what I'm doing wrong here, ...
0
votes
1answer
221 views

Does `mount -oloop` use direct IO by default (when the kernel is new enough)?

Since the kernel started supporting it, losetup was modified to enable direct IO by default. This can avoid having redundant page cache and also has performance advantages. http://man7.org/linux/man-...
2
votes
1answer
3k views

Loopdevice partitions do not show up

I have a program which creates partitions and filesystems on a disk. To test it, I have created an image file: dd if=/dev/zero of=disk.img bs=1M count=100 and mounted: sudo losetup /dev/loop0 disk....
4
votes
1answer
1k views

Persistent LVM device with loopback devices by fstab

I like to create a LVM device where physical volumes are loopback devices. I have read lot of documents and tutorials, like this. Unfortunately all of them are based on the losetup command, which ...
2
votes
1answer
464 views

Creating dual-partition SD card image by a script

I have a system that generates embedded Linux systems. The system outputs three files: a tarball containing rootfs excluding the kernel modules a tarball containing the kernel modules uImage The ...
4
votes
2answers
414 views

Fsck at boot time for loopback device

I discovered that is not possible to run fsck on a loopback device at boot by the fsck flag inside the fstab file, nor is it possible to accomplish this by manually running fsck when the loop device ...
2
votes
1answer
258 views

Why does kpartx use a new loop device each time?

I'm running kpartx from within a python script as part of a custom OS build I'm trying to do. I'm using python sh module to run bash commands. sh.kpartx("-as", image) is how I attach my image. Then ...
9
votes
1answer
6k views

losetup: cannot find an unused loop device [closed]

I'm trying to create a loop device, and getting an error I don't understand: # losetup -f /media/2TB/sdb2-fix-file losetup: cannot find an unused loop device I have no loop devices setup. The ...