From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CBL7u-0002tF-8y for qemu-devel@nongnu.org; Sat, 25 Sep 2004 18:34:46 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CBL7s-0002s1-RR for qemu-devel@nongnu.org; Sat, 25 Sep 2004 18:34:45 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CBL7s-0002rx-Ot for qemu-devel@nongnu.org; Sat, 25 Sep 2004 18:34:44 -0400 Received: from [81.209.184.159] (helo=dd2718.kasserver.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CBL1V-0000Ac-Dk for qemu-devel@nongnu.org; Sat, 25 Sep 2004 18:28:09 -0400 Message-ID: <4155F0ED.7050401@fabianowski.de> Date: Sun, 26 Sep 2004 00:27:57 +0200 From: Bartosz Fabianowski MIME-Version: 1.0 Subject: Re: [Qemu-devel] qemu dd sizes References: <20040925171359.1D864299D9@xprdmailfe21.nwk.excite.com> In-Reply-To: <20040925171359.1D864299D9@xprdmailfe21.nwk.excite.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: jmfguy@excite.com, qemu-devel@nongnu.org [This was sent to me off-list] > This was what I was looking for, however, I'm a little confused about > how to mount the file through the loopback device. Mount normally > requires a filesystem type as a parameter but if I create the "empy > image" with dd if=/dev/zero, there is no filesystem in the image. I > can't use newfs on the file until I mount it with the loopback > device..... How do I make the first mount ? Quite simple really. First, create an empty disk image: # dd bs=1 seek=4194303 count=1 if=/dev/zero of=image 1+0 records in 1+0 records out 1 bytes transferred in 0.000104 secs (9620 bytes/sec) Then, create a loopback device: # mdconfig -a -t vnode -f image md0 Note the previous command told you what device name it created. Now, run makefs on that device: # newfs /dev/md0 /dev/md0: 4.0MB (8192 sectors) block size 16384, fragment size 2048 using 4 cylinder groups of 1.02MB, 65 blks, 192 inodes. super-block backups (for fsck -b #) at: 160, 2240, 4320, 6400 Finally, you can mount the disk: # mount /dev/md0 /mnt As you can see, the file system is there, fully functional: # df -H /mnt Filesystem Size Used Avail Capacity Mounted on /dev/md0 3.8M 4.1k 3.5M 0% /mnt To clean up things, you'd first unmount the disk: # umount /mnt Then, you'd free the loopback device: # mdconfig -d -u md0 That's all you need to do. Note however, that mdconfig is a FreeBSD 5.x / 6.x tool. If you're still on 4.x, you will need to use vnconfig instead (it's not as intuitive, but quite easy to use). - Bartosz