bsdlabel editing to create a single partition

Jerry McAllister jerrymc at
Sun Apr 22 14:10:16 UTC 2007

On Sat, Apr 21, 2007 at 09:58:11PM -0500, illoai at wrote:

> On 21/04/07, L Goodwin <xrayv19 at> wrote:
> >I want to dedicate the entire disk to a single FreeBSD partition 
> >("da1s1a"), and
> > am a little confused about editing partitions via "bsdlabel -e 
> > <slicename>".
> >
> >Prior to editing, it looks like this:
> >----------------------------------------------------------------------------------------
> ># /dev/da1s1:
> >8 partitions:
> >#  size           offset    fstype     [fsize bsize bps/cpg]
> >a: 17908300       16    unused    0    0
> >c: 17908316         0    unused    0    0    # "raw" part, don't edit
> >----------------------------------------------------------------------------------------
> >
> >I gather that I should change the following field values for "c:":
> >    fstype: 4.2BSD
> >    fsize: 2048
> >    bsize: 16384
> >
> >Questions:
> >1) Do I change the "size" value for "a:" or leave at current size?
> NO
> > 2) Do I leave the "c:" line alone (in place) and if YES does
> >its "size" and "offset" values need to be edited?
> Leave it alone.
> >
> >If someone could show me what it should look like when done, I'd 
> >appreciate it.
> >
> >When I leave the "c:" entry in place, I get /dev/da1s1a and /dev/da1s1c in 
> >/dev/.
> >Should I delete the "c:" entry? Here's what I have now:
> >----------------------------------------------------------------------------------------
> > # /dev/da1s1:
> > 8 partitions:
> > #  size           offset    fstype     [fsize bsize bps/cpg]
> > a: 17908300       16    4.2BSD    2048    16384
> > c: 17908316         0    unused    0          0    # "raw" part, don't 
> > edit
> > ----------------------------------------------------------------------------------------
> >
> Don't edit the bsdlabel at all, just:
> # newfs -U /dev/da1s1a
> and it will automatically fill out the fsize, bsize, and bps/cpg
> fields.  You can then add a line to fstab, mount it, fill it with
> text files containing the word "corn" ever and over.

Almost, but not quite right, if I understand what is being said.
You do want to do a bsdlabel and some minor editing as indicated below.

First, did you do an 'fdisk -I da1'
           or        'fdisk -IB da1'    if you want it bootable.

The presence of the 16 in the offset field of the a: line makes me
think that you did not.   So, do the fdisk.    

(If you do not do the fdisk, then the bsdlabel must be done to da1 and 
not da1s1 plus the newfs would be 'newfs /dev/da1a and not /dev/da1s1a  
which will make it one of those "dangerously dedicated" disks, which I 
don't recommend)

> c: should nearly never be touched, and definitely never in
> the course of simply setting up a disk for use.

That is true.   Do not change anything on the c: line.
In your case you might want to dup that c: line and then 
change it to an a: line, change the type to BSD4.2 and put in 
the fsize, bsize and bps/cpg, though I think the system plugs
in reasonable values if you don't put anything for them.

If you intend to make the file system use all the space, then
make the offset on that a: partition be '0' and the size be
the same as the full size in the c: line.   On the other hand
you could just put '*' in the size and offset fields for
the a: line.   Then it will make the one partition that covers
all the usable space.

Then, when you get that bsdlabel -e  done,  you go ahead
and do the newfs.    newfs /dev/da1s1a  

NOTE, if you want to make the partition bootable, then after
doing the fdisk -IB da1    you must do
  bsdlabel  -w -B da1s1   before doing the  bsdlabel -e da1s1.

So, the order is:

   fdisk -I da1    or fdisk  -IB da1  for a bootable slice

   bsdlabel -w da1s1   or   bsdlabel -w -B  da1s1  for bootable partition

   bsdlabel -e da1s1  

   newfs /dev/da1s1a


> -- 
> --
> _______________________________________________
> freebsd-questions at mailing list
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at"

More information about the freebsd-questions mailing list