From owner-freebsd-fs Sun Nov 2 04:23:52 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id EAA17837 for fs-outgoing; Sun, 2 Nov 1997 04:23:52 -0800 (PST) (envelope-from owner-freebsd-fs) Received: from woozle.rinet.ru (marck@woozle.rinet.ru [195.54.192.68]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id EAA17817; Sun, 2 Nov 1997 04:23:36 -0800 (PST) (envelope-from marck@woozle.rinet.ru) Received: from localhost (marck@localhost) by woozle.rinet.ru (8.8.7/8.8.7) with SMTP id PAA09820; Sun, 2 Nov 1997 15:23:31 +0300 (MSK) (envelope-from marck@woozle.rinet.ru) Date: Sun, 2 Nov 1997 15:23:31 +0300 (MSK) From: Dmitry Morozovsky To: freebsd-fs@freebsd.org cc: freebsd-questions@freebsd.org Subject: Getting info from a crashed disk Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-fs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Hi there, hope you'll never put yourself in a situation similar to mine. "FreeBSD woozle.rinet.ru 2.2.5-RELEASE FreeBSD 2.2.5-RELEASE" I had an IDE disk on my machine (Quantum FB 1080A, rather old). Some days ago i type "pine" and got message complaining about reading my mailbox. Moment look at the console got unrecoverable read error message. Digging into a problem i found directories /var/mail and /usr/home (yeah! :((() unreadable. System was 2.2.2-R. I install 2.2.5-R on a new disk and tried to dump old /usr (mount it readonly) to new disk. dump prints many error messages about non-readable disk areas but create dump file. However, restore claims that file isn't dump at all. Is there a reasonable way to get at least my home directory back? Please cc your answers to my email address. Thanx for your help. Sincerely, D.Marck ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-freebsd-fs Sun Nov 2 06:32:43 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id GAA22062 for fs-outgoing; Sun, 2 Nov 1997 06:32:43 -0800 (PST) (envelope-from owner-freebsd-fs) Received: from murkwood.gaffaneys.com (dialup2.gaffaneys.com [208.155.161.52]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id GAA22025 for ; Sun, 2 Nov 1997 06:32:38 -0800 (PST) (envelope-from zach@gaffaneys.com) Received: (from zach@localhost) by murkwood.gaffaneys.com (8.8.7/8.8.6) id IAA02898; Sun, 2 Nov 1997 08:32:09 -0600 (CST) From: Zach Heilig Message-ID: <19971102083208.35411@gaffaneys.com> Date: Sun, 2 Nov 1997 08:32:08 -0600 To: Gopakumar H Pillai Cc: fs@FreeBSD.ORG Subject: Re: Help in disk recovery References: <3457E1F0.AC037AFD@global.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.84 In-Reply-To: <3457E1F0.AC037AFD@global.com>; from Gopakumar H Pillai on Wed, Oct 29, 1997 at 05:25:04PM -0800 Sender: owner-freebsd-fs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Wed, Oct 29, 1997 at 05:25:04PM -0800, Gopakumar H Pillai wrote: > I am a sysadmin, fairly new to the job. The OS is FreeBSD 2.2.2. I had a > disk sd0s1e of 2GB and sd1s1e of 1GB. In the process of finding out the > device name of the tape drive I did a "tar cvf rsd0 /tmp". The amount of > data I have written over the raw disk is about 20K. This disk has /usr. > I need to retrieve /usr, mainly my mails in /usr/home. How should I go > about it? If you remember the start (exactly) of the /usr partition, you can use disklabel to put the partition back (disklabel -e -r sd0). You may have to use 'fdisk' first... After you have the partition back, you should be able to run fsck using one of the backup superblocks. They are usually at: 0, 32, 65568, 131104, (w/ superblocks at +65536 to the end of the partition). example: fsck -b 131104 /dev/rsd0s1e You may need to use 'fsdb' as well to get the disk to a state so it can be mounted. You will notice a few files gone, but probably not more than 10 or so. I accidentally did this to my boot disk when I wanted to zero out sd1... the first 600k was overwritten before I noticed (fortunately, dd was going very slow... at 150K/sec. that drive will usually do 2meg/sec)... > I retrieved sd1s1e, i.e. /var and got the /var/mail. So you should be able to figure out the size and start of the /usr partition fairly easily. > I cannot mount or fsck this device since it complains, improper > superblock. I have another machine with similar partitioning, would that > help? > How can I make an exact image of the ruined disk on another one of > the same hardware configuration? > Which is a good book to know the inside out of the FreeBSD 2.2.2 File > system? -- Zach Heilig From owner-freebsd-fs Sun Nov 2 10:45:41 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id KAA05908 for fs-outgoing; Sun, 2 Nov 1997 10:45:41 -0800 (PST) (envelope-from owner-freebsd-fs) Received: from mail.cs.tu-berlin.de (root@mail.cs.tu-berlin.de [130.149.17.13]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id KAA05901 for ; Sun, 2 Nov 1997 10:45:34 -0800 (PST) (envelope-from wosch@cs.tu-berlin.de) Received: from panke.panke.de (anonymous221.ppp.cs.tu-berlin.de [130.149.17.221]) by mail.cs.tu-berlin.de (8.8.6/8.8.7) with ESMTP id TAA16313; Sun, 2 Nov 1997 19:41:57 +0100 (MET) Received: (from wosch@localhost) by panke.panke.de (8.8.5/8.6.12) id SAA00541; Sun, 2 Nov 1997 18:39:21 +0100 (MET) To: Terry Lambert Cc: freebsd-fs@FreeBSD.ORG Subject: Re: disabled symlinks References: <199710311838.LAA01803@usr05.primenet.com> From: Wolfram Schneider Date: 02 Nov 1997 18:39:19 +0100 In-Reply-To: Terry Lambert's message of Fri, 31 Oct 1997 18:38:35 +0000 (GMT) Message-ID: Lines: 35 Sender: owner-freebsd-fs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Terry Lambert writes: > > > Also, shouldn't > > > the same change be made to both lstat() and olstat()? > > This is a cosmetic change. I don't think we should change > > old system calls if it is not necessary. I doubt that anybody > > use an old ls(1) command. > This whole thing was billed as a security workaround for a race > condition that didn't want to get fixed the right way. 8-(. > > If it's for security, what prevents a putative hacker from calling > legacy code which uses the olstat entry point? Terry?! I thought you are the file system expert ... ;-) lstat(2) print file status. No security. No risks. Symbolic links does not have a mode. lstat can print any value in the mode field to make users happy. [quote from last mail] vfs_syscalls.c rev 1.62 Symlinks do not have modes though, they are accessable to everything that can read the directory (as before). They are made to show this fact at lstat time (they appear as mode 0777 always, since that's how the the lookup routines in the kernel treat them). Now it will be (in function lstat and vn_stat) if (symbolic link) { if (does not follow symlinks) change the mode to 0000 (l---------) else change the mode to 0777 (lrwxrwxrwx) } -- Wolfram Schneider http://www.apfel.de/~wosch/ From owner-freebsd-fs Wed Nov 5 11:49:25 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id LAA02501 for fs-outgoing; Wed, 5 Nov 1997 11:49:25 -0800 (PST) (envelope-from owner-freebsd-fs) Received: from global.com (global.com [206.40.50.1]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id LAA02494; Wed, 5 Nov 1997 11:49:21 -0800 (PST) (envelope-from gopu@global.com) Message-ID: <3460CCE9.E558C8D9@global.com> Date: Wed, 05 Nov 1997 11:45:45 -0800 From: Gopakumar H Pillai Organization: Global Automation Inc. X-Mailer: Mozilla 4.03 [en] (Win95; I) MIME-Version: 1.0 To: fs@freebsd.org, hackers@freebsd.org Subject: Book on FreeBSD FileSystem? Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-fs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Hi, Could anyone tell me about a good book which talks inside out of FreeBSD 2.2.2 file system or 4.4 BSD file system (I think FreeBSD 2.2.2 follows 4.4 BSD FS). -- --Gopu (gopu@global.com) From owner-freebsd-fs Wed Nov 5 12:41:43 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id MAA06568 for fs-outgoing; Wed, 5 Nov 1997 12:41:43 -0800 (PST) (envelope-from owner-freebsd-fs) Received: from picnic.mat.net (picnic.mat.net [206.246.122.117]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id MAA06518; Wed, 5 Nov 1997 12:41:25 -0800 (PST) (envelope-from chuckr@glue.umd.edu) Received: from localhost (chuckr@localhost) by picnic.mat.net (8.8.7/8.8.5) with SMTP id OAA04250; Wed, 5 Nov 1997 14:38:41 -0500 (EST) X-Authentication-Warning: picnic.mat.net: chuckr owned process doing -bs Date: Wed, 5 Nov 1997 14:38:36 -0500 (EST) From: Chuck Robey X-Sender: chuckr@localhost To: Gopakumar H Pillai cc: fs@FreeBSD.ORG, hackers@FreeBSD.ORG Subject: Re: Book on FreeBSD FileSystem? In-Reply-To: <3460CCE9.E558C8D9@global.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-fs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Wed, 5 Nov 1997, Gopakumar H Pillai wrote: > Hi, > Could anyone tell me about a good book which talks inside out of FreeBSD > 2.2.2 file system or 4.4 BSD file system (I think FreeBSD 2.2.2 follows > 4.4 BSD FS). The Design and Implementation of the 4.4BSD Operating System McKusick, Bostic, Karels, Quarterman Addison Wesley > -- > --Gopu (gopu@global.com) > > ----------------------------+----------------------------------------------- Chuck Robey | Interests include any kind of voice or data chuckr@glue.umd.edu | communications topic, C programming, and Unix. 213 Lakeside Drive Apt T-1 | Greenbelt, MD 20770 | I run Journey2 and picnic, both FreeBSD (301) 220-2114 | version 3.0 current -- and great FUN! ----------------------------+----------------------------------------------- From owner-freebsd-fs Thu Nov 6 16:02:59 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id QAA23273 for fs-outgoing; Thu, 6 Nov 1997 16:02:59 -0800 (PST) (envelope-from owner-freebsd-fs) Received: from mail.cs.tu-berlin.de (root@mail.cs.tu-berlin.de [130.149.17.13]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id QAA23252; Thu, 6 Nov 1997 16:02:43 -0800 (PST) (envelope-from wosch@cs.tu-berlin.de) Received: from panke.panke.de (anonymous230.ppp.cs.tu-berlin.de [130.149.17.230]) by mail.cs.tu-berlin.de (8.8.6/8.8.7) with ESMTP id AAA22266; Fri, 7 Nov 1997 00:57:59 +0100 (MET) Received: (from wosch@localhost) by panke.panke.de (8.8.5/8.6.12) id XAA00557; Thu, 6 Nov 1997 23:52:14 +0100 (MET) To: Gopakumar H Pillai Cc: fs@freebsd.org, hackers@freebsd.org Subject: Re: Book on FreeBSD FileSystem? References: <3460CCE9.E558C8D9@global.com> From: Wolfram Schneider Date: 06 Nov 1997 23:52:12 +0100 In-Reply-To: Gopakumar H Pillai's message of Wed, 05 Nov 1997 11:45:45 -0800 Message-ID: Lines: 10 Sender: owner-freebsd-fs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Gopakumar H Pillai writes: > Could anyone tell me about a good book which talks inside out of FreeBSD > 2.2.2 file system or 4.4 BSD file system (I think FreeBSD 2.2.2 follows > 4.4 BSD FS). /usr/share/doc/smm/05.fastfs/paper.ascii.gz /usr/share/doc/papers/fsinterface.ascii.gz -- Wolfram Schneider http://www.apfel.de/~wosch/ From owner-freebsd-fs Sat Nov 8 01:46:21 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id BAA27138 for fs-outgoing; Sat, 8 Nov 1997 01:46:21 -0800 (PST) (envelope-from owner-freebsd-fs) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id BAA27132 for ; Sat, 8 Nov 1997 01:46:17 -0800 (PST) (envelope-from bde@zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.6.9) id UAA21843; Sat, 8 Nov 1997 20:44:10 +1100 Date: Sat, 8 Nov 1997 20:44:10 +1100 From: Bruce Evans Message-Id: <199711080944.UAA21843@godzilla.zeta.org.au> To: bde@zeta.org.au, wosch@cs.tu-berlin.de Subject: Re: disabled symlinks Cc: Don.Lewis@tsc.tdk.com, freebsd-fs@FreeBSD.ORG, roberto@keltia.freenix.fr Sender: owner-freebsd-fs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >> >> } diff -u -r1.51.2.6 vfs_syscalls.c >> >> } --- vfs_syscalls.c 1997/10/23 18:04:55 1.51.2.6 >> >> } +++ vfs_syscalls.c 1997/10/30 22:24:47 >> >> } @@ -1326,8 +1328,10 @@ >> >> } return (error); >> >> } vp = nd.ni_vp; >> >> } error = vn_stat(vp, &sb, p); >> >> } - if (vp->v_type == VLNK) >> >> } + if (vp->v_type == VLNK && >> >> } + (vp->v_mount->mnt_flag & MNT_NOSYMLINKFOLLOW) != 0) >> > ^^ >> > >> >> This test looks backwards to me (it changes the behavior if the >> >> new nosymlinkfollow option is not set). I'm also not clear as >> >> to why the behaviour even depends on the option. >> >> It's also wrong because it breaks the setting of S_IFLNK. > >S_IFLNK was already set in vn_stat. I see. ORing in S_IFLNK is a vestige of inheriting the symlink's attributes from its parent directory. vn_stat() was called on the parent directory, so it set S_IFDIR, and ORing in S_IFLNK was part of a fixup. Bruce