Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

any simple tool to extract files from an UFS image ?

167 views
Skip to first unread message

Luigi Rizzo

unread,
Jun 9, 2008, 10:14:41 AM6/9/08
to
Hi,
I am doing some work recently on small FreeBSD images (picobsd and friends),
and I need to run on a linux machine some script to customize
both the UFS and the ISO image.

Because the customization is just writing some text into a file,
my approach is to put in the UFS image a file with a recognizable
start and end markers, and then dd into the image the stuff I need.

I was wondering if i could avoid shipping both images, and instead
use some trick to extract the tree from the UFS image and then
use mkisofs on the linux side to build the ISO.

I know that bsdtar can read ISO images, but I don't think it does
the same on UFS. Yet, if the boot2 code is able to squeeze the
required pieces on 8k or so, maybe there is some simple (and portable)
tool that can do the file extraction job ?

cheers
luigi
_______________________________________________
freebsd...@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-curre...@freebsd.org"

Ivan Voras

unread,
Jun 9, 2008, 10:26:26 AM6/9/08
to
Luigi Rizzo wrote:
> Hi,
> I am doing some work recently on small FreeBSD images (picobsd and friends),
> and I need to run on a linux machine some script to customize
> both the UFS and the ISO image.
>
> Because the customization is just writing some text into a file,
> my approach is to put in the UFS image a file with a recognizable
> start and end markers, and then dd into the image the stuff I need.
>
> I was wondering if i could avoid shipping both images, and instead
> use some trick to extract the tree from the UFS image and then
> use mkisofs on the linux side to build the ISO.
>
> I know that bsdtar can read ISO images, but I don't think it does
> the same on UFS.

If I understand you correctly, you may try mounting the images in Linux,
with suitably compiled kernel.

signature.asc

Luigi Rizzo

unread,
Jun 9, 2008, 11:34:09 AM6/9/08
to

yes but that requires root privileges.
I try to avoid that even in FreeBSD (ni the picobsd script)
by using 'makefs'.

Julian Elischer

unread,
Jun 9, 2008, 1:51:56 PM6/9/08
to
Luigi Rizzo wrote:
> Hi,
> I am doing some work recently on small FreeBSD images (picobsd and friends),
> and I need to run on a linux machine some script to customize
> both the UFS and the ISO image.

dump and restore?

Frank Mayhar

unread,
Jun 9, 2008, 2:48:42 PM6/9/08
to
On Mon, 2008-06-09 at 20:32 +0200, Luigi Rizzo wrote:

> On Mon, Jun 09, 2008 at 10:51:56AM -0700, Julian Elischer wrote:
> > Luigi Rizzo wrote:
> > >Hi,
> > >I am doing some work recently on small FreeBSD images (picobsd and
> > >friends),
> > >and I need to run on a linux machine some script to customize
> > >both the UFS and the ISO image.
> >
> > dump and restore?
>
> ???
>
> the UFS image is just a file produced on FreeBSD - i'd rather not
> require root privs to mount the image in order to manipulate it.

You could try ffsrecov/ffs2recov, although those tools aren't really
suited to this task.
--
Frank Mayhar fr...@exit.com http://www.exit.com/
Exit Consulting http://www.gpsclock.com/
http://www.exit.com/blog/frank/
http://www.zazzle.com/fmayhar*

Julian Elischer

unread,
Jun 9, 2008, 2:50:23 PM6/9/08
to
Luigi Rizzo wrote:
> On Mon, Jun 09, 2008 at 10:51:56AM -0700, Julian Elischer wrote:
>> Luigi Rizzo wrote:
>>> Hi,
>>> I am doing some work recently on small FreeBSD images (picobsd and
>>> friends),
>>> and I need to run on a linux machine some script to customize
>>> both the UFS and the ISO image.
>> dump and restore?
>
> ???
>
> the UFS image is just a file produced on FreeBSD - i'd rather not
> require root privs to mount the image in order to manipulate it.
>
> cheers
> luigi

dump reads the UFS filesystem directly does it not? piped into
restore, it puts the files onto a mounted filesystem.

Bakul Shah

unread,
Jun 9, 2008, 4:49:35 PM6/9/08
to
On Mon, 09 Jun 2008 11:50:23 PDT Julian Elischer <jul...@elischer.org> wrote:
> Luigi Rizzo wrote:
> > On Mon, Jun 09, 2008 at 10:51:56AM -0700, Julian Elischer wrote:
> >> Luigi Rizzo wrote:
> >>> Hi,
> >>> I am doing some work recently on small FreeBSD images (picobsd and
> >>> friends),
> >>> and I need to run on a linux machine some script to customize
> >>> both the UFS and the ISO image.
> >> dump and restore?

That was my first thought too!

> > the UFS image is just a file produced on FreeBSD - i'd rather not
> > require root privs to mount the image in order to manipulate it.
> >
> > cheers
> > luigi
>
> dump reads the UFS filesystem directly does it not? piped into
> restore, it puts the files onto a mounted filesystem.

You'd have to modify dump a bit since it insists on a special
device to dump from (and make dump+restore work on linux).

Or he can use vbackup & vftp from plan9ports. vbackup can
read a variety of filesystems and archive them to a venti
server. vftp can be used to retrieve files from venti. None
of the three require root privs and already work on linux.
http://swtch.com/plan9port/

0 new messages