Re: Advanced Format Drive ?

2012-11-28 Thread Ronald F. Guilmette

In message alpine.bsf.2.00.1211272215360.62...@wonkity.com, 
Warren Block wbl...@wonkity.com wrote:

 I tried to do as you suggest and change the partition type to freebsd-ufs,
 but there's a problem...

 # gpart modify -i 1 -t freebsd-ufs /dev/da1
 gpart: Invalid argument

da1 is the drive.  da1s1 is the first slice.

Yeabut that's what I thought that the -i option was for!  I mean isn't the 
parameter for
that supposed to tell gpart which sub-part of the whole geom thing that is 
named on
the command line is supposed to be modified?

Well, now I'm totally confused, but I'll try it again in the way I think you 
are suggesting...


# gpart modify -i 1 -t freebsd-ufs /dev/da1s1
gpart: geom '/dev/da1s1': Invalid argument


U...

What else should I try?
___
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: Advanced Format Drive ?

2012-11-28 Thread Warren Block

On Wed, 28 Nov 2012, Ronald F. Guilmette wrote:



In message alpine.bsf.2.00.1211272215360.62...@wonkity.com,
Warren Block wbl...@wonkity.com wrote:


I tried to do as you suggest and change the partition type to freebsd-ufs,
but there's a problem...

# gpart modify -i 1 -t freebsd-ufs /dev/da1
gpart: Invalid argument


da1 is the drive.  da1s1 is the first slice.


Yeabut that's what I thought that the -i option was for!  I mean isn't the 
parameter for
that supposed to tell gpart which sub-part of the whole geom thing that is 
named on
the command line is supposed to be modified?


Doh, you are right, and I misread it.  It's the type that is the 
problem: freebsd-ufs is a not an MBR partition type, it should be just 
freebsd:


# gpart modify -i1 -t freebsd /dev/da1
___
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: Advanced Format Drive ?

2012-11-28 Thread Ronald F. Guilmette

In message alpine.bsf.2.00.1211281735290.69...@wonkity.com, 
Warren Block wbl...@wonkity.com wrote:

On Wed, 28 Nov 2012, Ronald F. Guilmette wrote:


 In message alpine.bsf.2.00.1211272215360.62...@wonkity.com,
 Warren Block wbl...@wonkity.com wrote:

 I tried to do as you suggest and change the partition type to freebsd-ufs,
 but there's a problem...

 # gpart modify -i 1 -t freebsd-ufs /dev/da1
 gpart: Invalid argument

 da1 is the drive.  da1s1 is the first slice.

 Yeabut that's what I thought that the -i option was for!  I mean isn't the 
 parameter for
 that supposed to tell gpart which sub-part of the whole geom thing that is 
 named on
 the command line is supposed to be modified?

Doh, you are right, and I misread it.  It's the type that is the 
problem: freebsd-ufs is a not an MBR partition type, it should be just 
freebsd:

# gpart modify -i1 -t freebsd /dev/da1


Thank you again Warren.  Success!  I am a happy camper!

% gpart show /dev/da1
=63  1953525104  da1  MBR  (931G)
  631985   - free -  (992k)
2048  19535196161  freebsd  (931G)
  19535216643503   - free -  (1.7M)

___
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: Advanced Format Drive ?

2012-11-27 Thread Ronald F. Guilmette

In message alpine.bsf.2.00.1211262232330.38...@wonkity.com, 
Warren Block wbl...@wonkity.com wrote:

On Mon, 26 Nov 2012, Ronald F. Guilmette wrote:

 Starting sector 2048 is definitely a multiple of 4KB, so I am assuming
 that all I really need to do here in order to use this new drive as extra
 stroage for a FreeBSD system (assuming that I am happy with good old
 fashioned MBR style partitioning, which I am) is just:

newfs -U /dev/da1s1

You should also change the partition type to freebsd or freebsd-ufs. 
Offhand I'd guess they're both 0xa5, but have not looked.  Use 'gpart 
modify'.


Thanks Warren!  I confess that I hadn't even thought about that.  And as
a result, the partition that I just backed up a substantial part of my
system onto is still being listed as ntfs, even though I have done
the newfs to it and (thus) it is now actually a UFS partition... not NTFS.

% gpart show /dev/da1
=63  1953525104  da1  MBR  (931G)
  631985   - free -  (992k)
2048  19535196161  ntfs  (931G)
  19535216643503   - free -  (1.7M)


I can still mount it as a UFS, no problem, so Im inclined to wonder what
the type code on a partition is used for anyway.  (FreeBSD doesn't seem to
care if a partition is marked as NTFS as long as it actually has a UFS
filesystem in it.)

I tried to do as you suggest and change the partition type to freebsd-ufs,
but there's a problem...

# gpart modify -i 1 -t freebsd-ufs /dev/da1
gpart: Invalid argument
# gpart modify -i 0 -t freebsd-ufs /dev/da1
gpart: index '0': No such file or directory


Obviously, I'm doing this wrong, but what is the Right Way?

(The error message Invalid argument is not terribly informative.  It
doesn't even indicate which argument is to blame.  And I'm not sure if
the index numbers that gpart uses start from 0 or from 1.  The man page
doesn't say.)


P.S.  When doing the newfs, I actually ended up having to do:

newfs -U -f 4096 /dev/da1s1

because I was doing this on an old 8.3 system, so the default frag size
there was still set at 2048.
___
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: Advanced Format Drive ?

2012-11-27 Thread Warren Block

On Tue, 27 Nov 2012, Ronald F. Guilmette wrote:



In message alpine.bsf.2.00.1211262232330.38...@wonkity.com,
Warren Block wbl...@wonkity.com wrote:


On Mon, 26 Nov 2012, Ronald F. Guilmette wrote:


Starting sector 2048 is definitely a multiple of 4KB, so I am assuming
that all I really need to do here in order to use this new drive as extra
stroage for a FreeBSD system (assuming that I am happy with good old
fashioned MBR style partitioning, which I am) is just:

   newfs -U /dev/da1s1


You should also change the partition type to freebsd or freebsd-ufs.
Offhand I'd guess they're both 0xa5, but have not looked.  Use 'gpart
modify'.



Thanks Warren!  I confess that I hadn't even thought about that.  And as
a result, the partition that I just backed up a substantial part of my
system onto is still being listed as ntfs, even though I have done
the newfs to it and (thus) it is now actually a UFS partition... not NTFS.

% gpart show /dev/da1
=63  1953525104  da1  MBR  (931G)
 631985   - free -  (992k)
   2048  19535196161  ntfs  (931G)
 19535216643503   - free -  (1.7M)


I can still mount it as a UFS, no problem, so Im inclined to wonder what
the type code on a partition is used for anyway.  (FreeBSD doesn't seem to
care if a partition is marked as NTFS as long as it actually has a UFS
filesystem in it.)


Mostly relevant when booting from that drive.  Still, it would be bad 
for some NTFS utility to helpfully attempt repair of a UFS filesystem.



I tried to do as you suggest and change the partition type to freebsd-ufs,
but there's a problem...

# gpart modify -i 1 -t freebsd-ufs /dev/da1
gpart: Invalid argument


da1 is the drive.  da1s1 is the first slice.


(The error message Invalid argument is not terribly informative.  It
doesn't even indicate which argument is to blame.  And I'm not sure if
the index numbers that gpart uses start from 0 or from 1.  The man page
doesn't say.)


Slice/partition number is the third column in the gpart output above. 
MBR slice numbering starts at one.



P.S.  When doing the newfs, I actually ended up having to do:

   newfs -U -f 4096 /dev/da1s1

because I was doing this on an old 8.3 system, so the default frag size
there was still set at 2048.

___
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


Advanced Format Drive ?

2012-11-26 Thread Ronald F. Guilmette


Just a brief follow-up on my questions here (about 2 weeks ago) regarding
so-called Advanced Format (4KB block) drives...

I just got myself a shiny new Seagate 2.5 portable external 1TB hard drive.
fdisk is telling me this about it:

===
*** Working on device /dev/da1 ***
parameters extracted from in-core disklabel are:
cylinders=121601 heads=255 sectors/track=63 (16065 blks/cyl)

Figures below won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders=121601 heads=255 sectors/track=63 (16065 blks/cyl)

Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 7 (0x07),(NTFS, OS/2 HPFS, QNX-2 (16 bit) or Advanced UNIX)
start 2048, size 1953519616 (953867 Meg), flag 0
beg: cyl 0/ head 32/ sector 33;
end: cyl 1023/ head 254/ sector 63
The data for partition 2 is:
UNUSED
The data for partition 3 is:
UNUSED
The data for partition 4 is:
UNUSED
===

Starting sector 2048 is definitely a multiple of 4KB, so I am assuming
that all I really need to do here in order to use this new drive as extra
stroage for a FreeBSD system (assuming that I am happy with good old
fashioned MBR style partitioning, which I am) is just:

newfs -U /dev/da1s1

Right?

Last question:  How could I even tell if this thing is or isn't Advanced
Format?  Is there some tool I could run that would tell me that?
___
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


Advanced Format Drive ?

2012-11-26 Thread Ronald F. Guilmette


I just wanted to add another data point... in case anybody is interested...

uring my recent spending binge, I also acquired a Hatachi portable external
2.5 inch Touro Moble 500GB drive.

Righ out of the box, this is what fdisk tells me about this one:

==
*** Working on device /dev/da1 ***
parameters extracted from in-core disklabel are:
cylinders=60801 heads=255 sectors/track=63 (16065 blks/cyl)

Figures below won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders=60801 heads=255 sectors/track=63 (16065 blks/cyl)

Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 7 (0x07),(NTFS, OS/2 HPFS, QNX-2 (16 bit) or Advanced UNIX)
start 2048, size 976766976 (476937 Meg), flag 0
beg: cyl 0/ head 32/ sector 33;
end: cyl 1023/ head 254/ sector 63
The data for partition 2 is:
UNUSED
The data for partition 3 is:
UNUSED
The data for partition 4 is:
UNUSED
==


I can't help but note that both this one and also my new Seagate 2.5 portable
external 1TB drive are pre-partitioned with one partition that in both cases
starts at sector 2048.  I suppose that it is no coincidence that 2048 * 512B ==
1 megabyte, exactly.

___
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: Advanced Format Drive ?

2012-11-26 Thread Warren Block

On Mon, 26 Nov 2012, Ronald F. Guilmette wrote:


I can't help but note that both this one and also my new Seagate 2.5 portable
external 1TB drive are pre-partitioned with one partition that in both cases
starts at sector 2048.  I suppose that it is no coincidence that 2048 * 512B ==
1 megabyte, exactly.


Told ya.
___
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: Advanced Format Drive ?

2012-11-26 Thread Warren Block

On Mon, 26 Nov 2012, Ronald F. Guilmette wrote:


Starting sector 2048 is definitely a multiple of 4KB, so I am assuming
that all I really need to do here in order to use this new drive as extra
stroage for a FreeBSD system (assuming that I am happy with good old
fashioned MBR style partitioning, which I am) is just:

   newfs -U /dev/da1s1


You should also change the partition type to freebsd or freebsd-ufs. 
Offhand I'd guess they're both 0xa5, but have not looked.  Use 'gpart 
modify'.

___
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: Advanced Format Drive ?

2012-11-16 Thread dweimer

On 2012-11-15 17:31, Ronald F. Guilmette wrote:
(This stuff would probably be a lot less confiusing if I actually 
knew

what I was doing, but...)

OK, Warren, I've just done the following steps.  The first two I drew
from the manpage examples, and then followed those up with two 
commands

from your tutorial.

  /sbin/gpart create -s GPT ada0# manpage example is wrong, ad0 
- ada0
  /sbin/gpart bootcode -b /boot/mbr ad0  # manpage wrong again, pmbr 
- mbr

  gpart add -t freebsd-boot -l gpboot -b 40 -s 512K ada0
  gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ada0

That last one, done at the suggestion of your tutorial page, has me
completely perplexed, because of what is said, very explicitly, in 
the

gpart(8) manpage:

 bootcode  Embed bootstrap code into the partitioning scheme's 
metadata on
   the geom (using -b bootcode) or write bootstrap code 
into a

   partition (using -p partcode and -i index).

Please note the use of the word or.

The man page is telling me to _either_ use the -p option _or else_ 
use
the -p and -i options together.  But you are telling me to use all 
three

in one go!

Forgive me, but I'm confused.  (As you can tell by now, I am often 
easily

confused.  Sorry.)
___
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


I saw this, and well started wondering myself, as I have been using 
this while doing work on booting FreeBSD via ZFS (of course using -p 
/boot/gptzfsboot), I got the line from a tutorial on booting from ZFS.  
Never thought much of it, until now, but I believe I see now why, the 
secret is the pmbr, notice the p.  Its the protective mbr, it lets 
formatting tools that understand mbr, but not gpart know that there is 
something there, the actual boot code is in the partition.


--
Thanks,
   Dean E. Weimer
   http://www.dweimer.net/
___
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: Advanced Format Drive ?

2012-11-16 Thread Arthur Chance

On 11/16/12 14:07, dweimer wrote:

On 2012-11-15 17:31, Ronald F. Guilmette wrote:

(This stuff would probably be a lot less confiusing if I actually knew
what I was doing, but...)

OK, Warren, I've just done the following steps.  The first two I drew
from the manpage examples, and then followed those up with two commands
from your tutorial.

  /sbin/gpart create -s GPT ada0# manpage example is wrong, ad0 -
ada0
  /sbin/gpart bootcode -b /boot/mbr ad0  # manpage wrong again, pmbr
- mbr
  gpart add -t freebsd-boot -l gpboot -b 40 -s 512K ada0
  gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ada0

That last one, done at the suggestion of your tutorial page, has me
completely perplexed, because of what is said, very explicitly, in the
gpart(8) manpage:

 bootcode  Embed bootstrap code into the partitioning scheme's
metadata on
   the geom (using -b bootcode) or write bootstrap code
into a
   partition (using -p partcode and -i index).

Please note the use of the word or.

The man page is telling me to _either_ use the -p option _or else_ use
the -p and -i options together.  But you are telling me to use all three
in one go!

Forgive me, but I'm confused.  (As you can tell by now, I am often easily
confused.  Sorry.)
___
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


I saw this, and well started wondering myself, as I have been using this
while doing work on booting FreeBSD via ZFS (of course using -p
/boot/gptzfsboot), I got the line from a tutorial on booting from ZFS.
Never thought much of it, until now, but I believe I see now why, the
secret is the pmbr, notice the p.  Its the protective mbr, it lets
formatting tools that understand mbr, but not gpart know that there is
something there, the actual boot code is in the partition.


pmbr serves two purposes. It's both the first stage boot code, as a 
traditional BIOS always loads the first block of the disk into memory 
and runs it to boot the machine regardless of whether you've got an MBR 
or GPT disk, and it contains a traditional MBR that shows the entire 
disk is occupied by the first DOS partition (slice in BSD terminology) 
and that is of type 0xee. The latter means that GPT ignorant utilities 
see the disk as fully occupied by a partition of unknown type, which 
should mean they won't touch anything.


The pmbr boot code understands the GPT table and runs through the 
partition entries looking for one of type freebsd-boot. When it finds 
one, it then loads the contents of the partition (or the first 545k if 
it's larger) into memory and jumps to the second stage boot loader.

___
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: Advanced Format Drive ? GPT ?

2012-11-16 Thread Al Plant

Warren Block wrote:

On Thu, 15 Nov 2012, Al Plant wrote:


I looked over the GPT sample and have a question.

In the fstab entries, something that uses msdosfs, (thumb drive maybe).



%%%

Can you enter it directly in the fstab after the basic partitions and 
other /dev have been entered in the initial setup?


Short answer: yes, but...

Longer answer: most flash drives have an MBR partition setup with one 
partition filling the whole device.  Since it's not GPT, it won't/can't 
have GPT labels on the partitions.  But the GEOM system will create a 
label for the MSDOS filesystem if it has been given a volume name.  That 
label will appear in /dev/msdosfs/ and can be used in an /etc/fstab entry.

___



Thanks,, For the sage advice.

%

~Al Plant - Honolulu, Hawaii -  Phone:  808-284-2740
  + http://hawaiidakine.com + http://freebsdinfo.org +
  + http://aloha50.net   - Supporting - FreeBSD  7.2 - 8.0 - 9* +
   email: n...@hdk5.net 
All that's really worth doing is what we do for others.- Lewis Carrol

___
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: Advanced Format Drive ?

2012-11-15 Thread Ronald F. Guilmette

In message alpine.bsf.2.00.1211142231420.58...@wonkity.com, 
Warren Block wbl...@wonkity.com wrote:

On Wed, 14 Nov 2012, Ronald F. Guilmette wrote:
...
 Given these facts, I am more than a little surpised to learn (or rather
 just to realize) that the good old traditional fdisk and bsdlabel tools
 do not have ways to explicitly specify minimum alignment _and_ that
 these tools are still being distributed with FreeBSD.

There may be a way, I haven't bothered to look.  As I said, gpart does 
everything fdisk and bsdlabel can do.

Well, given that newfs has been ``fixed'' so that its defaults will
Do The Right Thing with the latest generation of (4KB block) disks,
I for one would like to register my vote for fdisk and bsdlabel to
either (a) be likewise fixed so that they also will default to Doing
The Right Thing (with the current generation of disks) or else (b)
be removed from future releases, based on the fact that (apparently)
they are now so old that nobody cares about them anymore and/or that
their defaults, when (foolishly?) relied upon, are likely to produce
Bad Performance, aka Bad Behavior.

And also, please don't forget the other points I mentioned, i.e. that
the man page for fdisk makes several references to alignment on ``cylinder''
and/or ``head'' boundaries.  Are those things even relavant anymore?
Have they been, anytime in the past 10+ years?  (I am guessing that
there may be other similarly antiquated references to boundaries that
haven't been meaningful for a long long time also in the bdslabel man
page, although I confess that didn't even look.)
___
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: Advanced Format Drive ?

2012-11-15 Thread Ronald F. Guilmette

In message alpine.bsf.2.00.1211142250370.58...@wonkity.com, 
Warren Block wbl...@wonkity.com wrote:

On Wed, 14 Nov 2012, Ronald F. Guilmette wrote:

 I'm looking at the examples section of the gpart(8) man page.  May I
 assume that if I just want to merely ``try out'' GPT... you know...
 taking it out on the road for a first time test run... that I can
 just do the first five (5) commands listed under EXAMPLES and then
 that will be enough to go ahead and try installing FreeBSD into the
 created freebsd-ufs partition?

 Even assuming that the answer is yes, I have still more questions...
 Where are these magic numbers coming from??  I am specifically talking
 about the number 34 in the -b 34 option and also the number 162
 in the -b 162 option.  Tha man page just tosses those into the example
 command lines without saying a word about them.  And you can probably
 guess what it is that is especially troubling to me about them... neither
 one of them is divisible by 8 (i.e. 4KB/512B).  So would the examples
 in the current gpart(8) man page produce an Epic Fail when and if they
 were used with a modern Advanced Format drive?

-b is the beginning block of a partition.  34 is a magic value, the size 
of a standard GPT partition table.

It probably wouldn't have hurt anything to mention that in the gpart man
page.

And what about 162?  Is that magic too?  If so, how?  I seriously do not
know.

A good overall reference on GPT is 
the Wikipedia page: http://en.wikipedia.org/wiki/GUID_Partition_Table

Remember that the man page is a reference, not a tutorial.

Actually, it is clearly both.

We all know that man pages are primarily supposed to be (minimal?) reference
documents, but you cannot claim with a straight face that any man page that
contains an EXAMPLES section is not also serving as a rudimentary tutorial.

Personally, I find the minimalist tutorials that are often found within
EXAMPLES sections of man page quite helpful, gpart(8) included.  But in
this specific case the pulling of number, apparently out of thin air (at
least from the point of view of the uninitiated) rather significantly
degrades the educational value.

I wanted 
more specific notes that followed best practices, and that was the 
source for this article:
http://www.wonkity.com/~wblock/docs/html/disksetup.html

It is very helpful (and very appreciated!) that you were kind enough to
create that document, which is clearly more unambiguously a tutorial.
But really, the gpart(8) man page got me about 97% of the way there,
even without me having to consult external references.  If it just
had not been for those mystery numbers...

In general, you create a partition scheme first.  This can be MBR, 
GPT, or others.  (But use GPT.)

Yea.  I got that part.

Rather than combine the bootcode with the partition table, GPT just uses 
a small partition for it.  Since the standard GPT allows for up to 128 
partitions, there's no reason not to use them.

Got it.  Thanks.

Next come other partitions for UFS or ZFS filesystems or swap.

Right.

That's it, really.  The rest is details the man page can explain, like 
additional options for alignment.  (The creation of the first UFS 
partition in the article does not use -a because older versions of gpart 
did unexpected things when -a and -b were combined.  The alignment 
produced is correct.)

Questions:

In your tutorial document, you say:

 Create a boot partition to hold the loader, size of 512K.

How big is that thing (gpart boot loader), actually?  Half a megabyte
seems rather a bit large-ish, certainly relative to ye olde MBR loader,
which I gather was limited to... what?  32KB (minus a little for the
partition table) ?

Also, when creating the partition to hold the GPT boot loader, shouldn't
that gpart add operation include a -b 4k option, you know, on a
modern Advanced Format disk?  If not, why not?

You also go on to say:

 Create partition for /. It should start at the 1M boundary for proper
 sector alignment on 4K sector drives.

Come again?  Sorry, but you just lost me entirely.  In order to get proper
sector alignment on one of these newer Advanced Format (4k) drives, why
on earth should it be necessary to begin a partition at some alignment
which is greater than the obvious minimum, i.e. 4KB ?
___
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: Advanced Format Drive ?

2012-11-15 Thread Chris Whitehouse



In messagealpine.bsf.2.00.1211142250370.58...@wonkity.com,


In general, you create a partition scheme first.  This can be MBR,
GPT, or others.  (But use GPT.)


Unless you want to dual boot with WinXP in which case use MBR still?

Chris
___
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: Advanced Format Drive ?

2012-11-15 Thread Arthur Chance

On 11/15/12 12:41, Ronald F. Guilmette wrote:


In message alpine.bsf.2.00.1211142250370.58...@wonkity.com,
Warren Block wbl...@wonkity.com wrote:


On Wed, 14 Nov 2012, Ronald F. Guilmette wrote:


I'm looking at the examples section of the gpart(8) man page.  May I
assume that if I just want to merely ``try out'' GPT... you know...
taking it out on the road for a first time test run... that I can
just do the first five (5) commands listed under EXAMPLES and then
that will be enough to go ahead and try installing FreeBSD into the
created freebsd-ufs partition?

Even assuming that the answer is yes, I have still more questions...
Where are these magic numbers coming from??  I am specifically talking
about the number 34 in the -b 34 option and also the number 162
in the -b 162 option.  Tha man page just tosses those into the example
command lines without saying a word about them.  And you can probably
guess what it is that is especially troubling to me about them... neither
one of them is divisible by 8 (i.e. 4KB/512B).  So would the examples
in the current gpart(8) man page produce an Epic Fail when and if they
were used with a modern Advanced Format drive?


-b is the beginning block of a partition.  34 is a magic value, the size
of a standard GPT partition table.


It probably wouldn't have hurt anything to mention that in the gpart man
page.

And what about 162?  Is that magic too?  If so, how?  I seriously do not
know.


The man example should be taken as a whole. You've got

/sbin/gpart add -b 34 -s 128 -t freebsd-boot ad0

which gives you a 128 block partition starting at block 34, so the next 
free block is 162, and the next partition is explicitly started there in


/sbin/gpart add -b 162 -s 1048576 -t freebsd-ufs ad0

No magic, just arithmetic. :-)
___
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: Advanced Format Drive ?

2012-11-15 Thread Warren Block

On Thu, 15 Nov 2012, Chris Whitehouse wrote:




In messagealpine.bsf.2.00.1211142250370.58...@wonkity.com,


In general, you create a partition scheme first.  This can be MBR,
GPT, or others.  (But use GPT.)


Unless you want to dual boot with WinXP in which case use MBR still?


Yes.  The same for Vista or Windows 7, mostly.  AFAIK, Windows 7 64-bit 
on a UEFI system is the only Windows that will boot from GPT.


As I've said before, consider using VMs rather than dual booting.
___
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: Advanced Format Drive ?

2012-11-15 Thread Warren Block

On Thu, 15 Nov 2012, Ronald F. Guilmette wrote:

In your tutorial document, you say:

Create a boot partition to hold the loader, size of 512K.

How big is that thing (gpart boot loader), actually?  Half a megabyte
seems rather a bit large-ish, certainly relative to ye olde MBR loader,
which I gather was limited to... what?  32KB (minus a little for the
partition table) ?


/boot/gptboot is 15K, /boot/gptzfsboot is 39K.  A code limitation makes 
512K the largest this partition can be made.  So I make it that big so 
it won't have to be increased for bigger boot loaders later.  And the 
space is not wasted because of the next partition...



Also, when creating the partition to hold the GPT boot loader, shouldn't
that gpart add operation include a -b 4k option, you know, on a
modern Advanced Format disk?  If not, why not?


-a 4k, yes.  It doesn't really matter.  The loader is read only at boot, 
once, and it's tiny.  So it doesn't really matter if it reads at 
30M/second or 500M/second.  But yes, for consistency, I'll modify that 
so the start of the freebsd-boot partition is at 40.



You also go on to say:

Create partition for /. It should start at the 1M boundary for proper
sector alignment on 4K sector drives.

Come again?  Sorry, but you just lost me entirely.  In order to get proper
sector alignment on one of these newer Advanced Format (4k) drives, why
on earth should it be necessary to begin a partition at some alignment
which is greater than the obvious minimum, i.e. 4KB ?


Starting the first filesystem partition at 1M is a semi-standard, used 
by various vendors including Microsoft.  Besides being aligned to 4K, 
it's also aligned to bigger values that can be important for performance 
on devices like SSDs.


And that explains the oversized boot partition.  It's space that would 
be unused otherwise.

___
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: Advanced Format Drive ?

2012-11-15 Thread Warren Block

On Thu, 15 Nov 2012, Ronald F. Guilmette wrote:



In message alpine.bsf.2.00.1211142231420.58...@wonkity.com,
Warren Block wbl...@wonkity.com wrote:


On Wed, 14 Nov 2012, Ronald F. Guilmette wrote:
...

Given these facts, I am more than a little surpised to learn (or rather
just to realize) that the good old traditional fdisk and bsdlabel tools
do not have ways to explicitly specify minimum alignment _and_ that
these tools are still being distributed with FreeBSD.


There may be a way, I haven't bothered to look.  As I said, gpart does
everything fdisk and bsdlabel can do.


Well, given that newfs has been ``fixed'' so that its defaults will
Do The Right Thing with the latest generation of (4KB block) disks,
I for one would like to register my vote for fdisk and bsdlabel to
either (a) be likewise fixed so that they also will default to Doing
The Right Thing (with the current generation of disks) or else (b)
be removed from future releases, based on the fact that (apparently)
they are now so old that nobody cares about them anymore and/or that
their defaults, when (foolishly?) relied upon, are likely to produce
Bad Performance, aka Bad Behavior.


It's legacy code, and that's always a tough call: update and lose the 
legacy, or leave it alone and increasingly less useful.  Since gpart is 
available, there's little pressure to change fdisk or bsdlabel.



And also, please don't forget the other points I mentioned, i.e. that
the man page for fdisk makes several references to alignment on ``cylinder''
and/or ``head'' boundaries.  Are those things even relavant anymore?
Have they been, anytime in the past 10+ years?  (I am guessing that
there may be other similarly antiquated references to boundaries that
haven't been meaningful for a long long time also in the bdslabel man
page, although I confess that didn't even look.)


I'd say closer to 20 years.  But again, it's that legacy thing.  And 
with FreeBSD, the odds are pretty good that somebody is still running 
legacy hardware.

___
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: Advanced Format Drive ?

2012-11-15 Thread Ronald F. Guilmette

In message 50a4f2c8.5040...@qeng-ho.org, 
Arthur Chance free...@qeng-ho.org wrote:

On 11/15/12 12:41, Ronald F. Guilmette wrote:
 -b is the beginning block of a partition.  34 is a magic value, the size
 of a standard GPT partition table.

 It probably wouldn't have hurt anything to mention that in the gpart man
 page.

 And what about 162?  Is that magic too?  If so, how?  I seriously do not
 know.

The man example should be taken as a whole. You've got

/sbin/gpart add -b 34 -s 128 -t freebsd-boot ad0

which gives you a 128 block partition starting at block 34, so the next 
free block is 162, and the next partition is explicitly started there in

/sbin/gpart add -b 162 -s 1048576 -t freebsd-ufs ad0

No magic, just arithmetic. :-)

Ah!  Silly me!  Thank you.  (I did miss that.)


Regards,
rfg
___
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: Advanced Format Drive ?

2012-11-15 Thread Ronald F. Guilmette

In message alpine.bsf.2.00.1211150828040.62...@wonkity.com, 
Warren Block wbl...@wonkity.com wrote:

On Thu, 15 Nov 2012, Ronald F. Guilmette wrote:
 In your tutorial document, you say:

 Create a boot partition to hold the loader, size of 512K.

 How big is that thing (gpart boot loader), actually?  Half a megabyte
 seems rather a bit large-ish, certainly relative to ye olde MBR loader,
 which I gather was limited to... what?  32KB (minus a little for the
 partition table) ?

/boot/gptboot is 15K, /boot/gptzfsboot is 39K.  A code limitation makes 
512K the largest this partition can be made.  So I make it that big so 
it won't have to be increased for bigger boot loaders later.

It wouldn't hurt to add the above info to your tutorial page.

And the space is not wasted because of the next partition...

Huh?

Oh, oh, OK.  I read down to the end of your message and now understand.
You meant that the space is not wasted because you will subsequently
arrange to have the next following partition begin at 1MB, yes?

 Also, when creating the partition to hold the GPT boot loader, shouldn't
 that gpart add operation include a -b 4k option, you know, on a
 modern Advanced Format disk?  If not, why not?

-a 4k, yes.

Yea.  Sorry.  That's what I meant... -a 4k.

It doesn't really matter.  The loader is read only at boot, 
once, and it's tiny.  So it doesn't really matter if it reads at 
30M/second or 500M/second.

OK.  I understand.  Thanks.  (I did supect that this was the rationale.)

But yes, for consistency, I'll modify that 
so the start of the freebsd-boot partition is at 40.

It looks prettier that way.

Besides which, you probably want to get your readers in the habit of
doing things generally on 4KB boundaries, because (as I have just learned)
they are probably going to need to start doing that before too long, even
if they don't already need to just yet.

 You also go on to say:

 Create partition for /. It should start at the 1M boundary for proper
 sector alignment on 4K sector drives.

 Come again?  Sorry, but you just lost me entirely.  In order to get proper
 sector alignment on one of these newer Advanced Format (4k) drives, why
 on earth should it be necessary to begin a partition at some alignment
 which is greater than the obvious minimum, i.e. 4KB ?

Starting the first filesystem partition at 1M is a semi-standard, used 
by various vendors including Microsoft.

Yeabut why or how does Microsoft get involved at all with the position
of my *FreeBSD* partition?!?

If I began my FreeBSD partition at, say 768KB, would anything from
Microsoft be even likely to even notice?

Besides being aligned to 4K, it's also aligned to bigger values
that can be important for performance on devices like SSDs.

I see.  That's also another useful tidbit of knowledge that you may also
wish to impart to readers of your tutorial.  I can only speak for myself,
but I for one (perhaps because I have never owned an SSD myself) was
totally unaware that those had any such additional alignment issues.

And that explains the oversized boot partition.  It's space that would 
be unused otherwise.

Got it.  Thanks.


Regards,
rfg


P.S.  I really do think that it is a serious omission that the gpart(8)
man page doesn't really say anything regarding proper or desirable use
of the add -a option.  If it were up to me, I'd put in just a couple
of short notes that would say at least something about 4K being Good and
Desirable for modern drives, and 1M being Good and Desirable for SSDs.

But maybe that kind of info does really belong in something more like
an actual tutorial document... you know... something like, um, your's.
___
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: Advanced Format Drive ? GPT ?

2012-11-15 Thread Al Plant

Warren Block wrote:

On Wed, 14 Nov 2012, Ronald F. Guilmette wrote:


I'm looking at the examples section of the gpart(8) man page.  May I
assume that if I just want to merely ``try out'' GPT... you know...
taking it out on the road for a first time test run... that I can
just do the first five (5) commands listed under EXAMPLES and then
that will be enough to go ahead and try installing FreeBSD into the
created freebsd-ufs partition?

Even assuming that the answer is yes, I have still more questions...
Where are these magic numbers coming from??  I am specifically talking
about the number 34 in the -b 34 option and also the number 162
in the -b 162 option.  Tha man page just tosses those into the example
command lines without saying a word about them.  And you can probably
guess what it is that is especially troubling to me about them... neither
one of them is divisible by 8 (i.e. 4KB/512B).  So would the examples
in the current gpart(8) man page produce an Epic Fail when and if they
were used with a modern Advanced Format drive?


-b is the beginning block of a partition.  34 is a magic value, the size 
of a standard GPT partition table.  A good overall reference on GPT is 
the Wikipedia page: http://en.wikipedia.org/wiki/GUID_Partition_Table


Remember that the man page is a reference, not a tutorial.  I wanted 
more specific notes that followed best practices, and that was the 
source for this article:

http://www.wonkity.com/~wblock/docs/html/disksetup.html

In general, you create a partition scheme first.  This can be MBR, 
GPT, or others.  (But use GPT.)


Rather than combine the bootcode with the partition table, GPT just uses 
a small partition for it.  Since the standard GPT allows for up to 128 
partitions, there's no reason not to use them.


Next come other partitions for UFS or ZFS filesystems or swap.

That's it, really.  The rest is details the man page can explain, like 
additional options for alignment.  (The creation of the first UFS 
partition in the article does not use -a because older versions of gpart 
did unexpected things when -a and -b were combined.  The alignment 
produced is correct.)

___
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





Aloha Warren,


I looked over the GPT sample and have a question.

In the fstab entries, something that uses msdosfs, (thumb drive maybe).

Can you enter it directly in the fstab after the basic partitions and 
other /dev have been entered in the initial setup?


Thanks.


~Al Plant - Honolulu, Hawaii -  Phone:  808-284-2740
  + http://hawaiidakine.com + http://freebsdinfo.org +
  + http://aloha50.net   - Supporting - FreeBSD  7.2 - 8.0 - 9* +
   email: n...@hdk5.net 
All that's really worth doing is what we do for others.- Lewis Carrol

___
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: Advanced Format Drive ?

2012-11-15 Thread Ronald F. Guilmette

In message alpine.bsf.2.00.1211150844350.62...@wonkity.com, 
Warren Block wbl...@wonkity.com wrote:

On Thu, 15 Nov 2012, Ronald F. Guilmette wrote:
 Well, given that newfs has been ``fixed'' so that its defaults will
 Do The Right Thing with the latest generation of (4KB block) disks,
 I for one would like to register my vote for fdisk and bsdlabel to
 either (a) be likewise fixed so that they also will default to Doing
 The Right Thing (with the current generation of disks) or else (b)
 be removed from future releases, based on the fact that (apparently)
 they are now so old that nobody cares about them anymore and/or that
 their defaults, when (foolishly?) relied upon, are likely to produce
 Bad Performance, aka Bad Behavior.

It's legacy code, and that's always a tough call: update and lose the 
legacy, or leave it alone and increasingly less useful.  Since gpart is 
available, there's little pressure to change fdisk or bsdlabel.

Well, I'll tell you seriously that I, for one, didn't get the memo
as the saying goes.  Honestly, this discussion is the first time that
I personally ever heard that fdisk and/or bsdlabel were being relegated
to the dustbin of history.  (But then again, I don't get out much, or
enough, it seems.)

Maybe the man pages should contain notes/warnings saying explicitly
This tool is now depreciated in favor of gpart.  What do you think?
Is that a suggestion worthy of a formal PR?

 And also, please don't forget the other points I mentioned, i.e. that
 the man page for fdisk makes several references to alignment on ``cylinder''
 and/or ``head'' boundaries.  Are those things even relavant anymore?
 Have they been, anytime in the past 10+ years?  (I am guessing that
 there may be other similarly antiquated references to boundaries that
 haven't been meaningful for a long long time also in the bdslabel man
 page, although I confess that didn't even look.)

I'd say closer to 20 years.

Um yea.  That's probably closer to the mark.  Sigh.  Time flies when you're
having fun.  (And they also like arrows, I'm told.)

But again, it's that legacy thing.  And 
with FreeBSD, the odds are pretty good that somebody is still running 
legacy hardware.

Yea, you are undoubtedly right about that.

I wonder... can FreeBSD still run on 386s?

I can envision a humorous boot-time message that somebody may see someday...

 Sorry, FreeBSD cannot run on this hardware.
 Please invest in something that was actually
 manufactured this century (20xx).

:-)
___
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: Advanced Format Drive ?

2012-11-15 Thread Warren Block

On Thu, 15 Nov 2012, Ronald F. Guilmette wrote:


In message alpine.bsf.2.00.1211150828040.62...@wonkity.com,
Warren Block wbl...@wonkity.com wrote:


On Thu, 15 Nov 2012, Ronald F. Guilmette wrote:

In your tutorial document, you say:

Create a boot partition to hold the loader, size of 512K.

How big is that thing (gpart boot loader), actually?  Half a megabyte
seems rather a bit large-ish, certainly relative to ye olde MBR loader,
which I gather was limited to... what?  32KB (minus a little for the
partition table) ?


/boot/gptboot is 15K, /boot/gptzfsboot is 39K.  A code limitation makes
512K the largest this partition can be made.  So I make it that big so
it won't have to be increased for bigger boot loaders later.


It wouldn't hurt to add the above info to your tutorial page.


The problem with that sort of detail is that too much of it obscures the 
point, which in this case is just trying to show the right way to set up 
disks without overwhelming the reader.



And the space is not wasted because of the next partition...


Huh?

Oh, oh, OK.  I read down to the end of your message and now understand.
You meant that the space is not wasted because you will subsequently
arrange to have the next following partition begin at 1MB, yes?


Yes.


Besides which, you probably want to get your readers in the habit of
doing things generally on 4KB boundaries, because (as I have just learned)
they are probably going to need to start doing that before too long, even
if they don't already need to just yet.


It does do that, although it's not overt.


Starting the first filesystem partition at 1M is a semi-standard, used
by various vendors including Microsoft.


Yeabut why or how does Microsoft get involved at all with the position
of my *FreeBSD* partition?!?


There are other vendors and some RAID systems that also use 1M as a 
starting point.  Sticking to that de facto standard helps keep us as 
compatible as possible with other systems and partitioning software. 
The cost in space is tiny, and it's a lot easier to do when setting up 
the disk than after the filesystems are populated.



If I began my FreeBSD partition at, say 768KB, would anything from
Microsoft be even likely to even notice?


I can't say I've tested it.  I see this as low-cost insurance.  For less 
than 1M of space, try to be as compatible with other systems and 
software that exists.



Besides being aligned to 4K, it's also aligned to bigger values
that can be important for performance on devices like SSDs.


I see.  That's also another useful tidbit of knowledge that you may also
wish to impart to readers of your tutorial.  I can only speak for myself,
but I for one (perhaps because I have never owned an SSD myself) was
totally unaware that those had any such additional alignment issues.


Again, I'm trying to avoid too much of that type of detail in that 
particular article.  I've considered writing a separate SSD article, but 
have not done it yet.



P.S.  I really do think that it is a serious omission that the gpart(8)
man page doesn't really say anything regarding proper or desirable use
of the add -a option.  If it were up to me, I'd put in just a couple
of short notes that would say at least something about 4K being Good and
Desirable for modern drives, and 1M being Good and Desirable for SSDs.

But maybe that kind of info does really belong in something more like
an actual tutorial document... you know... something like, um, your's.


I can see it both ways.  A short mention of those values in that section 
of gpart(8) would be helpful.  The 1M value is controversial to some 
people.  Of course, some people think that calling bare bsdlabel disks 
dangerously dedicated or using an MBR is controversial.

___
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: Advanced Format Drive ?

2012-11-15 Thread Ronald F. Guilmette

In message alpine.bsf.2.00.1211151456450.66...@wonkity.com, 
Warren Block wbl...@wonkity.com wrote:

 It wouldn't hurt to add the above info to your tutorial page.

The problem with that sort of detail is that too much of it obscures the 
point, which in this case is just trying to show the right way to set up 
disks without overwhelming the reader.

personal opinion
Some things are inherently overwhelming, and there is no use to try to
hide the fact.  It just makes matters worse.
/personal opinion

 P.S.  I really do think that it is a serious omission that the gpart(8)
 man page doesn't really say anything regarding proper or desirable use
 of the add -a option.  If it were up to me, I'd put in just a couple
 of short notes that would say at least something about 4K being Good and
 Desirable for modern drives, and 1M being Good and Desirable for SSDs.

 But maybe that kind of info does really belong in something more like
 an actual tutorial document... you know... something like, um, your's.

I can see it both ways.  A short mention of those values in that section 
of gpart(8) would be helpful.  The 1M value is controversial to some 
people.

Yeabut for some people, even evolution is controversial.

Of course, some people think that calling bare bsdlabel disks 
dangerously dedicated or using an MBR is controversial.

Actually, you can count me among the folks who think that the adjective
dangerously may be stretching it a bit, in this context.
___
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: Advanced Format Drive ?

2012-11-15 Thread Ronald F. Guilmette


Warren,

In the EXAMPLES section of the gpart(8) man page, they do this:

 /sbin/gpart bootcode -b /boot/pmbr ad0

In your document however, you first create an explicit (special) partition
named gpboot and then you do this instead:

gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 da0

Who is right in this case?

I did the former, and did not get any error.

The gpart(8) man page says:

 ... First, a protective MBR is embedded into the first disk sector from
 the /boot/pmbr image...

however it appears to me that the steps in your tutorial are effectively
installing a copy of the /boot/pmbr file into block #40 of the disk.  Yes?
But isn't a copy of /boot/pmbr really supposed to end up in the first 512
bytes of the disk, i.e. block #0 ?
___
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: Advanced Format Drive ? GPT ?

2012-11-15 Thread Warren Block

On Thu, 15 Nov 2012, Al Plant wrote:


I looked over the GPT sample and have a question.

In the fstab entries, something that uses msdosfs, (thumb drive maybe).

Can you enter it directly in the fstab after the basic partitions and other 
/dev have been entered in the initial setup?


Short answer: yes, but...

Longer answer: most flash drives have an MBR partition setup with one 
partition filling the whole device.  Since it's not GPT, it won't/can't 
have GPT labels on the partitions.  But the GEOM system will create a 
label for the MSDOS filesystem if it has been given a volume name.  That 
label will appear in /dev/msdosfs/ and can be used in an /etc/fstab 
entry.

___
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: Advanced Format Drive ?

2012-11-15 Thread Ronald F. Guilmette

(This stuff would probably be a lot less confiusing if I actually knew
what I was doing, but...)

OK, Warren, I've just done the following steps.  The first two I drew
from the manpage examples, and then followed those up with two commands
from your tutorial.

  /sbin/gpart create -s GPT ada0# manpage example is wrong, ad0 - ada0
  /sbin/gpart bootcode -b /boot/mbr ad0  # manpage wrong again, pmbr - mbr
  gpart add -t freebsd-boot -l gpboot -b 40 -s 512K ada0
  gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ada0

That last one, done at the suggestion of your tutorial page, has me
completely perplexed, because of what is said, very explicitly, in the
gpart(8) manpage:

 bootcode  Embed bootstrap code into the partitioning scheme's metadata on
   the geom (using -b bootcode) or write bootstrap code into a
   partition (using -p partcode and -i index).

Please note the use of the word or.

The man page is telling me to _either_ use the -p option _or else_ use
the -p and -i options together.  But you are telling me to use all three
in one go!

Forgive me, but I'm confused.  (As you can tell by now, I am often easily
confused.  Sorry.)
___
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: Advanced Format Drive ?

2012-11-15 Thread Ronald F. Guilmette


NEVERMIND!

It took me awhile, but I think I've finally got the hang of this gpart/GPT
stuff... well... mostly anyway (but see below).

I understand now that /boot/mbr is a regular sort of MBR, with regular
sort of MBR bootstrap code, whereas /boot/pbmr is the ``protected'' MBR
record that says, in effect I am not a normal MBR.  I am special and
I'm here to tell you that this drive actually uses the GPT scheme.

I've also figured out that despite the gpart(8) man page's unfortunate
use of the word or, it is evidently the case that when doing gpart
bootcode ... it is perfectly OK to use all three of the -b, -p, and -i
options together, and that doing so has (I think) the equivalent effect
to invoking gpart bootcode ... once with only the -b option and then
once again with only the -p and -i options together.

I think that I have only two final questions:

1)  I can't remember now if the ``guided'' partitioning approach that
is offered to folks who are installing FreeBSD 9.x itself offers a
GPT option or not.  Does it?  (If not, and if MBR is really now
considered antiquated, then I would think that the install process
really should offer a GPT option, if it isn't doing so already.)

2)  Not knowing any better, on this fresh install that I'm doing now
(of 9.1-RC3) when it got down to the point where it asked me how I wanted
to partition, I selected the exit to shell option.  Once I got a
shell prompt, I proceeded to do bascially everything that's suggested
in the The New Standard Method section of Warren's nice tutorial.
My assumption was that I could do this, get all of my shiny new GPT
partitions just the way I wanted them, and just simply exit the shell...
an action which, I had hoped, would return me to the install process
at a point where I would then be asked to assign mount points to each
of my newly created GPT partitions, and then, hopefully, the rest of the
install process would proceed in an entirely customary way.

Sadly, this did not happen.  After exiting from the shell, the install
process _did_ resume, however the first thing it did was to check the
integrity of the distributions (kernel+base) that I had selected earlier,
and once it was satisfied that they were OK, it immediately started to
try to extract everything from those two distribution files.

It is easy to undeerstand why this last step failed virtually immediately
with the error message:

  Error while extracting base.txz:
  Can't set user=0/group=0 for
  .Can't update time for .

Obviously (and quite reasonably) the install process did not have any
clear idea of where exactly it was supposed to be extracting the files
to, because I had not even assigned mount points for any of my brand new
GPT partitions yet.

So, um, I'm wondering... Is this a bug, or a feature of the current
FreeBSD install process?  Should I be filing a PR on this?


-=-=-=-=-=-=-=-=-=-=-=-=-

A footnote:  Since my first try at installing using a GPT partitioning
scheme crashed and burned (as described above), I naturally hit the
reset button on the machine in question and just started over from
the beginning of the whole install process, hoping that I would (this
time) be able to make use of the various GPT partitions that I had
already set up.  (See above.)

After the obligatory preliminary questions, I finally I came to the place
in the process where it wanted to know if I wanted to do guided, manual, or
shell partitioning.  At this point, I figured that it made little difference
which one I choose (because I'd already created the partitions, and even
newfs'd them all) and now I only needed to assign mount points.  So I
selected the easy choice...  guided... and immediately I got an error
message that said there is not enough free space on the drive to install
FreeBSD.  (Gr!)  Oh well!  Along with that error message, I was given
an option to open the partition editor, so I took that option and then
just assigned proper mount points to all of the partitions that I'd already
created, and then, finally, I clicked on Finish.

From there, everything went fine and I successfully installed a minimal
9.1-RC3 system, and then successfully booted it.

But then I started to wonder if maybe Warren had left out the instructions
for performing this final critical step (assigning mount points) in his
tutorial, so I went back and looked at it to see if he had mentioned it,
and I see that it doesn't say a word about mount points.

Warren?  Was this a deliberate or inadvertant ommission?  Is the subject
of mount points outside of the scope of what you had been intending to
cover in your tutorial?

And how exactly do mount points get associated with partitions (in particular
GPT partitions) anyway?  Are these just another partition attribute?  The
gpart(8) man page is also utterly silent on the subject of mount points,
even though they are quite obviously a rather critical component of what
it takes to make a partition useful on/to FreeBSD.


P.S.  Assigning 

Re: Advanced Format Drive ?

2012-11-15 Thread Warren Block

On Thu, 15 Nov 2012, Ronald F. Guilmette wrote:


I think that I have only two final questions:

1)  I can't remember now if the ``guided'' partitioning approach that
is offered to folks who are installing FreeBSD 9.x itself offers a
GPT option or not.  Does it?  (If not, and if MBR is really now
considered antiquated, then I would think that the install process
really should offer a GPT option, if it isn't doing so already.)


GPT is the default for bsdinstall.


2)  Not knowing any better, on this fresh install that I'm doing now
(of 9.1-RC3) when it got down to the point where it asked me how I wanted
to partition, I selected the exit to shell option.  Once I got a
shell prompt, I proceeded to do bascially everything that's suggested
in the The New Standard Method section of Warren's nice tutorial.
My assumption was that I could do this, get all of my shiny new GPT
partitions just the way I wanted them, and just simply exit the shell...
an action which, I had hoped, would return me to the install process
at a point where I would then be asked to assign mount points to each
of my newly created GPT partitions, and then, hopefully, the rest of the
install process would proceed in an entirely customary way.


It would, but you have to mount the new filesystems in a certain spot. 
bsdinstall shows a prompt about that.



And how exactly do mount points get associated with partitions (in particular
GPT partitions) anyway?  Are these just another partition attribute?  The
gpart(8) man page is also utterly silent on the subject of mount points,
even though they are quite obviously a rather critical component of what
it takes to make a partition useful on/to FreeBSD.


GPT partitions appear in /dev as the drive name followed by p and the 
partition number, similar to the old slice/partition notation.  So 
instead of /dev/ada0s1a, it will typically be /dev/ada0p2.  These are 
entered in /etc/fstab as normal.


My guide uses GPT labels, which are superior in many ways to fixed 
device names, but also not really covered by that article.



P.S.  Assigning mount points appears to be one thing that the new swiss-
army-knife of gpart _cannot_ do.  Given that, I have to ask...
What if any command line tool is available to associate partitions with
mount points?


/etc/fstab, same as normal.
___
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: Advanced Format Drive ?

2012-11-14 Thread Warren Block

On Wed, 14 Nov 2012, Ronald F. Guilmette wrote:


I'm looking at the examples section of the gpart(8) man page.  May I
assume that if I just want to merely ``try out'' GPT... you know...
taking it out on the road for a first time test run... that I can
just do the first five (5) commands listed under EXAMPLES and then
that will be enough to go ahead and try installing FreeBSD into the
created freebsd-ufs partition?

Even assuming that the answer is yes, I have still more questions...
Where are these magic numbers coming from??  I am specifically talking
about the number 34 in the -b 34 option and also the number 162
in the -b 162 option.  Tha man page just tosses those into the example
command lines without saying a word about them.  And you can probably
guess what it is that is especially troubling to me about them... neither
one of them is divisible by 8 (i.e. 4KB/512B).  So would the examples
in the current gpart(8) man page produce an Epic Fail when and if they
were used with a modern Advanced Format drive?


-b is the beginning block of a partition.  34 is a magic value, the size 
of a standard GPT partition table.  A good overall reference on GPT is 
the Wikipedia page: http://en.wikipedia.org/wiki/GUID_Partition_Table


Remember that the man page is a reference, not a tutorial.  I wanted 
more specific notes that followed best practices, and that was the 
source for this article:

http://www.wonkity.com/~wblock/docs/html/disksetup.html

In general, you create a partition scheme first.  This can be MBR, 
GPT, or others.  (But use GPT.)


Rather than combine the bootcode with the partition table, GPT just uses 
a small partition for it.  Since the standard GPT allows for up to 128 
partitions, there's no reason not to use them.


Next come other partitions for UFS or ZFS filesystems or swap.

That's it, really.  The rest is details the man page can explain, like 
additional options for alignment.  (The creation of the first UFS 
partition in the article does not use -a because older versions of gpart 
did unexpected things when -a and -b were combined.  The alignment 
produced is correct.)

___
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: Advanced Format Drive ?

2012-11-13 Thread Arthur Chance

On 11/13/12 06:30, Polytropon wrote:

On Mon, 12 Nov 2012 22:14:11 -0800, Ronald F. Guilmette wrote:

Which partitions need to be aligned to the 4KB boundaries?
The FreeBSD ones, the MBR ones, or both?


The partitions, all of them. :-)

For MBR partitions, the DOS primary partitions, which are
slices, you typically only need one if you want to stay in
compatibility mode. For dedicated mode, you don't need it.

The slice typically starts in sector 63 and occupies the
space until the end of the device.

The partitions within the slice should have sizes of
multiples of 1 MB or 1 GB (which makes them multiples
of 4k easily).

See:
http://www.freebsd.org/doc/handbook/bsdinstall-partitioning.html

Even though the handbook elaborates on the GPT approach, it
will work with traditional disklabel partitioning too.

Note that 4k = 8 x 512 byte, and so 64 sectors would be a
good alignment grid, while 63 sectors is not. That implies
that in case you use fdisk to create a slice holding your
partitions, try to make it start at sector 64 (63 would
have been the default).

After that, use bsdlabel to create the partitions inside
the slice as you want. Make them multiples of 1M or 1G,
that should be no big deal because disks are big and cheap
today. :-)

You can then easily use newfs with the -f parameter:

newfs -U -f 4096 device

This will make sure the proper fragment size will be applied
upon formatting the created partitions.

Also see:
http://www.wonkity.com/~wblock/docs/html/disksetup.html

As I have limited experience, anyone having more practical
experience with this matter is welcome to comment. :-)


According to the manual as of 9.0-RELEASE the default fragment and block 
sizes for newfs are 4k and 32k, so provided your partitions/slices are 
4k aligned everything Should Just Work. Before 9.0 fragments and blocks 
were 2k and 16k which doesn't play so well with 4k drives.


___
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: Advanced Format Drive ?

2012-11-13 Thread Warren Block

On Mon, 12 Nov 2012, Ronald F. Guilmette wrote:



In message 20121113065602.ee2310d7.free...@edvax.de,
Polytropon free...@edvax.de wrote:


On Mon, 12 Nov 2012 21:47:40 -0800, Ronald F. Guilmette wrote:

Is there _anything_ that I will have to do differently than I did for the
last 20 drives I've used with FreeBSD over the last 10+ years?


As far as I know, the old ways still work as intended.
I've been initalizing 1 TB and 1.5 TB disks the old way,
using sysinstall (to create a slice, then to create the
partitions) and newfs (to format the 2nd data disk). So
far, the disks are working for some years without trouble.
Those are normal disks, not SSDs, purchased few years
ago.

The term advanced format is usually used for 4k-sectorized
disks (in difference to traditional 512k sectors).

You can find more here:
http://en.wikipedia.org/wiki/Advanced_Format

The implication for FreeBSD is (and has been for some time)
to align partitions at a 4k border. If you create partition
sizes as multiples of 4k, it should be fine.


Thank you.

Which partitions need to be aligned to the 4KB boundaries?
The FreeBSD ones, the MBR ones, or both?


The ones you want to be fast instead of half-speed.

The easy way to do it is to jettison the old MBR slice/partition stuff 
and use the simpler GPT.


The first half of this document shows how to set it up:
http://www.wonkity.com/~wblock/docs/html/disksetup.html
___
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: Advanced Format Drive ?

2012-11-13 Thread Ronald F. Guilmette

In message 20121113073030.87bc0608.free...@edvax.de, 
Polytropon free...@edvax.de wrote:

Note that 4k = 8 x 512 byte, and so 64 sectors would be a
good alignment grid, while 63 sectors is not. That implies
that in case you use fdisk to create a slice holding your
partitions, try to make it start at sector 64 (63 would
have been the default).

OK.  I've only ever used the FreeBSD fdisk to just look at what the
current (DOS) partitioning is, so I guess I'll have to dig into the
man page and try to figure out how to actually use it to create a
DOS partition starting at block 64.

After that, use bsdlabel to create the partitions inside
the slice as you want. Make them multiples of 1M or 1G,

OK.  I think that I always was doing that anyway.  But I want to be sure
that I understand... If the size of the BSD partition is a multiple of,
say, !MB, then the _alignment_ of that partition will likewise (auto-
magically) be at least 1MB also?  Or do I need to set the alignment
separately, e.g. my manually running bsdlabel?  (Normally, I've just
been using what noadays is being called guided partitioning, you
know, with the friendly curses-based GUI.  So As with fdisk, I have
no real experience using bsdlabee from teh command line.  But I guess
it is time that i learned how.)

that should be no big deal because disks are big and cheap
today. :-)

Yes, exactly so.  I am not exactly going to sweat losing even, say,
one megabyte now that I am the proud owner of a shiny new one TERABYTE
drive.  (Thirty years ago, I could hardly have even ever imagined that
such might exist one day, let alone that I myself would own one, and
let alone that I might have been able to purchase one for less than
$100 USD.  Rather amazing really.)

You can then easily use newfs with the -f parameter:

   newfs -U -f 4096 device

This will make sure the proper fragment size will be applied
upon formatting the created partitions.

OK.  Thanks.  I am guessing that this is really the one and probably
_only_ thing that might really make any significant difference, performance-
wise, right?  I mean if the partition is improperly aligned, that really
only would affect reading and/or writing at the very beginning or at the
very end of the partition, right?  Whereas this -f parameter for newfs
is, I gather, the thing that really tells the kernel the size of the
physical chunks of data that it can/should read/write to the drive at
any one time, right?

And while we are on the subject... Has anybody ever down any analysis
(i.e. benchmarking) to find out if -f 4096 is even the best number for
a modern high(er) capacity drive?  I'm just sort-of wondering if 8192
or 16384 might be better.

___
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: Advanced Format Drive ?

2012-11-13 Thread Ronald F. Guilmette

In message 50a2002b.9040...@qeng-ho.org, 
Arthur Chance free...@qeng-ho.org wrote:

According to the manual as of 9.0-RELEASE the default fragment and block 
sizes for newfs are 4k and 32k, so provided your partitions/slices are 
4k aligned everything Should Just Work. Before 9.0 fragments and blocks 
were 2k and 16k which doesn't play so well with 4k drives.

Thank you Arthur for pointing this out.  This comes as welcome news,
since now, it would seem, I won't have to get down a grunge around
trying to run the command line versions of fdisk, bsdlabel, and newfs.
(Normally, I prefer doing most things from the command line, but
initializing new disks for use with FreeBSD is one of the rare
exceptional cases where I prefer to have a bit of a GUI wrapper that's
double checking to make sure that I don't do anything completely
goofy.)
___
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: Advanced Format Drive ?

2012-11-13 Thread Robert Bonomi

 From: Ronald F. Guilmette r...@tristatelogic.com
 Subject: Re: Advanced Format Drive ?
 Date: Tue, 13 Nov 2012 14:07:50 -0800


 And while we are on the subject... Has anybody ever down any analysis
 (i.e. benchmarking) to find out if -f 4096 is even the best number for
 a modern high(er) capacity drive?  I'm just sort-of wondering if 8192
 or 16384 might be better.

As long as the fragment size is a power-of-two multiple of the media sector
size, there is no significant performance difference.  The only case where
a larger fragment size makes any difference is heavy random i/o on files
where the larger fragment size translates to one less level of indirect
block in the meta-data.

Larger fragment sizes also make for more 'waste' space in the 'used'
part of the disk, assuming random file sizes.

And reduce the space savings gained by _not_ writing 'holes' to disk.

For these reasons, in general, small is better.

 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

___
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: Advanced Format Drive ?

2012-11-13 Thread David Brodbeck
On Tue, Nov 13, 2012 at 2:07 PM, Ronald F. Guilmette
r...@tristatelogic.comwrote:

 You can then easily use newfs with the -f parameter:
 
newfs -U -f 4096 device
 
 This will make sure the proper fragment size will be applied
 upon formatting the created partitions.

 OK.  Thanks.  I am guessing that this is really the one and probably
 _only_ thing that might really make any significant difference,
 performance-
 wise, right?  I mean if the partition is improperly aligned, that really
 only would affect reading and/or writing at the very beginning or at the
 very end of the partition, right?


No, I think it'll affect the whole thing, because every block will be
straddling two 4k sectors instead of filling one.  Then the drive has to
read and rewrite two sectors for every one block you write, instead of just
one, slowing things down to half speed.

Imagine running across the top of a picket fence...if you start half a
fencepost off things are going to be painful. ;)
___
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: Advanced Format Drive ?

2012-11-13 Thread Warren Block

On Tue, 13 Nov 2012, Ronald F. Guilmette wrote:


OK.  I think that I always was doing that anyway.  But I want to be sure
that I understand... If the size of the BSD partition is a multiple of,
say, !MB, then the _alignment_ of that partition will likewise (auto-
magically) be at least 1MB also?


No.  If you start with $0.63, and only add full dollars or tens, you 
will still never have an integer amount of dollars.


Or do I need to set the alignment separately, e.g. my manually running 
bsdlabel?  (Normally, I've just been using what noadays is being 
called guided partitioning, you know, with the friendly curses-based 
GUI.  So As with fdisk, I have no real experience using bsdlabee from 
teh command line.  But I guess it is time that i learned how.)


I don't know of a way to make fdisk and bsdlabel do the correct 
alignment.  But that's okay, because gpart(8) does everything they do, 
and more.  Creating MBRs and bsdlabels is more work, but gpart can do 
it, and do the juggling to get the bsdlabel partitions to line up. 
Again, I suggest that GPT is the much easier and more versatile way. 
But if you insist on MBR/bsdlabel, there are examples of creating it 
with gpart in the new gmirror section of the GEOM chapter of the 
Handbook:


http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/geom-mirror.html
___
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