sbin/newfs_hammer: Fix "less than 10GB" error message on newfs
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Thu, 11 Jun 2015 16:20:37 +0000 (01:20 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Fri, 12 Jun 2015 13:52:46 +0000 (22:52 +0900)
commit950336059d8b6856bee3742cc68600db672094b0
tree9b2a21a590f8d0eab47b6469358a5370a78906f8
parentba19d849f7e361bd91c3e2383892b5ab966aa36b
sbin/newfs_hammer: Fix "less than 10GB" error message on newfs

- Add "(for the size of Volume 0)". Trying to make >10GB hammer
  with multiple less-than-10GB-disks results the same error.

- This message appears whenever the root volume (the volume #0
  where layer1/2 are stored by newfs) has less than 10GB space
  in zone2/volume0 address space. It doesn't matter if the total
  size of physical disks are large enough or not.

  # /sbin/newfs_hammer -L TEST /dev/da8 /dev/da9 /dev/da10 /dev/da11
  Volume 0 DEVICE /dev/da8        size   7.22GB
  Volume 1 DEVICE /dev/da9        size  28.88GB
  Volume 2 DEVICE /dev/da10       size   7.20GB
  Volume 3 DEVICE /dev/da11       size   1.86GB
  initialize freemap volume 0
  newfs_hammer: Cannot create a HAMMER filesystem less than 10GB unless you use -f
  (for the size of Volume 0).  HAMMER filesystems less than 50GB are not recommended.

- It's probably better if newfs_hammer could fail with this
  error message without writing (write(2)) to ondisk layer1/2
  structure. The layer1/2 have already been written to the root
  volume by the time the process is aborted. Also note that this
  is the only newfs_hammer sanity check failure that affect ondisk.
  All the other checks abort before ondisk formatting starts.
sbin/newfs_hammer/newfs_hammer.c