From owner-freebsd-fs@FreeBSD.ORG Tue Jul 27 04:49:21 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BD9B016A4CE for ; Tue, 27 Jul 2004 04:49:21 +0000 (GMT) Received: from host3.super-nova.net (host3.super-nova.net [209.239.37.122]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0D0EC43D5F for ; Tue, 27 Jul 2004 04:49:19 +0000 (GMT) (envelope-from administration@questech.net) Received: (from questech@localhost) by host3.super-nova.net (8.12.10/8.12.10) id i6R4n3TI018957; Tue, 27 Jul 2004 00:49:03 -0400 Date: Tue, 27 Jul 2004 00:49:03 -0400 From: administration@questech.net Message-Id: <200407270449.i6R4n3TI018957@host3.super-nova.net> X-Authentication-Warning: host3.super-nova.net: questech set sender to administration@questech.net using -f To: freebsd-fs@freebsd.org References: <200407270448.i6R4mJjh018654@host3.super-nova.net> In-Reply-To: <200407270448.i6R4mJjh018654@host3.super-nova.net> X-Loop: outOfSpace Precedence: junk Subject: MESSAGE NOT DELIVERED: Re: Your text X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jul 2004 04:49:21 -0000 Your message could not be delivered. The User is out of space. Please try to send your message again at a later time. From owner-freebsd-fs@FreeBSD.ORG Tue Jul 27 06:57:17 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 146FA16A4CE for ; Tue, 27 Jul 2004 06:57:17 +0000 (GMT) Received: from pimout2-ext.prodigy.net (pimout2-ext.prodigy.net [207.115.63.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id D3ED843D1F for ; Tue, 27 Jul 2004 06:57:15 +0000 (GMT) (envelope-from julian@elischer.org) Received: from elischer.org (adsl-68-121-219-69.dsl.snfc21.pacbell.net [68.121.219.69])i6R6vDUK232192 for ; Tue, 27 Jul 2004 02:57:14 -0400 Message-ID: <4105FCC9.4000407@elischer.org> Date: Mon, 26 Jul 2004 23:57:13 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4b) Gecko/20030524 X-Accept-Language: en, hu MIME-Version: 1.0 To: fs@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Subject: anyone know a flesystem corruption that can do this? X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jul 2004 06:57:17 -0000 This may be hardware but it acts a lot like persistant bad data somewhere. Spot the (not so) deliberate error (in the buf)! One system has been falling over. this is related to it.. Is there any way a filesystem can be corrupted so that this can happen? the resid and b_bcount for this request are bigger than the buffer size! The write will fail because of dscheck but the system survives.. However when the file in question is read back from memory it goes into an infinite loop on this buf, hanging the system. uiomove moves 0 bytes once the bulk of the buffer has been moved but teh resid is still non-zero, so it just cycles forever. ( can get into the debugger so a trace of that is available too. this is a trace of the original write. list . (gdb) list 278 } 279 } 280 return (1); 281 282 bad_bcount: 283 printf( 284 "dscheck(%s): b_bcount %ld is not on a sector boundary (ssize %d)\n", 285 devtoname(bp->b_dev), bp->b_bcount, ssp->dss_secsize); 286 bp->b_error = EINVAL; 287 goto bad; b_bufsize = 0x4000, b_bcount = 0x4020 (!) [debugger] #7 0xc01b48c2 in dscheck (bp=0xcc9767dc, ssp=0xc235b000) at /usr/prod/system/VERS_4_8_BRANCH/src/sys/kern/subr_diskslice.c:283 #8 0xc01b4379 in diskstrategy (bp=0xcc9767dc) at /usr/prod/system/VERS_4_8_BRANCH/src/sys/kern/subr_disk.c:246 #9 0xc01e3b78 in spec_strategy (ap=0xd6a90ec0) at /usr/prod/system/VERS_4_8_BRANCH/src/sys/miscfs/specfs/spec_vnops.c:479 #10 0xc01e35a1 in spec_vnoperate (ap=0xd6a90ec0) at /usr/prod/system/VERS_4_8_BRANCH/src/sys/miscfs/specfs/spec_vnops.c:119 #11 0xc0272ded in ufs_vnoperatespec (ap=0xd6a90ec0) at /usr/prod/system/VERS_4_8_BRANCH/src/sys/ufs/ufs/ufs_vnops.c:2394 #12 0xc02726ed in ufs_strategy (ap=0xd6a90f04) at vnode_if.h:944 #13 0xc0272dbd in ufs_vnoperate (ap=0xd6a90f04) at /usr/prod/system/VERS_4_8_BRANCH/src/sys/ufs/ufs/ufs_vnops.c:2376 #14 0xc01d045a in bwrite (bp=0xcc9767dc) at vnode_if.h:944 #15 0xc01d5eb6 in vop_stdbwrite (ap=0xd6a90f68) at /usr/prod/system/VERS_4_8_BRANCH/src/sys/kern/vfs_default.c:344 #16 0xc01d5d01 in vop_defaultop (ap=0xd6a90f68) at /usr/prod/system/VERS_4_8_BRANCH/src/sys/kern/vfs_default.c:152 #17 0xc0272dbd in ufs_vnoperate (ap=0xd6a90f68) at /usr/prod/system/VERS_4_8_BRANCH/src/sys/ufs/ufs/ufs_vnops.c:2376 #18 0xc01d13cb in vfs_bio_awrite (bp=0xcc9767dc) at vnode_if.h:1193 #19 0xc01d1ae2 in flushbufqueues () at /usr/prod/system/VERS_4_8_BRANCH/src/sys/kern/vfs_bio.c:1930 #20 0xc01d1979 in buf_daemon () at /usr/prod/system/VERS_4_8_BRANCH/src/sys/kern/vfs_bio.c:1855 (gdb) p *bp $6 = { b_hash = { le_next = 0x0, le_prev = 0xcc9376e4 }, b_vnbufs = { tqe_next = 0x0, tqe_prev = 0xcc9f9274 }, b_freelist = { tqe_next = 0xcc9d8a60, tqe_prev = 0xc036c8b8 }, b_act = { tqe_next = 0x0, tqe_prev = 0xc2324000 }, b_flags = 0x21021024, b_qindex = 0x0, b_xflags = 0x2, b_lock = { lk_interlock = { lock_data = 0x0 }, lk_flags = 0x400, lk_sharecount = 0x0, lk_waitcount = 0x0, lk_exclusivecount = 0x1, lk_prio = 0x14, lk_wmesg = 0xc0326390 "bufwait", lk_timo = 0x0, lk_lockholder = 0xfffffffe }, b_error = 0x16, b_bufsize = 0x4000, b_runningbufspace = 0x4000, b_bcount = 0x4020, b_resid = 0x4020, b_dev = 0xc2394b80, b_data = 0xceadf000 "Ã\236=}h\002\212^M\022\210ä\201\213\016\001\035ê[He̳J0Òvô«\177ÏÒ\233סã×Ö\200)XE\233I#\224`\026=i\226\021K\025Ü¢A\222", b_kvabase = 0xceadf000 "Ã\236=}h\002\212^M\022\210ä\201\213\016\001\035ê[He̳J0Òvô«\177ÏÒ\233סã×Ö\200)XE\233I#\224`\026=i\226\021K\025Ü¢A\222", b_kvasize = 0x4000, b_lblkno = 0xf0c, b_blkno = 0x2a91e3a0, b_offset = 0x3c30000, b_iodone = 0, b_iodone_chain = 0x0, b_vp = 0xd7766600, b_dirtyoff = 0x0, b_dirtyend = 0x0, b_rcred = 0x0, b_wcred = 0x0, b_pblkno = 0x1f7fff7f, b_saveaddr = 0x0, b_driver1 = 0x0, b_driver2 = 0x0, b_caller1 = 0x0, b_caller2 = 0x0, b_pager = { pg_spc = 0x0, pg_reqpage = 0x0 }, b_cluster = { [...] From owner-freebsd-fs@FreeBSD.ORG Tue Jul 27 08:51:05 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 14D6616A4CF for ; Tue, 27 Jul 2004 08:51:05 +0000 (GMT) Received: from inetmg01.sony.com.sg (inetmg01.sony.com.sg [202.42.154.67]) by mx1.FreeBSD.org (Postfix) with ESMTP id D31FD43D31 for ; Tue, 27 Jul 2004 08:51:02 +0000 (GMT) (envelope-from ravi.nanjundappa@ap.sony.com) Received: from avgw02b.sony.com.sg (avgw02b [43.68.8.23]) by inetmg01.sony.com.sg (8.11.7+Sun/8.11.6) with SMTP id i6R8tuI08236 for ; Tue, 27 Jul 2004 16:55:57 +0800 (SGT) Received: from unknown(43.68.8.1) by avgw02b.sony.com.sg via csmap id 0c8b991e_dfab_11d8_9bd7_0002b3cb4edc_20195; Tue, 27 Jul 2004 16:57:55 +0800 (SGT) Received: from sapsgssdibh01.ap.sony.com (bh01.ap.sony.com [43.68.15.23]) by seagw01.sony.com.sg (8.11.6+Sun/8.11.6) with ESMTP id i6R8hYE20405 for ; Tue, 27 Jul 2004 16:43:34 +0800 (SGT) Received: from sapinsardexc01.sard.in.sony.com.sg (SAPINSARDEXC01 [43.88.102.8]) by sapsgssdibh01.ap.sony.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2657.72) id P3XJ7V7S; Tue, 27 Jul 2004 16:50:58 +0800 Received: from [43.88.102.67] (RAVIN [43.88.102.67]) by sapinsardexc01.sard.in.sony.com.sg with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2655.55) id 37T3D5R6; Tue, 27 Jul 2004 14:32:40 +0530 From: ravi To: freebsd-fs@freebsd.org In-Reply-To: <20040719120055.7DEC716A4D0@hub.freebsd.org> References: <20040719120055.7DEC716A4D0@hub.freebsd.org> Content-Type: text/plain Organization: SONY-SARD Message-Id: <1090918658.4727.53.camel@ravin> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-7) Date: Tue, 27 Jul 2004 14:27:38 +0530 Content-Transfer-Encoding: 7bit Subject: Regarding freeBSD X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jul 2004 08:51:05 -0000 Hi, I wanted to know whether there is any structure in FreeBSD that corresponds to the file_operations structure of Linux ? Is there any way to register read and write functions in a kernel module for procfs ? Regards, N Ravi From owner-freebsd-fs@FreeBSD.ORG Tue Jul 27 14:26:35 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C538816A4CE for ; Tue, 27 Jul 2004 14:26:35 +0000 (GMT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3034243D4C for ; Tue, 27 Jul 2004 14:26:35 +0000 (GMT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.11/8.12.11) with ESMTP id i6REPbad002200; Tue, 27 Jul 2004 10:25:38 -0400 (EDT) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)i6REPQmQ002196; Tue, 27 Jul 2004 10:25:37 -0400 (EDT) (envelope-from robert@fledge.watson.org) Date: Tue, 27 Jul 2004 10:25:26 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: ravi In-Reply-To: <1090918658.4727.53.camel@ravin> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-fs@freebsd.org Subject: Re: Regarding freeBSD X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jul 2004 14:26:35 -0000 On Tue, 27 Jul 2004, ravi wrote: > I wanted to know whether there is any structure in FreeBSD that > corresponds to the file_operations structure of Linux ? In FreeBSD, the equivilent of 'struct inode' is 'struct vnode'. The inode operation fector on Linux, 'struct file_operations' is equivilent to the 'v_op' vnode operation vector in FreeBSD. Most file systems use just a couple of operation vectors -- one for regular files/directories, another for fifos, and another for special devices. The file systems will provide their own vector and then overlay shared vectors from file system libraries to implement fifos and special devices -- fs/fifofs and fs/specfs respectively. In Linux, inode vectors are more frequently substituted for special nodes, whereas in FreeBSD, file systems that provide for special nodes often expose an abstraction to the services creating said nodes. I.e., in Linux, a broad range of devices override the file operation vector for device nodes. In FreeBSD, devfs implements the vnode operation vectors and forwards specific requests via the device's 'struct devsw' -- open, close, read, write, ioctl, poll, etc. As such, it's fairly unusual to directly override vnode operation vectors; rather, special case nodes attach to various service APIs to offer method implementations (i.e., fill out a cdevsw and attach it using make_dev()). > Is there any way to register read and write functions in a kernel module > for procfs ? I think it might be helpful to know what it is you're currently up to -- are you building a new file system based on pseudofs, extending procfs or linprocfs to add new entries, or building an entirely new file system? Are you adding new per-process procfs entries? The advice you get will depend a bit on what it is you want to accomplish... If you intend to modify the FreeBSD procfs to add new per-process controls, take a look at fs/procfs/procfs_init(), which registers the per-process entries with pseudofs, including their procfs_do*() methods. In particular, I'd probably look at procfs_doprocctl() in proc_ctl.c, which implements the write functionality for /proc/*/ctl, and procfs_doprocmap(), which implements the read functionality for /proc/*/map. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Principal Research Scientist, McAfee Research From owner-freebsd-fs@FreeBSD.ORG Wed Jul 28 12:59:46 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1953916A4CE; Wed, 28 Jul 2004 12:59:46 +0000 (GMT) Received: from inetmg01.sony.com.sg (inetmg01.sony.com.sg [202.42.154.67]) by mx1.FreeBSD.org (Postfix) with ESMTP id E44B043D55; Wed, 28 Jul 2004 12:59:43 +0000 (GMT) (envelope-from ravi.nanjundappa@ap.sony.com) Received: from avgw02b.sony.com.sg (avgw02b [43.68.8.23]) by inetmg01.sony.com.sg (8.11.7+Sun/8.11.6) with SMTP id i6SD4RI06433; Wed, 28 Jul 2004 21:04:28 +0800 (SGT) Received: from unknown(43.68.8.1) by avgw02b.sony.com.sg via csmap id f25b1294_e096_11d8_8a45_0002b3cb4edc_332; Wed, 28 Jul 2004 21:06:32 +0800 (SGT) Received: from sapsgssdibh01.ap.sony.com (bh01.ap.sony.com [43.68.15.23]) by seagw01.sony.com.sg (8.11.6+Sun/8.11.6) with ESMTP id i6SCq6E14702; Wed, 28 Jul 2004 20:52:06 +0800 (SGT) Received: from sapinsardexc01.sard.in.sony.com.sg (SAPINSARDEXC01 [43.88.102.8]) by sapsgssdibh01.ap.sony.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2657.72) id P3XJ7XQ1; Wed, 28 Jul 2004 20:59:30 +0800 Received: from [43.88.102.67] (RAVIN [43.88.102.67]) by sapinsardexc01.sard.in.sony.com.sg with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2655.55) id 37T3D6FX; Wed, 28 Jul 2004 18:41:13 +0530 From: ravi To: freebsd-fs@freebsd.org In-Reply-To: <20040721120055.5418A16A4E0@hub.freebsd.org> References: <20040721120055.5418A16A4E0@hub.freebsd.org> Content-Type: text/plain Organization: SONY-SARD Message-Id: <1091019971.4727.39.camel@ravin> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-7) Date: Wed, 28 Jul 2004 18:36:12 +0530 Content-Transfer-Encoding: 7bit cc: Robert Watson Subject: regarding pseudofs in FreeBSD X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jul 2004 12:59:46 -0000 Hi, As I've already told u in the previous mail , I've extended the liprocfs by creating my own proc entries (which are not related to any process ) . And I'm storing some data in the sb ( which is a pointer to sbuf structure ) using my handler function for these entries . I want to make this data to be accessed from the gcov tool when I run the gcov command from the terminal . Please tell me how this can be done ? From owner-freebsd-fs@FreeBSD.ORG Wed Jul 28 20:12:30 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EEF4F16A4CE; Wed, 28 Jul 2004 20:12:30 +0000 (GMT) Received: from itchy.rabson.org (mailgate.nlsystems.com [80.177.232.242]) by mx1.FreeBSD.org (Postfix) with ESMTP id F2EF643D62; Wed, 28 Jul 2004 20:12:29 +0000 (GMT) (envelope-from dfr@nlsystems.com) Received: from ns0.nlsystems.com (ns0.nlsystems.com [80.177.232.243]) by itchy.rabson.org (8.12.11/8.12.11) with ESMTP id i6SKCJhe050884; Wed, 28 Jul 2004 21:12:20 +0100 (BST) (envelope-from dfr@nlsystems.com) From: Doug Rabson To: freebsd-fs@freebsd.org Date: Wed, 28 Jul 2004 21:12:14 +0100 User-Agent: KMail/1.6.1 References: <20040721120055.5418A16A4E0@hub.freebsd.org> <1091019971.4727.39.camel@ravin> In-Reply-To: <1091019971.4727.39.camel@ravin> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200407282112.14456.dfr@nlsystems.com> X-Spam-Status: No, hits=0.0 required=5.0 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on itchy.rabson.org X-Virus-Scanned: clamd / ClamAV version 0.71, clamav-milter version 0.71 X-Virus-Status: Clean cc: ravi cc: Robert Watson Subject: Re: regarding pseudofs in FreeBSD X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jul 2004 20:12:31 -0000 On Wednesday 28 July 2004 14:06, ravi wrote: > Hi, > > As I've already told u in the previous mail , I've extended the > liprocfs by creating my own proc entries (which are not related to > any process ) . And I'm storing some data in the sb ( which is a > pointer to sbuf structure ) using my handler function for these > entries . I want to make this data to be accessed from the gcov tool > when I run the gcov command from the terminal . > > Please tell me how this can be done ? Is this in the freebsd /proc or the linux /usr/compat/linux/proc? I don't want the freebsd /proc to grow all that ugly clutter that you can find there on linux - use sysctl instead. From owner-freebsd-fs@FreeBSD.ORG Thu Jul 29 00:43:35 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8443616A4CE; Thu, 29 Jul 2004 00:43:35 +0000 (GMT) Received: from maui.ebi.ac.uk (maui.ebi.ac.uk [193.62.196.100]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3084C43D2D; Thu, 29 Jul 2004 00:43:34 +0000 (GMT) (envelope-from kreil@ebi.ac.uk) Received: from puffin.ebi.ac.uk (puffin.ebi.ac.uk [193.62.196.89]) by maui.ebi.ac.uk (8.11.7+Sun/8.11.7) with ESMTP id i6T0hTF29565; Thu, 29 Jul 2004 01:43:30 +0100 (BST) Received: from puffin.ebi.ac.uk (kreil@localhost) by puffin.ebi.ac.uk (8.11.6/8.11.6) with ESMTP id i6T0hTC26000; Thu, 29 Jul 2004 01:43:29 +0100 Message-Id: <200407290043.i6T0hTC26000@puffin.ebi.ac.uk> X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 To: freebsd-fs@freebsd.org, freebsd-questions@freebsd.org X-Habeas-SWE-1: winter into spring X-Habeas-SWE-2: brightly anticipated X-Habeas-SWE-3: like Habeas SWE (tm) X-Habeas-SWE-4: Copyright 2002 Habeas (tm) X-Habeas-SWE-5: Sender Warranted Email (SWE) (tm). The sender of this X-Habeas-SWE-6: email in exchange for a license for this Habeas X-Habeas-SWE-7: warrant mark warrants that this is a Habeas Compliant X-Habeas-SWE-8: Message (HCM) and not spam. Please report use of this X-Habeas-SWE-9: mark in spam to . Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 29 Jul 2004 01:43:29 +0100 From: David Kreil X-EBI-Information: This email is scanned using www.mailscanner.info. X-EBI: Found to be clean X-EBI-SpamCheck: not spam, SpamAssassin (score=-7.989, required 5, HABEAS_SWE -8.00, LINES_OF_YELLING 0.01) cc: Kreil@ebi.ac.uk Subject: How to recover/reinitialize a trashed /var partition? X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jul 2004 00:43:35 -0000 Hello, I am writing in the hope that someone can give me a hint of how to either recover or recreate a virgin FreeBSD /var partition in an otherwise (apparently) functioning system. Probably in the process of a drive failure in our hardware raid our /var volume got corrupted (yeah, I know this should not happen... sigh. I now also understand why it is recommended having /var on a separate partition...). I tried running fsck -y on /var after umount-ing it, which gives a segmentation fault (exit on signal 11) some way through the process after displaying ** Phase 2 - Check Pathnames ROOT INODE UNALLOCATED UNEXPECTED SOFT UPDATE INCONSISTENCY ALLOCATE? yes CG 0: BAD MAGIC FILE NUMBER UNEXPECTED SOFT UPDATE INCONSISTENCY Now I wonder - is this beyond repair? I should much like to recover /var, just to be able to have a look at the /var/logs to get an idea what went wrong when. About 3.6GB are reported to be in use by df. - If I cannot recover the /var partition, what is the canonical way of recreating it? I suppose I can run newfs on it, but how do I create the necessary subdir structure with the right file-permissions? Could /stand/sysinstall do that? With many thanks for your help in advance, Yours sincerely, David. ------------------------------------------------------------------------ Dr David Philip Kreil ("`-''-/").___..--''"`-._ Research Fellow `6_ 6 ) `-. ( ).`-.__.`) University of Cambridge (_Y_.)' ._ ) `._ `. ``-..-' ++44 1223 764107, fax 333992 _..`--'_..-_/ /--'_.' ,' www.inference.phy.cam.ac.uk/dpk20 (il),-'' (li),' ((!.-' From owner-freebsd-fs@FreeBSD.ORG Thu Jul 29 01:15:26 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B2CB716A4CF; Thu, 29 Jul 2004 01:15:26 +0000 (GMT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8AB7A43D2F; Thu, 29 Jul 2004 01:15:26 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (IDENT:brdavis@localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.12.10/8.12.10) with ESMTP id i6T1F7OF001741; Wed, 28 Jul 2004 18:15:07 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.12.10/8.12.3/Submit) id i6T1F7IO001740; Wed, 28 Jul 2004 18:15:07 -0700 Date: Wed, 28 Jul 2004 18:15:07 -0700 From: Brooks Davis To: David Kreil Message-ID: <20040729011507.GB20909@Odin.AC.HMC.Edu> References: <200407290043.i6T0hTC26000@puffin.ebi.ac.uk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="oLBj+sq0vYjzfsbl" Content-Disposition: inline In-Reply-To: <200407290043.i6T0hTC26000@puffin.ebi.ac.uk> User-Agent: Mutt/1.5.4i cc: freebsd-fs@freebsd.org cc: freebsd-questions@freebsd.org Subject: Re: How to recover/reinitialize a trashed /var partition? X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jul 2004 01:15:26 -0000 --oLBj+sq0vYjzfsbl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 29, 2004 at 01:43:29AM +0100, David Kreil wrote: >=20 > Hello, >=20 > I am writing in the hope that someone can give me a hint of how to either= =20 > recover or recreate a virgin FreeBSD /var partition in an otherwise=20 > (apparently) functioning system. >=20 > Probably in the process of a drive failure in our hardware raid our /var= =20 > volume got corrupted (yeah, I know this should not happen... sigh. I now = also=20 > understand why it is recommended having /var on a separate partition...). >=20 > I tried running fsck -y on /var after umount-ing it, which gives a=20 > segmentation fault (exit on signal 11) some way through the process after= =20 > displaying >=20 > ** Phase 2 - Check Pathnames > ROOT INODE UNALLOCATED > UNEXPECTED SOFT UPDATE INCONSISTENCY >=20 > ALLOCATE? yes >=20 > CG 0: BAD MAGIC FILE NUMBER > UNEXPECTED SOFT UPDATE INCONSISTENCY >=20 > Now I wonder > - is this beyond repair? I should much like to recover /var, > just to be able to have a look at the /var/logs to get an idea what > went wrong when. About 3.6GB are reported to be in use by df. I'm guessing it's beyond reasionable repair, but I'm not ufs expert. Unless you've got data on there that you really need and didn't have backed up, I'd just rebuild from acratch. > - If I cannot recover the /var partition, what is the canonical way of > recreating it? I suppose I can run newfs on it, but how do I create the > necessary subdir structure with the right file-permissions? Could > /stand/sysinstall do that? The short version is: # populate /var /usr/sbin/mtree -deU -f /etc/mtree/BSD.var.dist -p /var # add sendmail bits /usr/sbin/mtree -deU -f /etc/mtree/BSD.sendmail.dist -p / # create new syslog files /usr/sbin/newsyslog -CC # add a lastlog file /usr/bin/touch /var/log/lastlog I cribbed this from /etc/rc.d/var on current. -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --oLBj+sq0vYjzfsbl Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFBCE+aXY6L6fI4GtQRArxCAKDJ/P9CAM3Y9K0C5Pc2zpSB2ODbjgCfSTmw CWTYfpxt0n9itJ0JMRA9DFI= =opSh -----END PGP SIGNATURE----- --oLBj+sq0vYjzfsbl-- From owner-freebsd-fs@FreeBSD.ORG Thu Jul 29 01:19:29 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DEDC816A4CE; Thu, 29 Jul 2004 01:19:29 +0000 (GMT) Received: from structbio.vanderbilt.edu (reef.structbio.Vanderbilt.Edu [160.129.138.217]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2CFEE43D5A; Thu, 29 Jul 2004 01:19:29 +0000 (GMT) (envelope-from bandix@home.funnyvalentine.net) Received: from home.funnyvalentine.net (adsl-065-007-237-012.sip.bna.bellsouth.net [65.7.237.12]) i6T1JHRg028354 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Wed, 28 Jul 2004 20:19:18 -0500 Received: (from bandix@localhost) by home.funnyvalentine.net (8.12.10/8.12.10/Submit) id i6T1JBwj060096; Wed, 28 Jul 2004 20:19:11 -0500 (CDT) (envelope-from bandix) Date: Wed, 28 Jul 2004 20:19:11 -0500 From: "Brandon D. Valentine" To: David Kreil Message-ID: <20040729011911.GA59212@brandon.dvalentine.com> References: <200407290043.i6T0hTC26000@puffin.ebi.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200407290043.i6T0hTC26000@puffin.ebi.ac.uk> User-Agent: Mutt/1.5.6i cc: freebsd-fs@freebsd.org cc: freebsd-questions@freebsd.org Subject: Re: How to recover/reinitialize a trashed /var partition? X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jul 2004 01:19:30 -0000 On Thu, Jul 29, 2004 at 01:43:29AM +0100, David Kreil wrote: > I am writing in the hope that someone can give me a hint of how to either > recover or recreate a virgin FreeBSD /var partition in an otherwise > (apparently) functioning system. If you've still got /usr/obj around from your last buildworld you can boot to single user mode and installworld again. If not, you can use mtree(8) to recreate the hierarchy for /var. This should work: # mtree -deU -f /etc/mtree/BSD.var.dist -p /var You may have to touch/chown/chmod a few files here and there to make sure the appropriate users have permissions to write to/from them. See /usr/src/etc/Makefile for some more information on that. Unfortunately I don't think there is a 'var' target in any of those Makefiles. HTH, Brandon D. Valentine -- brandon@dvalentine.com http://www.geekpunk.net Pseudo-Random Googlism: brandon is gummmmy From owner-freebsd-fs@FreeBSD.ORG Thu Jul 29 01:20:53 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 47B5416A4CE; Thu, 29 Jul 2004 01:20:53 +0000 (GMT) Received: from maui.ebi.ac.uk (maui.ebi.ac.uk [193.62.196.100]) by mx1.FreeBSD.org (Postfix) with ESMTP id 75B8A43D1F; Thu, 29 Jul 2004 01:20:52 +0000 (GMT) (envelope-from kreil@ebi.ac.uk) Received: from puffin.ebi.ac.uk (puffin.ebi.ac.uk [193.62.196.89]) by maui.ebi.ac.uk (8.11.7+Sun/8.11.7) with ESMTP id i6T1KiF16630; Thu, 29 Jul 2004 02:20:44 +0100 (BST) Received: from puffin.ebi.ac.uk (kreil@localhost) by puffin.ebi.ac.uk (8.11.6/8.11.6) with ESMTP id i6T1Khd00595; Thu, 29 Jul 2004 02:20:44 +0100 Message-Id: <200407290120.i6T1Khd00595@puffin.ebi.ac.uk> X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 To: Brooks Davis In-Reply-To: Your message of "Wed, 28 Jul 2004 18:15:07 PDT." <20040729011507.GB20909@Odin.AC.HMC.Edu> X-Habeas-SWE-1: winter into spring X-Habeas-SWE-2: brightly anticipated X-Habeas-SWE-3: like Habeas SWE (tm) X-Habeas-SWE-4: Copyright 2002 Habeas (tm) X-Habeas-SWE-5: Sender Warranted Email (SWE) (tm). The sender of this X-Habeas-SWE-6: email in exchange for a license for this Habeas X-Habeas-SWE-7: warrant mark warrants that this is a Habeas Compliant X-Habeas-SWE-8: Message (HCM) and not spam. Please report use of this X-Habeas-SWE-9: mark in spam to . Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 29 Jul 2004 02:20:43 +0100 From: David Kreil X-EBI-Information: This email is scanned using www.mailscanner.info. X-EBI: Found to be clean X-EBI-SpamCheck: not spam, SpamAssassin (score=-8, required 5, HABEAS_SWE -8.00) cc: freebsd-fs@freebsd.org cc: David Kreil cc: freebsd-questions@freebsd.org Subject: Re: How to recover/reinitialize a trashed /var partition? X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jul 2004 01:20:53 -0000 Dear Brooks, Thank you very much for your fast and helpful reply. # populate /var /usr/sbin/mtree -deU -f /etc/mtree/BSD.var.dist -p /var # add sendmail bits /usr/sbin/mtree -deU -f /etc/mtree/BSD.sendmail.dist -p / # create new syslog files /usr/sbin/newsyslog -CC # add a lastlog file /usr/bin/touch /var/log/lastlog > I cribbed this from /etc/rc.d/var on current. This is fantastic, thanks! With best regards, David. ------------------------------------------------------------------------ Dr David Philip Kreil ("`-''-/").___..--''"`-._ Research Fellow `6_ 6 ) `-. ( ).`-.__.`) University of Cambridge (_Y_.)' ._ ) `._ `. ``-..-' ++44 1223 764107, fax 333992 _..`--'_..-_/ /--'_.' ,' www.inference.phy.cam.ac.uk/dpk20 (il),-'' (li),' ((!.-' From owner-freebsd-fs@FreeBSD.ORG Thu Jul 29 02:02:26 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C5F4416A4CE; Thu, 29 Jul 2004 02:02:26 +0000 (GMT) Received: from maui.ebi.ac.uk (maui.ebi.ac.uk [193.62.196.100]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2DD2A43D54; Thu, 29 Jul 2004 02:02:25 +0000 (GMT) (envelope-from kreil@ebi.ac.uk) Received: from puffin.ebi.ac.uk (puffin.ebi.ac.uk [193.62.196.89]) by maui.ebi.ac.uk (8.11.7+Sun/8.11.7) with ESMTP id i6T22NF07258; Thu, 29 Jul 2004 03:02:23 +0100 (BST) Received: from puffin.ebi.ac.uk (kreil@localhost) by puffin.ebi.ac.uk (8.11.6/8.11.6) with ESMTP id i6T22NX08498; Thu, 29 Jul 2004 03:02:23 +0100 Message-Id: <200407290202.i6T22NX08498@puffin.ebi.ac.uk> X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 To: "Brandon D. Valentine" In-Reply-To: Your message of "Wed, 28 Jul 2004 20:19:11 CDT." <20040729011911.GA59212@brandon.dvalentine.com> X-Habeas-SWE-1: winter into spring X-Habeas-SWE-2: brightly anticipated X-Habeas-SWE-3: like Habeas SWE (tm) X-Habeas-SWE-4: Copyright 2002 Habeas (tm) X-Habeas-SWE-5: Sender Warranted Email (SWE) (tm). The sender of this X-Habeas-SWE-6: email in exchange for a license for this Habeas X-Habeas-SWE-7: warrant mark warrants that this is a Habeas Compliant X-Habeas-SWE-8: Message (HCM) and not spam. Please report use of this X-Habeas-SWE-9: mark in spam to . Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 29 Jul 2004 03:02:23 +0100 From: David Kreil X-EBI-Information: This email is scanned using www.mailscanner.info. X-EBI: Found to be clean X-EBI-SpamCheck: not spam, SpamAssassin (score=-8, required 5, HABEAS_SWE -8.00) cc: freebsd-fs@freebsd.org cc: David Kreil cc: freebsd-questions@freebsd.org Subject: Re: How to recover/reinitialize a trashed /var partition? X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jul 2004 02:02:26 -0000 Dear Brandon D Valentine, Thank you for your helpful comments. > You may have to touch/chown/chmod a few files here and there to make > sure the appropriate users have permissions to write to/from them. See > /usr/src/etc/Makefile for some more information on that. > > Unfortunately I don't think there is a 'var' target in any of those > Makefiles. Thanks for the pointer. Yes, shame there is no such target. Considering that folks generally advise putting /var on a separate partition, my kind of bad luck must be quite common. With best regards, David. ------------------------------------------------------------------------ Dr David Philip Kreil ("`-''-/").___..--''"`-._ Research Fellow `6_ 6 ) `-. ( ).`-.__.`) University of Cambridge (_Y_.)' ._ ) `._ `. ``-..-' ++44 1223 764107, fax 333992 _..`--'_..-_/ /--'_.' ,' www.inference.phy.cam.ac.uk/dpk20 (il),-'' (li),' ((!.-' From owner-freebsd-fs@FreeBSD.ORG Thu Jul 29 14:07:03 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3B35116A4CE; Thu, 29 Jul 2004 14:07:03 +0000 (GMT) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id B58F243D62; Thu, 29 Jul 2004 14:07:02 +0000 (GMT) (envelope-from scottl@freebsd.org) Received: from pooker.samsco.org (scottl@localhost [127.0.0.1]) by pooker.samsco.org (8.12.11/8.12.10) with ESMTP id i6TEDqCk018906; Thu, 29 Jul 2004 08:13:52 -0600 (MDT) (envelope-from scottl@freebsd.org) Received: from localhost (scottl@localhost)i6TEDjHY018903; Thu, 29 Jul 2004 08:13:51 -0600 (MDT) (envelope-from scottl@freebsd.org) X-Authentication-Warning: pooker.samsco.org: scottl owned process doing -bs Date: Thu, 29 Jul 2004 08:13:45 -0600 (MDT) From: Scott Long Sender: scottl@pooker.samsco.org To: ravi In-Reply-To: <1091019971.4727.39.camel@ravin> Message-ID: <20040729081254.M32601@pooker.samsco.org> References: <20040721120055.5418A16A4E0@hub.freebsd.org> <1091019971.4727.39.camel@ravin> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Status: No, hits=0.0 required=3.8 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on pooker.samsco.org cc: freebsd-fs@freebsd.org cc: Robert Watson Subject: Re: regarding pseudofs in FreeBSD X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jul 2004 14:07:03 -0000 On Wed, 28 Jul 2004, ravi wrote: > Hi, > > As I've already told u in the previous mail , I've extended the liprocfs > by creating my own proc entries (which are not related to any process ) > . And I'm storing some data in the sb ( which is a pointer to sbuf > structure ) using my handler function for these entries . I want to make > this data to be accessed from the gcov tool when I run the gcov command > from the terminal . > > Please tell me how this can be done ? > I'm not exactly sure what the gcov command is. Can you explain exactly what you are trying to do and what isn't working at the moment? Scott From owner-freebsd-fs@FreeBSD.ORG Thu Jul 29 14:22:26 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D7C2116A4CE; Thu, 29 Jul 2004 14:22:26 +0000 (GMT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 453F043D5F; Thu, 29 Jul 2004 14:22:24 +0000 (GMT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.11/8.12.11) with ESMTP id i6TELHML047388; Thu, 29 Jul 2004 10:21:17 -0400 (EDT) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)i6TELGsi047385; Thu, 29 Jul 2004 10:21:16 -0400 (EDT) (envelope-from robert@fledge.watson.org) Date: Thu, 29 Jul 2004 10:21:15 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Scott Long In-Reply-To: <20040729081254.M32601@pooker.samsco.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-fs@freebsd.org cc: ravi Subject: Re: regarding pseudofs in FreeBSD X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jul 2004 14:22:27 -0000 On Thu, 29 Jul 2004, Scott Long wrote: > On Wed, 28 Jul 2004, ravi wrote: > > Hi, > > > > As I've already told u in the previous mail , I've extended the liprocfs > > by creating my own proc entries (which are not related to any process ) > > . And I'm storing some data in the sb ( which is a pointer to sbuf > > structure ) using my handler function for these entries . I want to make > > this data to be accessed from the gcov tool when I run the gcov command > > from the terminal . > > > > Please tell me how this can be done ? > > I'm not exactly sure what the gcov command is. Can you explain exactly > what you are trying to do and what isn't working at the moment? I believe that coverage in the kernel can be measured by enabling kernel profiling, and then using the kernbb(8) tool to dump the profile buffers into a form that can be used by gcov(1). The man pages for kernbb(8) and kgmon(8) should have the necessary details. They require a kernel configured for profiling, and details should be in there and config(8). Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Principal Research Scientist, McAfee Research