From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 8 01:58:05 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB34F1065677; Sun, 8 Aug 2010 01:58:05 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 304B58FC15; Sun, 8 Aug 2010 01:58:04 +0000 (UTC) Received: by qwg5 with SMTP id 5so5019913qwg.13 for ; Sat, 07 Aug 2010 18:58:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:sender:received:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=jBE+L73ix3z1Tos4QtHAuLwsi46t5VLZzSVwncCfqbU=; b=uUR5+2SSrAF7mZymGzJXeRG9wOXByPeiwqCINt+dHY9vFKZK7mN+vQJIseEXLGLieP //z3xp68VRG4iBEjkDlzjNq9KELtfQW9bR/ZOMgxUJ598UpL38/qwpACfOasL3brgLtF CA7OHoix5tWn5fwAq7LiEFwM3HopC6Vw4jIp0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:from:date:x-google-sender-auth:message-id :subject:to:content-type; b=t8fGv3B9iJNB8SAHgXrO0hVKOjxG0kL8KzvFjoh1rEWAXIDMp9HHN5iBbsL68LEj+n BkPJuAW9/OH50dY7qlts0i1ofE+k6xAMkmCrggxBeTLGmV3Vy6JANTzWhOuJqlkdRb5R zHCKdyXMGAjkjEgisigHlMtdj2h77xapVAa+k= Received: by 10.229.220.20 with SMTP id hw20mr6063242qcb.94.1281232684213; Sat, 07 Aug 2010 18:58:04 -0700 (PDT) MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.229.236.132 with HTTP; Sat, 7 Aug 2010 18:57:44 -0700 (PDT) From: Ivan Voras Date: Sun, 8 Aug 2010 03:57:44 +0200 X-Google-Sender-Auth: vwreAXHwgWrq2moCGdW1UbLKvlk Message-ID: To: Pawel Jakub Dawidek , freebsd-geom@freebsd.org, freebsd-hackers Content-Type: text/plain; charset=UTF-8 Cc: Subject: glabel "force sectorsize" patch X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Aug 2010 01:58:05 -0000 Hi, In order to help users having 4k sector drives which the system recognizes as 512 byte sector drives, I'm proposing a patch to glabel which enables it to use a forced sector size for its native-labeled providers. It is naturally only usable with glabel-native labels (those created by "glabel label") and not partition and file system labels because we cannot add arbitrary new fields to metadata of those types. The patch is here: http://people.freebsd.org/~ivoras/diffs/glabel_ssize.patch It's tested with UFS+SU and a forced 4k sector size - apparently there are no problems here. Here's how a dumpfs output looks like from the test file system with completely default newfs options (except SU): magic 19540119 (UFS2) time Sun Aug 8 03:40:47 2010 superblock location 65536 id [ 4c5e0ab3 41c7e8d9 ] ncg 7 size 524287 blocks 514774 bsize 16384 shift 14 mask 0xffffc000 fsize 4096 shift 12 mask 0xfffff000 frag 4 shift 2 fsbtodb 3 minfree 8% optim time symlinklen 120 maxbsize 16384 maxbpg 2048 maxcontig 8 contigsumsize 8 nbfree 128690 ndir 2 nifree 150972 nffree 12 bpg 21567 fpg 86268 ipg 21568 unrefs 0 nindir 2048 inopb 64 maxfilesize 140806241583103 sbsize 4096 cgsize 16384 csaddr 1376 cssize 4096 sblkno 20 cblkno 24 iblkno 28 dblkno 1376 cgrotor 0 fmod 0 ronly 0 clean 1 avgfpdir 64 avgfilesize 16384 flags soft-updates fsmnt /mt volname swuid 0 This is a pre-commit review request and also a call for testers :) This mechanism is a band-aid until there's a better way of dealing with 4k drives.