LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-30-2016, 09:05 PM   #1
tekra
Member
 
Registered: Aug 2010
Location: Brisbane, Australia
Distribution: Gentoo, Slackware, PCLOS, Debian
Posts: 230
Blog Entries: 2

Rep: Reputation: 50
How to mount partitions in an image mounted on the loop device.


I'm long accustomed to mounting ISOs on the loop device as a convenient way of examining and modifying them. I'm now faced with the next step.

I downloaded the latest Raspian image for my Rpi - 1.3GB - then dd'd it to an SD card which booted badly. It contains two partitions, the FAT boot and the EXT4 OS. I'd like to examine the image, maybe even copy out the OS partition whilst leaving the boot partition alone, but this is a step I've not tried before. My first attempts failed - does the system recognize such device names as loop01 and loop02 for the partitions on loop0? Dunno.

Does anyone know how to do this?
 
Old 07-30-2016, 10:53 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,119

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
partx or losetup - the latter manpage has an example just for you
 
1 members found this post helpful.
Old 07-30-2016, 11:19 PM   #3
Doug G
Member
 
Registered: Jul 2013
Posts: 749

Rep: Reputation: Disabled
run fdisk on the image to find the starting block of the partition you want to mount within the image. Then use mount with -o loop,offset=< your blocksize*startblock >

Make sure you unmount the inner partition before unmounting the outer .iso

This works for me on fedora/centos.
 
1 members found this post helpful.
Old 07-31-2016, 02:56 PM   #4
tekra
Member
 
Registered: Aug 2010
Location: Brisbane, Australia
Distribution: Gentoo, Slackware, PCLOS, Debian
Posts: 230

Original Poster
Blog Entries: 2

Rep: Reputation: 50
Thanks to both for solutions. Not as hard as I thought!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mounted Loop Device Prevents Proper Shutdown grahamw Linux - General 1 05-05-2011 05:26 PM
Mount problem - device already mounted or mount point busy zahoo Linux - General 7 08-28-2009 05:02 PM
Loop-mount image of harddrive addy86 Linux - General 6 06-14-2005 06:06 AM
Cannot mount more than 8 iso image files as loop device marsim Debian 4 11-09-2004 04:05 AM
Problem mounting CD image (no loop device)... Slayer Linux - General 1 10-05-2003 09:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration