Thanks a lot, it works!
Why do I have to use "-o loop" option?
From: Theodore Ts'o [mailto:tytso mit edu]
Sent: Wednesday, May 21, 2003 7:55 PM
To: Debbie Xu
Cc: 'ext3-users redhat com'
Subject: Re: How to create EXT3 file system image from directories?
On Wed, May 21, 2003 at 02:57:00PM -0700, Debbie Xu wrote:
> Hi there,
> Is there a utility to create an EXT3 file system image from directories?
> Just like the mkfs.jffs2 which creates a JFFS2 file system image from
> The "mke2fs -j" only creates the bare bone file system, what I want is to
> build an image with pre-built content.
The easist thing to do is to create a filesystem on a file using
mke2fs, and then mount the filesystem using the loopback device:
dd if=/dev/zero of=foo.img bs=1k count=16384
mke2fs -f foo.img
mount -o loop foo.img /mnt
cp -r /source /mnt