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)

1
vote
0answers
12 views

Prevent loop device partitions from being detected

I'm moving a work project from RHEL 6 (Kernel 2.6.32) to RHEL 7 (Kernel 3.10.0). The project involves the building of a raw disk image files to be used on virtual machines, these are representative ...
0
votes
0answers
5 views

Red Hat Enterprise Linux 6.7: Turning off wi-fi forcefully unmounts a loop drive and crashes a VM

I am running Red Hat Enterprise Linux 6.7 on a Lenovo ThinkPad T430 and I have QEMU-KVM 0.12.1 installed on my computer. I have an external hard drive encrypted with dm-crypt and formatted as Ext4, ...
0
votes
1answer
27 views

Overhead of using loop-mounted images under Linux

Is there a CPU/RAM overhead associated with using loop-mounted images versus using a physical partition under Linux?
0
votes
1answer
40 views

Loops: for vs while… beyond the basics. Subtle differences/pros/cons for my code? [closed]

I have been writing/refining a relatively complex code for the past year, and learning bash along the way. My code is filled with functions that have complex multi-level while loops. I've recently ...
0
votes
0answers
17 views

CentOS7 Livecd login loop after Dracut update to 033-360

I am trying to edit the official CentOS7 livecd build 1406 and after updating Dracut to 033-360 (due to being an nfs-utils dependency) from the original 033-161 I am stuck in a login loop. Further ...
2
votes
1answer
988 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
votes
3answers
42 views

In a bash shell script , how to write a loop that goes trough three values [duplicate]

I'm trying to write a shell script using bash for the following problem: Write a loop to go through three values (A B C) and displays each of these values to the screen (hint use a ‘for’ loop). ...
4
votes
2answers
416 views

What file is mounted on loop0?

Today I noticed that some time in the past I mounted an ISO, but forgot which one it was: /dev/loop0 on /export/production/os/iso/centos/mount type iso9660 (rw) How can I find the exact file name ...
0
votes
3answers
38 views

Can I use variable in a .csv file in the for loop?

I am trying to replace these numbers "A00002 X53307 BB145968 CAA42669 V00181 AH002406 HQ844023" in the following for loop with a new list of numbers. But my new list is a .CSV file and there are ...
0
votes
1answer
35 views

My if bash script always execute the break

I`m making a script to rename files in a folder. The new name for the files is in a config file. I have to be sure that the file I want to rename corresponds to the current one in the config file. My ...
0
votes
1answer
26 views

Loop device support on self compiled kernel doesn't work

I compiled 3.10 kernel, I checked that these configuration lines are not commented CONFIG_BLK_DEV_LOOP=y CONFIG_BLK_DEV_LOOP_MIN_COUNT=8 When i'm trying to mount loop device I get this error # ...
1
vote
1answer
66 views

How to mount qcow2 image

I've read that with qemu-nbd and the network block device kernel module, I can mount a qcow2 image. I haven't seen any tutorials on mounting a qcow2 via a loop device. Is it possible? If not, why? I ...
0
votes
0answers
15 views

Loop through directory and sum value next to specific pattern producing an average

I want to loop through all the files in the directory. the files are set out like this: <Overall>4 other data <Overall>2 other data ...... I have the code: for file in .dat; do awk ...
1
vote
1answer
26 views

Bourne Shell do while loop returns all the data but has two errors no such file or directory and repeats the shell name

The idea of my loop is to print the first digit of every line of a file. The file being this: 256-56-8411 Bob 3.61 Junior CS 471-44-7458 Tim 3.45 Senior CE ...
-6
votes
1answer
38 views

I am facing hoping issue in my script, please help me [closed]

for i in `ls -ltr | grep ' Nov' | awk '{print $NF}'` do for j in `unzip -l $i | grep -i SystemOut | awk '{print $NF}'` do unzip -c $i | grep -i Live | grep 'smarter planet' done ...
1
vote
2answers
85 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 ...
0
votes
1answer
39 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
60 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
359 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 ...
4
votes
1answer
281 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 ...
1
vote
0answers
85 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 ...
4
votes
3answers
7k views

How to add more /dev/loop* devices on Fedora 19

How to add more /dev/loop* devices on Fedora 19? I do: # uname -r 3.11.2-201.fc19.x86_64 # lsmod |grep loop # ls /dev/loop* /dev/loop0 /dev/loop1 /dev/loop2 /dev/loop3 /dev/loop4 /dev/loop5 ...
1
vote
1answer
155 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
1answer
49 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 ...
0
votes
0answers
67 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 ...
1
vote
0answers
11 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 ...
8
votes
4answers
4k views

Mounting multiple img files as single loop device

Is there a way to take a disk img file that is broken up into parts and mount it as a single loop device?
3
votes
5answers
185 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
15 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 ...
0
votes
1answer
75 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
35 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
41 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
51 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
158 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. ...
5
votes
2answers
4k views

Finding the offset for ext4 partition

I've created an image of my hd with dd, but grub was installed on it, and I'm trying to figure out how to mount the image file, but mount doesn't recognise it as an ext4 partition because of the grub ...
12
votes
3answers
3k views

Creating formatted partition from nothing

I need to create filesystem with just one partition from nothing (/dev/zero). I tried this sequence of commands: dd if=/dev/zero of=mountedImage.img bs=512 count=131072 fdisk mountedImage.img n ...
0
votes
1answer
63 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
178 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 ...
2
votes
2answers
2k views

busybox initramfs loop mount

I'm trying to loop mount my root filesystem (a loop file) within a busybox initramfs. I try to run the command: mount /rootfs.raw /root ... which works on my Ubuntu laptop, however, I simply get ...
4
votes
3answers
653 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
345 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 ...
2
votes
2answers
2k views

slitaz 4.0 grub2 loopback concatenate multiple initrd images

I'm trying to get slitaz 4.0 ISO to boot using a grub2 loopback on a multiboot USB; insmod font if loadfont /boot/grub/unicode.pf2 ; then insmod gfxterm # insmod efi_gop # insmod efi_uga ...
2
votes
1answer
894 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 ...
0
votes
1answer
44 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
67 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
719 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
92 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
123 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
304 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
421 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 ...