Problem adding new slices

Szilveszter Adam sziszi at
Sun Aug 5 22:16:09 PDT 2007

On Sun, Aug 05, 2007 at 05:30:34PM -0700, Jason Edward Kocol wrote:
> I don't know what I did differently this time, but I finally got it to 
> work.  Here are the steps I took.  May not be the best method but it got 
> the slice created and mountable.  I didn't like all the reboots but they 
> seemed to make a difference.

There is no mystery here, it is actually a FAQ.


The deciding moment was this:

> - Needed to run 'sysctl kern.geom.debugflag=16' every time I needed to 
> write a change to the disk after a fresh boot, since it was a new partition 
> on the disk for the running system.

If you have any partition within a slice mounted, then you absolutely
must either umount all partitions within that slice, or set this sysctl
for any changes to the disklabel to take effect. Same game with fdisk,
only in that case not with partitions but with slices.

So, if you already have ad0s1 and ad0s2 say, and want to edit the label
for ad0s2, then you can have partitions in ad0s1 mounted, but you either
have to umount anything within ad0s2 or set the sysctl you mentioned.
Otherwise, the bsdlabel command will appear to work but the changes will
not be saved to the disk.

If you have the same situation but want to use fdisk, then you cannot
have anything mounted within ad0, or you have to set the sysctl,
otherwise your changes will not be written to disk. 

All the reboots were probably unneeded, btw, but a good test that the
changes you made survived.

> - sysinstall reported that the geometry was incorrect for this disk, so it 
> used a "more likely geometry."  I don't remember the values it chose, but 
> when I tried to put in the ones that my BIOS reported it didn't like those 
> either.  So your suspicions of a GEOM issue may have been well-founded 
> initially.

As far as I am aware, sysinstall has been reporting this for every disk
that was larger than a specific size, which means to pretty much every
disk for years now. It can be ignored.

I am glad it worked for you eventually, though.

Szilveszter ADAM

More information about the freebsd-stable mailing list