How to mount/access a single partition from dd image with Linux


 parted sdc.img
GNU Parted 1.8.8
Using /home/one/sdc.img
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit                                                            
Unit?  [compact]? B                                                      
(parted) print                                                           
Model:  (file)
Disk /home/one/sdc.img: 32085377024B
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start     End           Size          Type     File system  Flags   
 1      4194304B  32085377023B  32081182720B  primary  fat32        boot, lba

 

  1. The key things above are to change the unit to bytes
  2. Divide the bytes of the starting point of your partition by 512 (because that's how many bytes per sector you get normally when dding a device)

With dd set the blocksize: bs=512 (since our blocksize with this image is 512).  The count will be the size 32081182720 bytes/4= 32081182720

So 4194304 bytes/512=8192 (is our start or skip=8192 with dd)

dd if=sdc.img skip=8192 bs=512 count=8020295680 of=sdc1.img

After that it's a matter of mounting it:

mount -o loop sdc1.img mountlocation


Tags:

mount, partition, dd, linux, parted, sdc, img, gnu, commands, compact, disk, sector, msdos, flags, primary, lba, bytes, divide, dding, blocksize, bs, mounting, mountlocation,

Latest Articles

  • Cisco Switches How To Get Of Port Line Status Console Messages
  • Cisco DHCP Snooping Relay Setup Information
  • Cisco Switch Setup Guide Command List
  • Cisco 2960 Switch Reset To Factory Defaults
  • How To Boot Cisco CUCM UCSInstall 8.6, 10, 11 and 12 on KVM/Proxmox
  • VBOX VirtualBox How To Import Raw .img Disk File
  • Windows Server 2012, 2016, 2019 How To Install and Missing Disabled Telnet Client
  • proxmox vm networking breaks when you restart your network on the hostnode
  • Linux ln symlink how to update existing symbolic link
  • Ubuntu 18.04 / Linux Mint 19.1 Cannot Type or Login - solution
  • LUKS Hard Drive Encryption on Linux Mint Ubuntu Debian etc how to mount encrypted hard drive
  • How to use nmap locate other machines/computers/servers on your network using nmap
  • Linux Mint 18.2 Create Config File To Start Application Upon Login
  • Dell Wyse Thin Client BIOS Access Key
  • sudoers file in /etc warning about comments/includes!
  • Centos 7 Reallocate logical volume space to another
  • lvm how to reduce volume size
  • letsencrypt certbot error "Unable to find a virtual host listening on port 80 which is currently needed for Certbot to prove to the CA that you control your domain. Please add a virtual host for port 80."
  • SSH error cannot Forward or Listen "bind: Cannot assign requested address"
  • X11 SSH Linux Forwarding Error