Table of Contents

1 <2017-04-07 Fri>

  • Created FreeBSD 12 r316508 VM on hyper-v host
  • Cloned openzfs illumos fork to machine
  • Pulled down FreeBSD-HEAD
  • Started reading through
  • Working on getting cscope working
  • In /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c there is an interesting DEFINE called ZVOLDUMP that is not defined. This DEFINE does not exist in Illumos. This is in a function called called zvolupdatelivevolsize, that, on first glance, takes a zvol and shrinks or enlarges it. For dumps there is a comment:
	 * Reinitialize the dump area to the new size. If we
	 * failed to resize the dump area then restore it back to
	 * its original size.  We must set the new volsize prior
	 * to calling dumpvp_resize() to ensure that the devices'
	 * size(9P) is not visible by the dump subsystem.
	old_volsize = zv->zv_volsize;
	zvol_size_changed(zv, volsize);

#ifdef ZVOL_DUMP
	if (zv->zv_flags & ZVOL_DUMPIFIED) {
		if ((error = zvol_dumpify(zv)) != 0 ||
		    (error = dumpvp_resize()) != 0) {
			int dumpify_error;

			(void) zvol_update_volsize(zv->zv_objset, old_volsize);
			zvol_size_changed(zv, old_volsize);
			dumpify_error = zvol_dumpify(zv);
			error = dumpify_error ? dumpify_error : error;
#endif	/* ZVOL_DUMP */

2 <2017-04-14 Fri>

  • Create swap on zvol commands:
sudo zfs create -V 16G -o sync=disabled -o org.freebsd:swap=on -o compression=off -o primarycache=none -o dedup=off -o volmode=dev zroot/swap
  • Several issues:
    • dumpon
sam@FreeBSD-12-HEAD:/usr/src % sudo dumpon /dev/zvol/zroot/swap
dumpon: ioctl(DIOCSKERNELDUMP): Inappropriate ioctl for device
  • swapon
sam@FreeBSD-12-HEAD:/usr/src % sudo swapon /dev/zvol/zroot/swap
swapon: /dev/zvol/zroot/swap: Operation not supported by device

Author: Sam Gwydir

Created: 2017-04-17 Mon 11:21