partition not accessible via UFS label (/dev/ufs/*)

Ivan Voras ivoras at
Wed Apr 13 11:59:02 UTC 2011

On 13/04/2011 00:47, Alexander Best wrote:

> thank you very much. when i posted this issue a few weeks ago i was defenately
> hitting a bug in geom, because the ufs label wouldn't even show up in single-
> user mode with / mounted ro. the problem occured after i booted ubuntu from a
> dvd and was then getting a corrupted gpt entry. i used 'gpart recover' which
> then showed up some extra space available. after doing 'gpart resize', mounting
> /dev/ufs/rootf did no longer work and i had to switch to mounting /dev/ada0p3.

This also happens when using growfs(8) or anything which can make the 
size of the file system not equal the size of the media (geom) on which 
it is located.

This is a side-effect of checking for file system corruption, I'm not 
sure that removing the check would be a good thing to do.

  84                 /* Check for magic and make sure things are the 
right size */
  85                 if (fs->fs_magic == FS_UFS1_MAGIC && fs->fs_fsize > 
0 &&
  86                     pp->mediasize / fs->fs_fsize == fs->fs_old_size) {
  87                         /* Valid UFS1. */
  88                 } else if (fs->fs_magic == FS_UFS2_MAGIC && 
fs->fs_fsize > 0 &&
  89                     pp->mediasize / fs->fs_fsize == fs->fs_size) {
  90                         /* Valid UFS2. */
  91                 } else {
  92                         g_free(fs);
  93                         continue;
  94                 }

More information about the freebsd-geom mailing list