From owner-freebsd-stable@FreeBSD.ORG Tue Nov 25 07:42:45 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 614341065674 for ; Tue, 25 Nov 2008 07:42:45 +0000 (UTC) (envelope-from rajkumars@gmail.com) Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.175]) by mx1.freebsd.org (Postfix) with ESMTP id 031D08FC12 for ; Tue, 25 Nov 2008 07:42:44 +0000 (UTC) (envelope-from rajkumars@gmail.com) Received: by wf-out-1314.google.com with SMTP id 24so2695891wfg.7 for ; Mon, 24 Nov 2008 23:42:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:mime-version:content-type:content-transfer-encoding :content-disposition; bh=z6+9SnmnjvLZ0QLY6rQ85xvDiE+m2L+ALIck4sgG+AE=; b=bd2j4VDTK4RHfcJ8DTUyb7etB6RpWCamHpxeJPaAiUJedtJEwPwTbg7WbJbYKPFZkM M15FGfJ2kYrqb34MzVimTTvfp6Q49WJpJZRds44oJcA3Wjq6ygDRMKlwXNJvoU5MKQ45 0OIxD28s+Kj0moi8pdCRW2pCbx3DQsHYZ45+I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:mime-version:content-type :content-transfer-encoding:content-disposition; b=RfzVJBphxfmk/0aDApsp6jQHFlEdmsq381FexyYLMIjwrSgjbAl2VE+7OiqEEUsrYP PivS6xrLn16iyJSwKESORVhOe4AqHycUyzdGn3Fvq92pgw+bSStk48L5/urNG9PB3bJi HvaHoZUcbqfx5vlLk9/IfQl+g78Xkc4jF256c= Received: by 10.142.177.5 with SMTP id z5mr2022289wfe.240.1227597043046; Mon, 24 Nov 2008 23:10:43 -0800 (PST) Received: by 10.143.167.2 with HTTP; Mon, 24 Nov 2008 23:10:42 -0800 (PST) Message-ID: <64de5c8b0811242310l14932467kdcef55ab48322b23@mail.gmail.com> Date: Tue, 25 Nov 2008 12:40:42 +0530 From: "Rajkumar S" To: freebsd-stable@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline Cc: dev@pfsense.com Subject: ioctl DIOCSMBR: Inappropriate ioctl for device X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Nov 2008 07:42:45 -0000 Hi, I am working on a nanobsd derived system for updating an embedded pfSense image. The disk is partitioned into 4 partitions with 2 similar "code" partitions. One of the two code partition is live at any moment. To update the partition image is written to the other partition and a command like boot0cfg -s 2 -v ad2 to boot to the new partition. Instead of using device names I am using bsdlabel and refer the disks using the label in fdisk. Current partitions are as follows: nanoimg:~# fdisk ad2 ******* Working on device /dev/ad2 ******* parameters extracted from in-core disklabel are: cylinders=1999 heads=16 sectors/track=63 (1008 blks/cyl) Figures below won't work with BIOS for partitions not in cyl 1 parameters to be used for BIOS calculations are: cylinders=1999 heads=16 sectors/track=63 (1008 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 165 (0xa5),(FreeBSD/NetBSD/386BSD) start 32, size 239584 (116 Meg), flag 80 (active) beg: cyl 0/ head 1/ sector 1; end: cyl 467/ head 15/ sector 32 The data for partition 2 is: sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD) start 239648, size 239584 (116 Meg), flag 0 beg: cyl 468/ head 1/ sector 1; end: cyl 935/ head 15/ sector 32 The data for partition 3 is: sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD) start 479232, size 2048 (1 Meg), flag 0 beg: cyl 936/ head 0/ sector 1; end: cyl 939/ head 15/ sector 32 The data for partition 4 is: sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD) start 481280, size 20480 (10 Meg), flag 0 beg: cyl 940/ head 0/ sector 1; end: cyl 979/ head 15/ sector 32 dmesg shows the following when booting: ad2: 983MB at ata1-master PIO4 GEOM: ad2: partition 4 does not start on a track boundary. GEOM: ad2: partition 4 does not end on a track boundary. GEOM: ad2: partition 3 does not start on a track boundary. GEOM: ad2: partition 3 does not end on a track boundary. GEOM: ad2: partition 2 does not start on a track boundary. GEOM: ad2: partition 2 does not end on a track boundary. GEOM: ad2: partition 1 does not start on a track boundary. GEOM: ad2: partition 1 does not end on a track boundary. GEOM_LABEL: Label for provider ad2s3 is ufs/cfg. GEOM_LABEL: Label for provider ad2s4 is ufs/cf. GEOM_LABEL: Label for provider ad2s1a is ufs/root0. GEOM_LABEL: Label for provider ad2s2a is ufs/root1. Trying to mount root from ufs:/dev/ufs/root0 Fstab is: /dev/ufs/root0 / ufs ro 1 1 /dev/ufs/cfg /cfg ufs rw,noauto 2 2 /dev/ufs/cf /cf ufs ro 1 1 both ad2s1a and ad2s2a are active and they appear in boot screen as F1 and F2. I can manually press F1 and F2 and boot from either of them. But when I give a command boot0cfg -s 1 -v ad2 I get boot0cfg: /dev/ad2: Class not found boot0cfg: /dev/ad2: ioctl DIOCSMBR: Inappropriate ioctl for device I have searched google and archives and could not find much about this error. Any help to resolve this would be much appreciated. with regards, raj