LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 08-22-2011, 10:04 AM   #1
TJNII
LQ Newbie
 
Registered: Aug 2011
Distribution: Gentoo, Debian, RHEL
Posts: 12

Rep: Reputation: Disabled
Mounting partitions contained within a raw disk image


I am wondering if anyone knows a quick way to mount partitions contained within a raw, complete disk image. (i.e. created by dd -if /dev/sdX) I try to avoid creating these for obvious reasons, but when the situation requires it being able to loop mount partitions within the image would be a handy tool. Since the image is complete and raw it contains the MBR ant partition table, so I cannot just "mount -o loop /file/image /mnt/point" and have it work.

I currently know of two solutions:

1) Pull the partition table out of the image, dd the partition I want to a new file, and mount that. I don't like this option because it requires enough disk to create a whole new file, and requires the copy time to make it.

2) Route the image through AoE so the kernel will create partition devices on the AoE nodes. This works well, but requires AoE support.

Does anyone know of a third option? I'm hoping for an option that creates dev (or comparable) nodes like AoE, but doesn't require looping the data through the network stack.

Last edited by TJNII; 08-22-2011 at 10:21 AM.
 
Old 08-22-2011, 10:39 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,925

Rep: Reputation: 747Reputation: 747Reputation: 747Reputation: 747Reputation: 747Reputation: 747Reputation: 747
Yes by adding an offset option like:
http://wiki.edseek.com/guide:mount_loopback
or
http://madduck.net/blog/2006.10.20:l...-a-disk-image/
 
Old 08-22-2011, 10:53 AM   #3
TJNII
LQ Newbie
 
Registered: Aug 2011
Distribution: Gentoo, Debian, RHEL
Posts: 12

Original Poster
Rep: Reputation: Disabled
That answers the question main question, thanks.

However, it brings another: the madduck.net blog says you can use kpartx for this but doesn't give details. Kpartx didn't have any effect when I tried it, and when I tried fdisk against a loop device node I got an invalid argument error. According to the edseek.com link a discontinued patch is required to make loop devices work this way. Does anyone know how to use kpartx for this on a modern system, or will it no longer work? This is more idle curiosity now as the "mount -o offset" method in the above links will also do what I want.
 
  


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
[SOLVED] partitions within raw image; how to access those? Ramurd Slackware 4 05-13-2011 05:45 AM
Mounting/accessing individual partitions within a dd image? jessica6 Linux - General 5 07-30-2009 05:01 PM
Regarding Creation of Bootable ISO of hard disk image having multiple partitions.. nagamohan_p Programming 1 08-25-2006 09:11 AM
problem mounting a disk image zero79 Debian 2 05-03-2005 02:15 PM
auto mounting of hard disk partitions rm1 Programming 3 11-08-2004 09:04 AM


All times are GMT -5. The time now is 07:43 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration