A loop device allows any file to be mounted as a filesystem image. Not to be confused with a loopback interface in networking.

learn more… | top users | synonyms (1)

0
votes
1answer
38 views

Compare a certain lines from multiple documents

I want to compare a certain lines in a multiple documents. I tried using diff and comm, but the conditions are these, the documents are in a different working directory/folder, I could use a ...
1
vote
1answer
26 views

Using Device mapper thin provisioning on loop devices

I have several KVM raw files that are read only (about 100gb). I am adding these raw files as loopback devices. I then create a snap file to allow the VM to have read/write access to its disk. This ...
3
votes
4answers
348 views

How do you create a for loop with a changeable number of iterations?

How do you iterate through a loop n amount of times when n is specified by the user at the beginning? I have written a shell script and need to repeat a certain part of it n numbers of times ...
1
vote
1answer
36 views

cryptsetup: Attaching loopback device failed

I am using cryptsetup with detached header. For that I am using the --header parameter, to specify header file. I can open my device using: cryptsetup luksOpen /dev/sdb1 sdb1 --header LUKS-HEADER ...
1
vote
0answers
40 views

Creating a sparse (automatically expanding and contracting) swap file with hole-punching support

I have this crazy idea, and want to know the pitfalls of such an approach (or whether it can even work with no deadlocks.. etc). The goal is to create an automatically expanding and contracting ...
1
vote
1answer
89 views

Breaking out of while loop with a switch case inside

I am having an issue with exiting a bash script out of a while loop: while read -r dir event name; do case $event in OPEN) chown $VHOST:$VHOST $WEBPATH/$name; echo "The file \"$name\" ...
0
votes
0answers
41 views

Make whiptail work in a for loop

This is my first question ever here... So please be gentle :) I have a bash script that checks ping for 163 sites(stores around the country), which is this: #!/bin/bash #storestest.sh #version 0.9.2 ...
0
votes
1answer
38 views

Decrypting a previously create losetup device

I've created an encrypted backup in 2004, using losetup -e. I still know the passphrase, so I should be fine, but losetup is gone in the linux distributions I use. I still have a bash script for ...
1
vote
0answers
7 views

Is it safe to modify underlying file if it's mounted by losetup?

I've got a raw binary file and I need to access it (read-only) as a block device, for compatibility reasons. I mount this file through losetup eg. losetup /dev/loop0 file.bin. The block device is only ...
0
votes
1answer
14 views

Creating a function that reads off an input list of files

I am new to UNIX/Linux and am in the process of writing bioinformatics pipelines. These pipelines take in input files and pass them through multiple packages. Say there is a list of files that goes ...
2
votes
5answers
77 views

Looping through a file using a column

I am trying to loop through a file named file.txt that contains a bunch of junk and one column (column #4) I am interested in. I want this loop to run from 0 to eof. For each value in column 4, I want ...
0
votes
1answer
45 views

Bash For Loop - prompt for IP range and password

I have a simple for loop one liner I use to check for things across a number of servers that have the same password set. I want to develop this one liner into a script that logs into a cluster of ...
2
votes
1answer
26 views

combining output from different scripts into different files in a loop

First of all: I hope the question is comprehensible, otherwise please let me know and I will do my best to make it more clear. This is a follow up to Replace one entire column in one file with a ...
2
votes
2answers
30 views

bash: how to add assigned value to file

I have bash script looping through several files in a directory. The file identifier has been saved as a variable $num. What I would like to do is add $num as another column in my data like in the ...
3
votes
1answer
41 views

Get target device by /dev/dm-X entry

I have to map several loopback devices via dmsetup. I could track which loopback device is mapped to a particular /dev/dm-X device file, but is there an easy way to get this info by the /dev/dm-X ...
2
votes
0answers
112 views

Unable to mount secondary HDD on CentOS 6.7 (Must specify file system?)

I have a secondary HDD that worked fine in Ubuntu 13.04. I had mounted in to /media/user/<some UUID>/. I could read and write files without problem. My Ubuntu installation was on a primary SSD. ...
0
votes
1answer
45 views

How to copy/burn a loop device image to a partition?

I'm building a rootfs for a embedded device. I start by making an empty loopback file system, then mount it, and add files to it. When I finish, I end up with a file system image. Then I can burn ...
0
votes
1answer
113 views

What is the difference between loop device and block device? [closed]

I want to create a loop device myself, I want it to have a special name, say /dev/loop-test-0. I want it to be up after I reboot the machine. I though that I can use mknod for this, but this doesn't ...
4
votes
3answers
434 views

Bash script: do something one time inside a loop then stop, but continue looping

I have a Bash script that checks my laptop battery and sends me an Android notification (via shuttle, a Bash script I wrote that serves as a cli interface for the Pushbullet API). It works nicely, but ...
0
votes
2answers
209 views

breaking out of command loop but exit code not the reason?

I run the following: echo "while emacs;do echo $?;done;echo Exit code: $?;" | bash If I exit emacs through the menu or the close button, it prints exit code 0 and restarts. If I exit emacs through ...
0
votes
1answer
43 views

How can I loggin from VM1 to VM2 using script?

I am using script to loggin my VM2 from VM1 (Password of the VM2: fifa): for i in {a..z}{a..z}{a..z}{a..z} do # $i as a password ssh root@ipaddress read i echo $i done bit it doesn't work. ...
1
vote
1answer
52 views

How to troubleshoot disk controller on Illumos based systems?

I am using OmniOS which is based off of Illumos. I have a ZFS pool of two SSD's that are mirrored; the pool, known as data is reporting its %b as 100; below is iostat -xn: r/s w/s kr/s kw/s ...
7
votes
4answers
568 views

How to atomically allocate a loop device?

I am writing some shell scripts to handle some disk image stuff, and I need to use loop devices to access some disk images. However, I am not sure how to properly allocate a loop device without ...
0
votes
2answers
78 views

Variable in for loop to be used as an array for a csv output

I've been struggling to come up with a solution for this, the goal is to organize the results into comma separated columns as we have to recable our entire datacenter from cat6 to cat6a. $DBFILE ...
0
votes
0answers
100 views

Running FFmpeg in While Loop

Here is my problem. I want to run many different multiple ffmpeg instances all in background and all in while true loop. I tried the following command but does not even work: (while true; do ...
1
vote
2answers
253 views

How do users mount .bin/.cue or .iso with loopback device as read only?

Can users mount any of the following image files as read-only using a loopback device? If it is possible then can anyone give me examples?
1
vote
1answer
343 views

Installing Arch Linux on an SSD

I'm making my way through this: https://wiki.archlinux.org/index.php/Beginners%27_guide I've done this successfully a couple of times when working with conventional HDDs but I've recently bought and ...
1
vote
1answer
107 views

BASH: looping through ls [duplicate]

I'm having trouble with this piece of code: 22 for filename in "$( ls "$1" | grep ".*\.flac$" )"; do 23 file_path="$1${filename}" 24 ffmpeg -i "${file_path}" -f ...
0
votes
0answers
109 views

SED: print entire paragraph for specific pattern while loop

I find partial answer about my problem on this question but i still have trouble. I need to use a variable as a pattern for the sed command in a loop sed -e '/./{H;$!d;}' -e 'x;/'$var'/!d;' The ...
3
votes
2answers
617 views

Generating a .img from tarball: The /dev/loop devices

I'm trying to make a .img from a tarball using the following script I found: #!/bin/bash # Packages required # dosfstools parted # Can be run on any Linux system # loop.max_part=15 must be in ...
0
votes
0answers
65 views

FTDI FT2232H time setting

I used FTDI FT2232H in MPSSE mode, running it at 30MHz(maximum speed) clock rate and Latency Timer is 255, I have downloaded libraries from below link and compiled with my App. code: ...
3
votes
3answers
210 views

Create Linux distro with minimal number of files

I'm thinking about designing a system for a project using some single-board computer (RaspberryPi, CubieTruck etc) that runs Linux. My main requirement is keeping the complexity of the booted SD card ...
1
vote
4answers
756 views

Executing a command within `if` statement and on success perform further steps

I was trying to execute a program which will create a directory on the basis of a complete path provided to it from the prompt and, if the directory already exists it will return an error (for ...
3
votes
1answer
193 views

How to find which images belong to which /dev/loop?

I work a lot with imaged drives, meaning a do a dd-copy of the drive in question and then work on the image instead of the drive itself. For most work, I use kpartx to map the drive's partitions to a ...
1
vote
0answers
210 views

Loopback (bind) mount automatically mounting additional ext4 USB drive

I have a USB (ext4) drive connected and it's registered in /etc/fstab. It mounts at /media/Backup fine. I want to mount a specific directory on that drive using a bind / loopback mount (this is ...
1
vote
0answers
246 views

UDEV rule to run partprobe on loop device

I use udisks2 to mount raw image over a loop device: udisksctl -f image.img --no-user-interaction Policykit is configured, so no errors here. For some reason kernel does not want to re-read ...
1
vote
0answers
156 views

passing variable through cat EOF command with for loop

How do I get the script run with the sbatch command to run with the 23 individual run_prep_chem_$dd.sh (i.e. run_prep_chem_08.sh...run_prep_chem_30.sh)? I am thinking since its in this for loop that ...
3
votes
2answers
4k views

Mount an ISO virtually using /dev/sr0 device

I'm doing a study about how CD-ROM can be mounted virtually and all I could find out was mounting using loop devices. mount -o loop disk1.iso /mount-point This is fairly easy. I understand that ...
1
vote
1answer
142 views

Can't losetup anything on armhf NAS

I'm pretty new to linux and chrooted my NAS with armhf architecture and tried looping device: losetup -f losetup: Could not find any loop device. Maybe this kernel does not know about the loop ...
0
votes
3answers
296 views

How does cfdisk fix my disk image?

I'm working on a huge complex application. You connect a disk, press a button, and it partitions and formats the disk, mounts it, and copies some files onto it. To test this application, we have a ...
3
votes
0answers
40 views

Provide loop device functionality for a regular file under a unique name

I want to add a few image files with file systems to a LVM volume group. If I make them available as loop devices changes are pretty high that one day the script gets corrupted due to an increasing ...
3
votes
2answers
366 views

Source path of loop-device

Out of curiosity, I would like to know is there any way to find out the source of mounted partition ? e.g. Output of df -h is : /dev/loop1 3M 3M 0 100% /media/loop From this output, I know a ...
2
votes
1answer
430 views

How to find alternative superblocks in ext3 file system of partition-less qcow2?

I have an interesting case, where e2fsck refuses to recognize the file system inside a qcow2 image file. Using testdisk I am able to see the partition, so some markers would be left. The reason this ...
2
votes
1answer
390 views

mapping a split file to /dev/loop0

I have a iscsi disk 2TB large. I make backup of that disk every week. The backup script copies the image of the whole iscsi disk into a file on my NFS. Unfortunately, it does not copy the image in one ...
2
votes
1answer
889 views

Problem creating raw disk image and mounting it in rescue mode to QEMU

I am trying to create booting system from raw disk image. This is what I do: $ dd if=/dev/zero of=system2.img bs=1M count=6000 6000+0 records in 6000+0 records out 6291456000 bytes (6.3 GB) copied, ...
1
vote
3answers
969 views

how to pipe the output of cut to the foreach command?

I have the cut command I want that grabs the first word in each line of a file. I then want to put each word from the cut command into a foreach. I then want to do a grep command inside the body of ...
1
vote
1answer
1k views

Mount image user-readable with udisks2

Loop devices, i.e. for mounting raw disk images, can be managed without root privileges using udisks. For testing purposes, an image can be created and formatted like so: dd if=/dev/urandom ...
0
votes
0answers
328 views

different loopback mounted volumes exported through NFS are seen as 1 by the client

I have a rather peculiar problem. I'm running 3.2.0-58-generic #88-Ubuntu (Ubuntu 12.04) and I have mouonted the following loopback devices: cat /proc/mounts | grep loop /dev/loop0 ...
2
votes
1answer
831 views

unetbootin: cannot mount squashfs on loop device

Im having a bit of fun with unetbootin with linux mint 16 setup in it. However when I try run the default menu item I get an error that ends with this: can not mount /dev/loop0 ...
4
votes
1answer
275 views

File containing ext filesystem

Let's suppose I create a file, map it to /dev/loop0, and create a LUKS partition inside dd if=/dev/zero of=myfile bs=1M count=1000 losetup /dev/loop0 myfile cryptsetup -c aes-cbc-essiv:sha256 -s 256 ...