From mboxrd@z Thu Jan 1 00:00:00 1970 From: mr.zoltan.gyarmati@gmail.com (Zoltan Gyarmati) Date: Mon, 04 Feb 2013 15:24:26 +0100 Subject: open image file In-Reply-To: <283ab658-1a16-49a3-ad9b-b04200dd47c4@email.android.com> References: <20130203020300.GA2454@debian.localdomain> <510E7191.1050103@gmail.com> <283ab658-1a16-49a3-ad9b-b04200dd47c4@email.android.com> Message-ID: <510FC49A.6060705@gmail.com> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On 02/04/2013 03:03 PM, Greg Freemyer wrote: > > Zoltan Gyarmati wrote: > > >> Hi, >> >> in case of image with multiple partitions, easier to use kpartx, then >> get the offsets with parted: >> http://ppadala.net/blog/2010/09/kpartx-to-mount-vm-disk-images/ >> >> of course with image with one partition, it doesn't matter > I think you meant an image of a drive with no partitions: > > Ie. > mkfs /dev/sdb. Create a filesystem on the entire disk, there is no offset and no partitions (the entire disk is the filesystem, no mbr or gpt). > > mkfs /dev/sdb1. Create a filesystem on the first partition, there is an offset even if it is the only partition. You examine the mbr or gpt to determine the offset. > > Or possibly you meant an image of a partition: > > dd if=/dev/sdb1 of=image_file. Create the image of a partition, no offset needed for loopback mount. > > Greg > Indeed! I was not accurate enough, thx for the comment. -- br, Zoltan Gyarmati mail: mr.zoltan.gyarmati at gmail.com freenode nick: zgyarmati