FIXING VN AND CCD DEVICES ON HEAD! Re: HEADS up on HEAD

Matthew Dillon dillon at apollo.backplane.com
Sat May 19 14:58:06 PDT 2007


:As you expected, my ccd partitions(/var/obj and /home) no longer mount.
:Do I need to dump & restore filesystems on a ccd device after the changes
:to ccd device?

    Ok.  They can be recovered if you haven't overwritten anything or if you
    only tried to do an fdisk on it but otherwise did not create or edit
    the disklabels.

    Here's what you have to do.

    * Do full update of HEAD.  I've just committed changes which change some
      ioctls again so....

    * Do a full buildworld, installworld, buildkernel, installkernel,
      reboot, then make upgrade

    * Regenerate ALL of your devices in /dev.  make upgrade will not get
      them all.  In particular, for vn or ccd users:

      cd /dev
      rm -f vn* ccd*
      ./MAKEDEV vn0
      ./MAKEDEV ccd0
      ./MAKEDEV ccd1


		MBR AND DISLABELS ON VN AND CCD DEVICES

    Most normal uses of the VN and CCD devices do *NOT* use an MBR.  This
    means that the disklabel was stored in sector 1 of the 'raw disk',
    instead of in sector 1 of slice 1 of the dos partition table.

    Sector 1 of the raw disk now corresponds to the compatibility slice, s0,
    BUT ONLY IF NO MBR AS BEEN INSTALLED.  If an MBR has been installed the
    the compatibility slice will point at the first bsd slice in the DOS
    slice table.

    Example:

	In 1.8 /dev/ccd0a, in 1.9 /dev/ccd0s0a.
	In 1.8 you ran disklabel on ccd0, in 1.9 you would run it on ccd0s0

	These changes were necessary because in 1.9 'ccd0' represents the
	whole, raw disk, without any interpretation, while ccd0s0 represents
	the compatibility slice and will do disklabel snooping and so forth.

    IF YOU TRIED INSTALLING AN MBR WITH FDISK WHEN YOUR CCD PARTITION DID NOT
    PREVIOUSLY HAVE ONE, then the system will get very confused.   You can
    clear this MBR without screwing up the disklabel with the following.
    This is very dangerous, don't forget the count=1 !!!

	dd if=/dev/zero of=/dev/ccd0 bs=512 count=1

    If your CCD or VN mount was using an MBR before, then no changes are
    needed.. it should just work.  I will note that most people using CCD
    and VN will NOT have been using an MBR.

    Please tell me if these steps work.  Hopefully you didn't already
    reformat your ccd :-)

						-Matt






More information about the Kernel mailing list