Questions tagged [disk-image]

239 questions
92
votes
6 answers

Is it possible to mount a gzip compressed dd image on the fly?

I like to create an image backup the first time I'm backing up a system. After this first time I use rsync to do incremental backups. My usual image backup is as follows: Mount and zero out the empty space: dd if=/dev/zero of=temp.dd bs=1M rm…
g19fanatic
  • 1,023
  • 1
  • 9
  • 14
81
votes
4 answers

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 /dev (e.g. an ISO file or a floppy image). I know…
user628544
  • 1,495
  • 2
  • 12
  • 16
59
votes
3 answers

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:…
user129371
43
votes
1 answer

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: WARNING: Image format was not specified for…
cat
  • 3,428
  • 4
  • 22
  • 50
22
votes
5 answers

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.img Device does not contain a recognized partition…
Mikhail Morfikov
  • 10,309
  • 19
  • 69
  • 104
20
votes
2 answers

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 this drive less than 60G out of 500G are used.…
chris137
  • 321
  • 2
  • 6
18
votes
2 answers

How do I uncompress a file with lots of zeroes as a sparse file?

I have a compressed raw image of a very large hard drive created using cat /dev/sdx | xz > image.xz. However, the free space in the drive was zeroed before this operation, and the image consists mostly of zero bytes. What's the easiest way to…
18
votes
1 answer

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 until the card is full. Here is my shell session:…
con-f-use
  • 423
  • 4
  • 11
17
votes
2 answers

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 device under /dev/mapper/. What I'm wondering…
bos
  • 867
  • 2
  • 9
  • 14
14
votes
3 answers

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 archive. Trivially, I could do something like this: cp…
derobert
  • 107,579
  • 20
  • 231
  • 279
13
votes
2 answers

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), and to install it I have to loop-back mount the…
Patrick
  • 296
  • 1
  • 7
12
votes
5 answers

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 example a LiveCD? Is it safe, in general, to take…
Marco Sulla
  • 594
  • 4
  • 22
11
votes
2 answers

Create an image of the partition (only the used space)

I have a partition sdb1 of size 3.3 GB. From 3.3 GB only 1.9 GB is used and 1.2 GB is an empty space. I want to create an image of this partition. But I want the image to only have the used space i.e. 1.9 GB Now when I run a command using dd: dd…
Sharvin26
  • 287
  • 1
  • 2
  • 11
10
votes
2 answers

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 resembles the Linux kernel's, partition editors and…
detly
  • 5,020
  • 6
  • 23
  • 29
9
votes
2 answers

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 I am chrooted into a .img file. What can I do?
JohnnyBoy
  • 160
  • 1
  • 6
1
2 3
15 16