Subject: Re: Using cloop2 images
To: tech-embed@NetBSD.org <tech-embed@NetBSD.org>
From: Adam Hoka <adam.hoka@gmail.com>
List: tech-embed
Date: 06/14/2007 11:51:47
On Wed, 13 Jun 2007 20:34:20 -0500
David Young <dyoung@pobox.com> wrote:

> On Thu, Jun 14, 2007 at 02:29:51AM +0200, Adam Hoka wrote:
> > Hello,
> > 
> > I have decided to use compressed disk image on my livecd, but I ran into problems.
> > I have created the image with makefs and vndcompress, and after that, I`ve attached it:
> > 
> > # makefs pkg.ffs pkg/
> > # vndcompress pkg.ffs pkg.ffs.cloop2
> > # vnconfig -z vnd0 pkg.ffs.cloop2 
> > # vnconfig -l
> > vnconfig: warning: /var/run/dev.db: No such file or directory
> > vnd0: dev 0,7 inode 2199632
> > vnd1: not in use
> > vnd2: not in use
> > vnd3: not in use
> > 
> > However, when I want to mount it, I get this:
> > 
> > # mount /dev/vnd0a /mnt/
> > mount_ffs: /dev/vnd0a on /mnt: incorrect super block
> > 
> > It`s a NetBSD 4.0beta2 system, and the VND_COMPRESS option is in the kernel config.
> > Any ideas what`s wrong?
> 
> Maybe you need to mount the raw partition, instead?  /dev/rwd0d on x86,
> /dev/rwd0c otherwise.  What does 'disklabel vnd0' say?
> 
> Dave
> 
> -- 
> David Young             OJC Technologies
> dyoung@ojctech.com      Urbana, IL * (217) 278-3933 ext 24

Thanks Dave, both of them are very good ideas.

The raw device trick didn`t work:

# mount /dev/rvnd0d /mnt/
mount_ffs: /dev/rvnd0d on /mnt: Block device required

But looking at the disklabel gave me some idea:

#        size    offset     fstype [fsize bsize cpg/sgs]
 a:    892800         0     4.2BSD      0     0     0  # (Cyl.      0 -    435*)
 d:    892800         0     unused      0     0        # (Cyl.      0 -    435*)

For some reason I need to use the d instead a:

# mount /dev/vnd0d /mnt/

And it`s working!

# cd /mnt
# ls
bin     etc     include info    lib     libdata libexec man     sbin    share

This is some serious ammount of saved diskspace:

-rw-r--r--   1 root      wheel  436M Jun 13 23:24 pkg.ffs
-rw-r--r--   1 root      wheel  169M Jun 14 01:26 pkg.ffs.cloop2

Cheers

-- 
Adam