Re: bsdinstall misaligns partitions

2013-01-05 Thread Fbsd8

Christian Weisgerber wrote:

Shouldn't bsdinstall attempt to align partitions on 4k boundaries
both for the benefit of 4k drives and flash storage?

I just installed 9.1R i386 for fun and practice, in fact I installed
it several times, and I played around with the partitioning options.

* The modern GPT scheme reserves 34 sectors at the start of the disk.
  Your newly created partitions will start at offset 34 and will
  therefor be misaligned.  I ended up configuring a 63 kB freebsd-boot
  partition, which ensures that the following partitions are aligned.

* The old MBR scheme is even worse.  The FreeBSD slice will start
  at sector 63, guaranteeing that any partitions contained within
  will be misaligned.  There is no way to fix this, unless you
  shell out and run fdisk manually.

* Funnily enough, the ancient BSD dangerously dedicated scheme
  is the only one that out of the box does not misalign partitions.

I'm presumably not the first one to notice this issue, and yes, I'm
mostly just venting.



Best advice is go submit a pr on this bsdinstall situation.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


bsdinstall misaligns partitions

2013-01-04 Thread Christian Weisgerber
Shouldn't bsdinstall attempt to align partitions on 4k boundaries
both for the benefit of 4k drives and flash storage?

I just installed 9.1R i386 for fun and practice, in fact I installed
it several times, and I played around with the partitioning options.

* The modern GPT scheme reserves 34 sectors at the start of the disk.
  Your newly created partitions will start at offset 34 and will
  therefor be misaligned.  I ended up configuring a 63 kB freebsd-boot
  partition, which ensures that the following partitions are aligned.

* The old MBR scheme is even worse.  The FreeBSD slice will start
  at sector 63, guaranteeing that any partitions contained within
  will be misaligned.  There is no way to fix this, unless you
  shell out and run fdisk manually.

* Funnily enough, the ancient BSD dangerously dedicated scheme
  is the only one that out of the box does not misalign partitions.

I'm presumably not the first one to notice this issue, and yes, I'm
mostly just venting.

-- 
Christian naddy Weisgerber  na...@mips.inka.de

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: bsdinstall misaligns partitions

2013-01-04 Thread Michael Sierchio
On Fri, Jan 4, 2013 at 9:14 AM, Christian Weisgerber na...@mips.inka.dewrote:

 Shouldn't bsdinstall attempt to align partitions on 4k boundaries
 both for the benefit of 4k drives and flash storage?


That's rather up to you.  AFAIK it attempts to create partitions that
preserve cylinder boundaries - which are generally a rather obsolete
concept, even for drives with spindles.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: bsdinstall misaligns partitions

2013-01-04 Thread Warren Block

On Fri, 4 Jan 2013, Christian Weisgerber wrote:


Shouldn't bsdinstall attempt to align partitions on 4k boundaries
both for the benefit of 4k drives and flash storage?


I think the latest version does.


I just installed 9.1R i386 for fun and practice, in fact I installed
it several times, and I played around with the partitioning options.

* The modern GPT scheme reserves 34 sectors at the start of the disk.
 Your newly created partitions will start at offset 34 and will
 therefor be misaligned.  I ended up configuring a 63 kB freebsd-boot
 partition, which ensures that the following partitions are aligned.

* The old MBR scheme is even worse.  The FreeBSD slice will start
 at sector 63, guaranteeing that any partitions contained within
 will be misaligned.  There is no way to fix this, unless you
 shell out and run fdisk manually.


Even worse news: you can't fix it manually.  Both fdisk and gpart are 
slaves to the kernel code that deals with MBR layouts, and will align to 
the old CHS values.  I have not found a way to use FreeBSD to create an 
MBR slice that starts at 1M, block 2048.  The CHS alignment always 
forces it to block 2079, a multiple of 63.


However, gpart's -a alignment flag will offset BSD partitions within the 
slice so they are aligned.



* Funnily enough, the ancient BSD dangerously dedicated scheme
 is the only one that out of the box does not misalign partitions.


The filesystems don't begin at the start of the slice anyway.  There is 
a bsdlabel there.



I'm presumably not the first one to notice this issue, and yes, I'm
mostly just venting.


A way to override the CHS alignment would be welcome.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: bsdinstall misaligns partitions

2013-01-04 Thread Christian Weisgerber
Warren Block:

  * Funnily enough, the ancient BSD dangerously dedicated scheme
   is the only one that out of the box does not misalign partitions.
 
 The filesystems don't begin at the start of the slice anyway.  There is 
 a bsdlabel there.

Yes and no.

If you look at the bsdlabel(8) output, the size of 'c' is exactly
the same as the sum of the sizes of the other partitions, as well
as exactly the size of the fdisk slice.  There is no additional
reserved space for the label.

So where does the disklabel hide?  FFS1 (FFS2) leaves 8 kB (64 kB)
of space at the start of _every_ filesystem.  The first 8 kB of the
slice--overlapping with the start of 'c' and the start of 'a'--hold
boot1, the disklabel, and boot2.  If you hexdump /boot/boot2, you'll
notice that the first 0x114 bytes are zeroed out; those 276 bytes
are exactly where the disklabel is located on disk.

See sys/disklabel.h and ufs/ffs/fs.h.

-- 
Christian naddy Weisgerber  na...@mips.inka.de
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org