From owner-freebsd-questions@freebsd.org Sat Feb 16 17:57:39 2019 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFE5614EFE44 for ; Sat, 16 Feb 2019 17:57:39 +0000 (UTC) (envelope-from matthias@smormegpa.no) Received: from mailrelay1-1.pub.mailoutpod1-cph3.one.com (mailrelay1-1.pub.mailoutpod1-cph3.one.com [46.30.210.182]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D8CF94597 for ; Sat, 16 Feb 2019 17:57:37 +0000 (UTC) (envelope-from matthias@smormegpa.no) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smormegpa.no; s=20140924; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=mU4kHShnX7UpSg37AUMBkHUKE8bhd4NSqRc9ROWsuPA=; b=Vu/9g5WgYzGCYku7a23Y4o5vwwgfeAQej4Dop0rHqxw3CVZapQ7of/eHRrK8NXCygAuZDtvf7myHP hlgVS6PuK9a2qfDxZ6k/U9IFCFDohic7Di4tG5po3uVEZULsMTcexaMzhXedP8lj3BZgU2kR5w9/gx +At+Op4SepDHdmmQ= X-HalOne-Cookie: 2a76253dfaf15cbd29fff78c7e65c03974f49b69 X-HalOne-ID: 146570a2-3212-11e9-94f2-d0431ea8a283 Received: from picadelly.monsieur.mathieu (unknown [85.165.244.175]) by mailrelay1.pub.mailoutpod1-cph3.one.com (Halon) with ESMTPSA id 146570a2-3212-11e9-94f2-d0431ea8a283; Sat, 16 Feb 2019 17:41:24 +0000 (UTC) Message-ID: <53922cb7f04e5399ee5f71dab24d9ee0c1536a10.camel@smormegpa.no> Subject: Re: Sector size change with camcontrol From: Matthias Oestreicher To: freebsd-questions@freebsd.org Date: Sat, 16 Feb 2019 18:41:24 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4D8CF94597 X-Spamd-Bar: ++++ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=smormegpa.no header.s=20140924 header.b=Vu/9g5Wg X-Spamd-Result: default: False [4.05 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[smormegpa.no:s=20140924]; FROM_HAS_DN(0.00)[]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[smormegpa.no]; NEURAL_SPAM_MEDIUM(1.00)[0.997,0]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_SPAM_SHORT(0.93)[0.930,0]; MX_GOOD(-0.01)[cached: mx1.pub.mailpod3-cph3.one.com]; DKIM_TRACE(0.00)[smormegpa.no:+]; RCVD_IN_DNSWL_NONE(0.00)[182.210.30.46.list.dnswl.org : 127.0.5.0]; NEURAL_SPAM_LONG(0.99)[0.988,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; IP_SCORE(0.94)[ipnet: 46.30.208.0/21(2.78), asn: 51468(1.98), country: DK(-0.05)]; ASN(0.00)[asn:51468, ipnet:46.30.208.0/21, country:DK]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Feb 2019 17:57:40 -0000 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"