Generate an EXT2 image without being root

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Hi all,

I'd like to be able to generate an ext2 filesystem image for a ramdisk.
I can do that at the moment by mounting an ext2 image on a loopback
device, but that requires me to be root. Are there any ways of
generating an image without using this mechanism ?


Re: Generate an EXT2 image without being root

Quoted text here. Click to load it

I'm not aware of any other method, however you can do this without being
root (man mount, man fstab).  If you apply the following to a loop back
device, you should be able to get mount to mount an ext2 file system as a
mortal user.

see manual pages for ... losetup, fstab, and mount

       (iii) Normally, only the superuser can mount file  systems.   However,
       when  fstab contains the user option on a line, then anybody can mount
       the corresponding system.

CB


Re: Generate an EXT2 image without being root
But if the file-system needs to contain special files (device nodes, e.g.,
/dev/ttyS0 et all), you'll still need to be root unless I'm missing
something.
Of course, not all EXT2 file systems need nodes owned by someone other
than yourself but if it's a bootable filesystem, I don't think you have
much choice. Root is it.


On Thu, 06 Jan 2005 07:43:29 +0000, Craig Bergren wrote:

Quoted text here. Click to load it


Re: Generate an EXT2 image without being root
Quoted text here. Click to load it
Look at the following links:
http://sourceforge.net/projects/e2fsimage/
http://packages.debian.org/unstable/admin/genext2fs

I have not tried these, but appear to be the type of program
with the characteristics you want.

Also, the ext2 utility program debugfs has all
the tools needed to populate a ramdisk,
using the commands mkdir, mknod, and write.
The filesystem needs to have been created
first by using the traditional dd if=null of=filesys count=4k,
and mke2fs filesys method.

--
John Haller

Re: Generate an EXT2 image without being root
Quoted text here. Click to load it

John, you're a genius. Those are exactly what I need, thanks.

Cheers to everyone else who replied.

Quoted text here. Click to load it

I may take a look at this.

Site Timeline