From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1JGsQi-0000Di-00 for garchives@archives.gentoo.org; Mon, 21 Jan 2008 08:54:56 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9B00AE05FC; Mon, 21 Jan 2008 08:54:54 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 519A3E05FC for ; Mon, 21 Jan 2008 08:54:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 93AB365820 for ; Mon, 21 Jan 2008 08:54:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at gentoo.org X-Spam-Score: -1.464 X-Spam-Level: X-Spam-Status: No, score=-1.464 required=5.5 tests=[AWL=1.135, BAYES_00=-2.599] Received: from smtp.gentoo.org ([127.0.0.1]) by localhost (smtp.gentoo.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eOewGV+CphoM for ; Mon, 21 Jan 2008 08:54:44 +0000 (UTC) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTP id A3A2F64C6C for ; Mon, 21 Jan 2008 08:54:43 +0000 (UTC) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1JGsQQ-0000IC-PI for gentoo-user@gentoo.org; Mon, 21 Jan 2008 08:54:38 +0000 Received: from blueboticspc1.epfl.ch ([128.179.67.27]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 21 Jan 2008 08:54:38 +0000 Received: from remy.blank by blueboticspc1.epfl.ch with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 21 Jan 2008 08:54:38 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: gentoo-user@lists.gentoo.org From: Remy Blank Subject: [gentoo-user] Re: "loopback mount" hard-drive image created with dd? Date: Mon, 21 Jan 2008 09:54:31 +0100 Message-ID: References: <6155E8C0-9F4B-446D-BE24-EAC2BCEC82D5@stellar.eclipse.co.uk> <20080118090425.GF11901@chateau.d.lf> <87y7anurgs.fsf@chateau.d.lf> <20080118184719.GB32256@yarmook.hjz> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig68D74151E5CC632DCDE003F8" X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: blueboticspc1.epfl.ch User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.0 In-Reply-To: <20080118184719.GB32256@yarmook.hjz> X-Enigmail-Version: 0.95.6 Sender: news X-Archives-Salt: c24d25d1-c17e-4fd9-b70c-d8e59883cd81 X-Archives-Hash: 0893dade8865c14b3a02c15e3c527259 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig68D74151E5CC632DCDE003F8 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Yahya Mohammad wrote: > # losetup /dev/loop0 /path/to/diskimage > # fdisk -l /dev/loop0 > (example) > Disk /dev/sdb: 160.0 GB, 160041885696 bytes > 255 heads, 63 sectors/track, 19457 cylinders > Units =3D cylinders of 16065 * 512 =3D 8225280 bytes >=20 > Device Boot Start End Blocks Id System > /dev/sdb1 * 1 1044 8385898+ c W95 FAT32 (LBA)= > /dev/sdb2 1045 19457 147902422+ 83 Linux Thanks for the tip! I didn't know you could mount a whole disk image as=20 loopback, and see the partition table with fdisk. I always printed the=20 partition table before making the disk image. > I second that, I'm curious to know if it works It does, I have done it before, but there's a special case for the first = partition of the disk. According to your output of fdisk, it is supposed = to start at cylinder 1. However, if you run fdisk with the -u option=20 (giving the positions and sizes in sectors), you get the following: (example) # fdisk -lu /dev/loop0 Disk /dev/loop0: 10.0 GB, 10056130560 bytes 240 heads, 63 sectors/track, 1299 cylinders, total 19640880 sectors Units =3D sectors of 1 * 512 =3D 512 bytes Disk identifier: 0xc1afc1af Device Boot Start End Blocks Id System /dev/loop0p1 * 63 4097519 2048728+ b W95 FAT32 /dev/loop0p2 4097520 8195039 2048760 5 Extended /dev/loop0p5 4097583 8195039 2048728+ b W95 FAT32 That is, the first partition starts at sector 63, i.e. at an offset=20 value of 63 * 512 =3D 32256. > oh, and make a backup just in case :) And mount the filesystem read-only with the "ro" mount option. -- Remy --------------enig68D74151E5CC632DCDE003F8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (MingW32) iD8DBQFHlF3HCeNfIyhvXjIRAkEMAJ9lklkakn66jhqIiXxO6EPY/Gh8jACeMHgz HgxpYpu2VT+VArOZf5jsoEM= =n+yU -----END PGP SIGNATURE----- --------------enig68D74151E5CC632DCDE003F8-- -- gentoo-user@lists.gentoo.org mailing list