Linux - mount dd raw img with partitions

Linux - mount dd raw img with partitions

Hi, I made a backup of the whole disk including partitions via DD using this tutorial

https://cloud.up4.cz/it/linux-priklady-zalohovani-rsync-tar-rdiff-backup-dd-ftp-ssh-mysql

and when I try to mount it throws me an error:

root@13F4dsf:/ mount /tmp/dd/sda.img /mnt/b

mount: /mnt/b: wrong fs type, bad option, bad superblock on /dev/loop2, missing codepage or helper program, or other error.


What with this? Probably not quite simply the img with partitions mount mount to any directory classic, right? Is it possible? Thanks


REPLY


Hi,

mount image created via dd must be done using offset settings for the partition:

1.) If img is compressed, first extract it.

2.) Then find out the partition layout for offset setting:
fdisk -lu /home/dd/sda.img

Disk /home/dd/sda.img: 119,2 GiB, 128035676160 bytes, 250069680 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 8C4FE13B-79EF-457F-94DB-E07712A77D3F

Device Start End Sectors Size Type
/home/dd/sda.img1 2048 1050623 1048576 512M EFI System
/home/dd/sda.img2 1050624 2549759 1499136 732M Linux filesystem
/home/dd/sda.img3 2549760 250068991 247519232 118G Linux filesystem



3.) Mount partition - calculate offset from output fdisk for given partition = 2549760 * 512 = 1305477120
And then mount:
mount -o loop,offset=1305477120 /home/dd/sda.img /mnt/b

Související obsah

linux

bash

terminal

dd

mount

image

Komentáře

Vaše reakce na Linux - jak provést mount image s oddíly (mount dd raw img)

Reference

Podívejte se na naše reference

Prohlédnout

Aplikace

Podívejte se na naše aplikace

Prohlédnout

Co umíme?

Podívejte se co umíme

Prohlédnout

Co umíme?

Vytváříme sofistikované aplikace pro náročné

Od webových aplikací přes android až po převodové můstky či složité informační systémy.

Podívejte se k nám

Máte ještě čas? Podívejte se na další rubriky

Tento web používá soubory cookie. Dalším procházením tohoto webu vyjadřujete souhlas s jejich používáním.. Více informací zde.