Questions tagged [disk-image]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
40
votes
4answers
101k views

How to mount a disk image from the command line?

I know how to mount a drive that has a corresponding device file in /dev, but I don't know how to do this for a disk image that does not represent a physical device and does not have an analogue in /...
28
votes
1answer
94k views

Booting a raw disk image in QEMU

I have a disk image file from here; that page says I can boot this image with QEMU and the following command: $ qemu-system-x86_64 -m 4096 -ctrl-grab -no-reboot x86-64.img That gives a message: ...
22
votes
2answers
12k views

Is it better to use cat, dd, pv or another procedure to copy a CD/DVD?

Background I'm copying some data CDs/DVDs to ISO files to use them later without the need of them in the drive. I'm looking on the Net for procedures and I found a lot: Use of cat to copy a medium: ...
20
votes
2answers
3k views

Zipped hard drive image very big

I just made an image of a freshly installed dual boot (Ubuntu and Windows) using this command (which I've been using for a while for smaller images): dd if=/dev/sda | gzip > /mnt/drive.img.gz On ...
18
votes
1answer
3k views

Why does piping `tar` into `dd` not stop until the disk is full?

I have a tar archive of a single disk image. The image inside this tar file is about 4GB in size. I pipe the output of tar xf into dd to write the disk image to an SD card. The diskdump never stops ...
13
votes
2answers
3k views

How to convince tar (etc.) to archive block device contents?

I have six Linux logical volumes that together back a virtual machine. The VM is currently shutdown, so its easy to take consistent images of them. I'd like to pack all six images together in an ...
13
votes
2answers
2k views

How do I install syslinux/extlinux to a disk image file without requiring root privileges

I have built a home-grown Linux distribution, and I can make the complete disk image file as a non-root user with one exception -- installing the boot loader. I'm using syslinux (actually extlinux), ...
12
votes
5answers
21k views

How to format a partition inside of an img file?

I created an img file via the following command: dd if=/dev/zero bs=2M count=200 > binary.img It's just a file with zeroes, but I can use it in fdisk and create a partition table: # fdisk binary....
12
votes
5answers
2k views

Is it safe to take the drive image of the current working drive?

I have to backup my hard disk. I want to use dd and put the image on an external hdd. Can I do this using dd from the OS that resides on the hdd itself or do I have to boot from another device, for ...
9
votes
2answers
10k 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 ...
8
votes
3answers
22k views

Getting the extra GPT info; a “fdisk -l” equivalent

What is the equivalent for GPT using HDDs of: # fdisk -l /dev/hda > /mnt/sda1/hda_fdisk.info I got this from https://wiki.archlinux.org/index.php/disk_cloning (under "Create disk image") for ...
7
votes
2answers
2k views

Transferring content of block devices

For the purpose of backups, I'd like to transfer (several) whole disk partitions over an ssh link. The source is a block special device and the target should be a regular file. Common tools seem ill-...
7
votes
2answers
23k views

How can I migrate a Linux installation from HDD to SSD?

I have some normal x86_64 desktop Linux installed in a single ext4 root partition† on some 500GB HDD. Now if I want to migrate this installation to a 500GB SSD (rest of the system stays the same), do ...
7
votes
2answers
4k views

Enlarge a filesystem image

I was doing dpkg --configure -a in my Debian wheezy. And got this error: dpkg --configure -a dpkg: failed to write status record about `libcairo2' to `/var/lib/dpkg/status': No space left on device ...
6
votes
3answers
1k views

With the command pv it is possible to clone a drive, how do I mount it? [duplicate]

I was able to backup a drive using the following command. pv -EE /dev/sda > disk-image.img This is all well and good, but now I have no way of seeing the files unless I use this command pv disk-...
5
votes
3answers
3k views

How to extract the linux version from a `.img` backup?

In short: How to extract the VERSION, SUBVERSION and PATCHLEVEl numbers from a system backup .img? ideally without root permissions. Extended: From the following page: https://www.raspberrypi.org/...
5
votes
2answers
3k views

Accidentally removed a libvirt image file, can I recreate it?

I accidentally removed the wrong image file in my /var/lib/libvirt/images directory. I'm not sure how to recreate one or to undo my removal. Any hints?
5
votes
1answer
208 views

Clonezilla made a smaller image than actual drive size

I've jut got a new laptop with a 500GB SSD. The first thing that I've wanted to do is cloning the hard drive because I want to have an original copy of the entire system as is. In order to do that I'...
5
votes
2answers
637 views

btrfs filesystem end offset (image size)

I have a btrfs filesystem of about 7G in a 10G image file img.btrfs (I shrank it using btrfs fi resize -3G /mnt). How can I find the total size (end byte offset) of the filesystem, so that I can ...
5
votes
2answers
5k views

Backup of a ubi file system with dd?

A have a root file system (file system - image containinf folder structure and content) on a flash drive. The flash drive uses UBI as the underlying file system file system - the way the data blocks ...
5
votes
1answer
5k views

Edit file on image created with dd [duplicate]

I've a bootable USB with Debian. Normally I clone the disk with dd, write the image on a new USB disk, mount this disk on my filesystem and edit some files. Is it possible to edit files on the image ...
4
votes
4answers
4k views

Best compression tool for full disk imaging that can saturate a USB 3 connection on low-powered machines?

I often work on full disk images, I often need to read and write full disk images on not so capable laptops using a USB-3 disk as my temporary medium. Duplicating a raw image is probably the fastest ...
4
votes
1answer
3k views

How can I extract files from a disk image without mounting it?

Say I have a disk image (possibly partitioned) that I have permission to read. However, I don't have permission to mount it via loopback*. In theory, the data is all there; I could write code that ...
4
votes
2answers
2k views

How to verify that rsync copied the device correctly when copy-devices is enabled?

This is an extension to Why rsync attempts to copy file that is already up-to-date? I'm attempting to use the --copy-devices patch to rsync to copy an entire disk drive and store it as an image on ...
4
votes
2answers
3k views

Running QEMU with a root file system directory instead of disk image

In order to test the root file system i need to run QEMU with created disk image as root file system, the QEMU accepts -kernel which can be used for specifying kernel directly without deploying it ...
4
votes
1answer
1k views

Why is my rsync slow?

I run a rsync job transferring about 45 million files/approximately 1.8 TB data (a Mac OS X Time Machine backup) over a 100 MBit connection. I use rsync 3.1.1 from MacPorts (I first tried the built ...
4
votes
1answer
755 views

“Can't have a partition outside the disk!” for vdi created from a truncated image

I have used dd to create a partial/truncated image of a disk which only includes allocated spaces, then converted it to a vdi file for VirtualBox. I have successfully used the vdi image to run the ...
4
votes
1answer
1k views

how to clone images of drives with LUKS+LVM2?

I have 2 Debian boxes which I need to upgrade. In the past, before upgrading any box, I have used Clonezilla to create an image of each of the box's harddrives for use as disaster backup, in case ...
4
votes
1answer
1k views

Is `UDIF read/write image` bootable on non-Apple hardware?

Some guides on the internet suggest that it is possible to convert ISO disc image files (.iso) into an non-.iso image format (.img or .dmg) with hdiutil on OS X. However, the manual page for hdiutil ...
4
votes
2answers
614 views

Mounting a disk image split up into two files

If I had a four gigabyte disk image, and I copied the first, say, two gigs, into a file at one path, and the remaining two gigs into a file at a different path, could I mount it as one disk image on ...
4
votes
0answers
994 views

bootable live usb doesn't boot, KNOPPIX

I have been trying to make a bootable live USB of KNOPPIX. I downloaded the .iso image, checked the sha1sum with the one that was given and it was all correct. Then tried both the options, using cp as ...
3
votes
2answers
2k views

Create filesystem in regular file using FreeBSD

When using Linux, one can easily create a regular file of some size and then create a filesystem in it. How can one do the same thing when using FreeBSD? I tried this: root@:/tmp/test # newfs -U ~/...
3
votes
2answers
2k 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 ...
3
votes
1answer
2k views

Program for two-way synchronization of big files (VM disk images)

I heavily use virtual machines in my work and I need an efficient way of synchronizing them between my PCs. I know of bigsync, but this program works well only for one-way synchronizing (like rsync)....
3
votes
2answers
275 views

Is it safe to share a KVM virtual disk between active / passive systems

I have two VMs that run a DB2 database under a Linux guest OS. Only one database will be active at a time, though I'd like both VMs to be running at the same time. The database would be stored on a ...
3
votes
1answer
1k views

How to clone an entire disk to a larger disk and then offload?

What I have done is clone a small 32GB flash module that had three partitions. I happened to have a 32GB USB lying around, so I thought it might just work; it did not. It seems 32GB from Toshiba is a ...
3
votes
1answer
970 views

Generating SD Card image for RPi

I'm using buildroot to generate a Linux system for RPi. As output I get rootfs.tar and zImage. From that output (and some other files) I would like to generate a ready SD card image so it can be ...
3
votes
2answers
978 views

How to copy to a formatted image without root privileges?

I have formatted an image file using the mkfs command, and I would now like to copy files to that image file without root privileges. I have already tried to mount the image to a local directory, ...
3
votes
1answer
185 views

How to create a consistent forensic image from a live RHEL system?

In our environment we have RHEL7 systems that need to be always up and running. I know the preferred method of acquiring a forensic image is to take the system offline, but in case of a live image, ...
3
votes
1answer
1k views

Cannot mount partition made on loop device (which is pointing to a file)

Goal I'm trying to make a harddisk image from scratch using a file. This includes MBR, partition table, number of partitions, etc. I cannot for the life of me get Linux to mount the partitions I make ...
3
votes
3answers
371 views

Creating recovarable disk image [closed]

Laptop I want to buy comes with preinstalled windows 10. I want to install linux on this laptop but I want to have option to recover windows (reset to factory settings). Because of that I want to make ...
3
votes
1answer
613 views

Creating a DMG file on Gentoo

I'm trying to create a Mac OS DMG image file on Gentoo - I managed to create the FS using mkfs.hfsplus and just dropping all the contents into the mounted file system, and everything works fine.. the ...
2
votes
3answers
1k views

dd crashing - what to do about it

I have dd crashing after running a few hours. Typically with a message like Input/output error 68424+1 records in 68424+1 records out 342124883968 bytes (342 GB) copied, 5114.68 s, 66.9 MB/s Is ...
2
votes
3answers
979 views

Work with compressed dd images

How can I compress dd images and work with them at the same time? On Windows, I can mark it as compressed and work with it like a normal file. I can't re-partition, but I can mount some drives (For ...
2
votes
1answer
54 views

How to copy a disk drive over network to another computer (create and use such disk image)?

I originally have thought, that I would just use scp to copy my laptop disk drive onto server array for backup purposes. As it turned out, it may not be possible (not a regular file), or I just might ...
2
votes
1answer
1k views

Why does SHA 256 sum change when writing image to a drive?

I've noticed that if I write an image via dd to a USB drive and then sha256sum that image; the sum changes. Why? It's never identical to that of the ISO. I am running: sha256sum /dev/sdb (on the ...
2
votes
1answer
70 views

How can I mount a dd clone of a btrfs disk?

I cloned a harddisk with btrfs with dd. Now I want to mount the cloned drive, while the "original" is still mounted: mount /dev/sdc /mnt/tmp mount: /mnt/tmp: mount(2) system call failed: File exists. ...
2
votes
2answers
105 views

How can I safely write a disk image to a memory card?

I routinely copy disk images to SD cards for use on a Raspberry Pi. The usual way I do this is by dd if=/tmp/filesystem.img of=/dev/sdb, which is only a minor typo away from over-writing my computer'...
2
votes
1answer
259 views

ddrescue image differs in size

I have 40gb image split into 10 4gb files, then combined with dm-linear to create single 40gb drive. One file got damaged single 4kb sector. However when I'm copying data unsing either dd or ddrescue ...
2
votes
1answer
8k views

What is mintstick.py and how to install it?

In Linux Mint, unlike in Ubuntu, I see two separate launchers to handle USB sticks, one only for formatting, the other for writing image files to the USB stick. In the task manager I see in fact ...