qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Bartosz Fabianowski <bartosz@fabianowski.de>
To: jmfguy@excite.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] qemu dd sizes
Date: Sun, 26 Sep 2004 00:27:57 +0200	[thread overview]
Message-ID: <4155F0ED.7050401@fabianowski.de> (raw)
In-Reply-To: <20040925171359.1D864299D9@xprdmailfe21.nwk.excite.com>

[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

       reply	other threads:[~2004-09-25 22:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20040925171359.1D864299D9@xprdmailfe21.nwk.excite.com>
2004-09-25 22:27 ` Bartosz Fabianowski [this message]
2004-09-25 13:08 [Qemu-devel] qemu dd sizes jmf
2004-09-25 13:28 ` Paul Brook
2004-09-25 13:46   ` Bartosz Fabianowski
  -- strict thread matches above, loose matches on Subject: below --
2004-09-25  2:15 jmf
2004-09-25  4:21 ` Kyle Hayes
2004-09-25 15:17 ` Mark A. Williamson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4155F0ED.7050401@fabianowski.de \
    --to=bartosz@fabianowski.de \
    --cc=jmfguy@excite.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).