Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Feb 2019 18:41:24 +0100
From:      Matthias Oestreicher <matthias@smormegpa.no>
To:        freebsd-questions@freebsd.org
Subject:   Re: Sector size change with camcontrol
Message-ID:  <53922cb7f04e5399ee5f71dab24d9ee0c1536a10.camel@smormegpa.no>
In-Reply-To: <b34979ac-d41c-413a-9ce8-c66b40d41512@wp.pl>
References:  <b34979ac-d41c-413a-9ce8-c66b40d41512@wp.pl>

next in thread | previous in thread | raw e-mail | index | archive | help
Am Samstag, den 16.02.2019, 10:39 +0100 schrieb Ireneusz Pluta:
> Hello,
> 
> In my new SEAGATE ST900MP0146 drives I want to change sector size
> from factory default 512E to 4kN. 
> The drive manual (i.e. 
> 
https://www.seagate.com/www-content/product-content/enterprise-performance-savvio-fam/enterprise-performance-15k-hdd/ent-perf-15k-6/en-us/docs/100827313b.pdf)
>  
> says how to do it:
> 
> Mode Select - Parameter list header
> • Set Write buffer: // Set Block Descriptor Length = 0x08, Number of
> LBA's = 0xFFFFFFFF
> • 00 00 00 00 00 00 00 08 FF FF FF FF 00 00 02 00 // Set block size
> to 0512 (0x0200)
> • 10 00 // Set block size to 4096 (0x1000)
> • Then Send Mode Select Command
> • cdb: 55 01 00 00 00 00 00 00 10 00 // (SP bit = 1, Parameter list =
> 0x10)
> Format Unit - Parameter list header
> • Set Write buffer: // Set IMMED = 1
> • 00 02 00 00
> • Then Send Format Unit Command
> • cdb: 04 14 00 00 01 00 // (FMTDAT = 1, DEFECT LIST FORMAT = 010b,
> FFMT = 01b)
> 
> Does the above convert to the following two camcontrol cmds?
> 
> $ camcontrol cmd /dev/da0 -v \
>       -c '55 01 00 00 00 00 00 00 10 00' \
>       -o 16 '00 00 00 00 00 00 00 08 FF FF FF FF 00 00 10 00'
> $ camcontrol cmd /dev/da0 -v \
>       -c '04 14 00 00 01 00' \
>       -o 4 '00 02 00 00'
> 
There is no way to change a drive's physical sector size.
What may be changed, is what the drive reports to be.
The claim in the manual, it would really change the drive's sector size
surprised me. I googled up an explanation of what's really happinging
here:

https://www.seagate.com/files/www-content/product-content/enterprise-performance-savvio-fam/enterprise-performance-15k-hdd/_cross-product/_shared/doc/seagate-fast-format-white-paper-04tp699-1-1701us.pdf
For me it looks like, it just changes what the drives reports (512 or
4096 bytes sectors) and formats the drive with "a filesystem". That
actually sounds very M$ like and will be NTFS I guess with the right
sector size and alignments.
Since there is talk about legacy OSes and hardware, that are not aware
of, that 4K drives exist, it's just to make those drives work.

In FreeBSD you just set the alignment accordingly with

	# gpart add -a 4096 ....

and your good.

In addition for ZFS. To not shoot yourself in the foot with ZFS when
you use 512 and 4096 byte drives. To create a 4K pools, just set the
sysctl

	# sysctl vfs.zfs.min_auto_ashift=12

before creating it.
Then throw in a mix of drives that report to be either 512 and 4096
sector drives, as you like. Or 512 byte sector drives only, to replace
them with 4K drives later.

To break it down, I'd say it's just a thing to help old Windows
versions (and maybe old raid controllers?) to work with those 4k
drives. As from the manual, your drive is physically a 4K drive
already, even if it REPORTS to have a sector size of 512 bytes.
It's irrelevant what the drives reports in FreeBSD.

Hope this helps.

Best regards
Matthias

 

> Thanks,
> Irek.
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "
> freebsd-questions-unsubscribe@freebsd.org"








Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?53922cb7f04e5399ee5f71dab24d9ee0c1536a10.camel>