tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: creating FFS2 file-system with makefs on linux




On 29/09/20 8:40 am, Pierre-Philipp Braun wrote:
(I am answering both Lloyd and Christos here, as I couldn't get a grasp on the second email, and to keep the Message-ID dance)

Sorry about the Message-ID dance. I'll try and avoid that in future.

The workaround that I use is to create a small image, write it to large partition, and then use /etc/rc.d/resize_root when booting the image.

Thanks Lloyd.  So here's how I created and increased the size of the image:

    tools/bin/nbmakefs -t ffs -o v=2,o=time -s 2g netbsd.ffs2 tree/
    dd if=/dev/zero bs=1G count=6 >> netbsd.ffs2
        fallocate --dig-holes netbsd.ffs2

Is this with NetBSD-current? My experience is with 9.0 and I have root filling almost all of a 500GB disk on a couple of NUCs. I thought the resize_ffs program refused to resize the v2 filesystems that I started with, but maybe it was just complaining about the log and I'm misremembering. Either way, my 9.0 systems are running with FFSv1.

Maybe you could build with something like

    nbmakefs -N tree/etc -x -F tree/METALOG.sanitised -s 2g -f 100000 netbsd.ffs tree/

This is close to what I used to build my images.

I also tried to do it manually in single user mode:

    resize_ffs /dev/xbd0a

Running resize_ffs directly is most hazardous. I've got it wrong quite a lot. You have to make sure that you reboot without even flushing the superblock (reboot -n). A readonly mount isn't quite as readonly as it might be.

Also, you need to specify the raw device /dev/rxbd0a, not the block device.

Cheers,
Lloyd



Home | Main Index | Thread Index | Old Index