From owner-freebsd-fs@FreeBSD.ORG Thu May 8 06:43:57 2003 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 ABEF537B401 for ; Thu, 8 May 2003 06:43:57 -0700 (PDT) Received: from mail.icomag.de (ns.icomag.de [195.227.115.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8F00F43FB1 for ; Thu, 8 May 2003 06:43:56 -0700 (PDT) (envelope-from bgd@icomag.de) Received: by mail.icomag.de (Postfix, from userid 1019) id 452132303B; Thu, 8 May 2003 15:43:54 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.icomag.de (Postfix) with ESMTP id 42CBC23030 for ; Thu, 8 May 2003 15:43:54 +0200 (CEST) Date: Thu, 8 May 2003 15:43:54 +0200 (CEST) From: Bogdan TARU X-X-Sender: To: Message-ID: <20030508154133.O11002-100000@fw.office.icom> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Large Disk support 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, 08 May 2003 13:43:57 -0000 Hi, I have asked this question(s) on the freebsd-hackers ml as well, but no reply... maybe somebody in here can help me. And obviously, I am sorry for the double-posting... I have a 'backup box' which acts like a SCSI device with almost 2TB of available space. And, obviously, I would like to use it all. But I have encountered problems with fdisk (because of the number of 'so called' cylinders, I imagine), and formatting the filesystem. So, I have the following questions: 1. Is there a 'modified' version of fdisk which works with large disks (mine is: da1: 2097144MB (4294950912 512 byte sectors: 255H 63S/T 5204C)) 2. What kind of filesystem should I run on this thing (will UFS2 handle 2+ TB)? Is there any support for XFS or so for FreeBSD? 3. Are there any resources (documentation/mailing-lists/etc) which treat this problem? Please reply to my email as well, since I'm not subscribed to freebsd-fs mailing list. Thank you, bogdan From owner-freebsd-fs@FreeBSD.ORG Thu May 8 13:44:39 2003 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 11D0237B401 for ; Thu, 8 May 2003 13:44:39 -0700 (PDT) Received: from dynamic.hydro.washington.edu (dynamic.hydro.washington.edu [128.95.246.166]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7C76743FAF for ; Thu, 8 May 2003 13:44:38 -0700 (PDT) (envelope-from penglish@hydro.washington.edu) Received: from dynamic.hydro.washington.edu (localhost [127.0.0.1]) h48KiVTP029468 for ; Thu, 8 May 2003 13:44:31 -0700 (PDT) (envelope-from penglish@hydro.washington.edu) Received: from localhost (penglish@localhost)h48KiVHo029465 for ; Thu, 8 May 2003 13:44:31 -0700 (PDT) (envelope-from penglish@hydro.washington.edu) X-Authentication-Warning: dynamic.hydro.washington.edu: penglish owned process doing -bs Date: Thu, 8 May 2003 13:44:31 -0700 (PDT) From: Paul English To: freebsd-fs@freebsd.org Message-ID: <20030508134003.T29407-100000@dynamic.hydro.washington.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Recovering from filesystem damage 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, 08 May 2003 20:44:39 -0000 Hi, I have a partition that was recovered for me by a data recovery company. Unfortunately all they gave me was a image of the disk with all the data they could recover. I managed to find an alternate superblock that works for the partition in question, but when I go to mount it is where I get into trouble. It wants to have fsck run - if I do that with fsck -y it will clean the filesystem, and mount, but *everything* (all 15GB) is in lost+found. If I just restore the superblock with fsck, and don't do anything else, then I can mount the filesystem readonly, but then when I mount it there is nothing there: #ls /mnt ls: /mnt: Bad file descriptor What else can I try? Pulling 15GB of data from lost+found is pretty impractical. Thanks, Paul From owner-freebsd-fs@FreeBSD.ORG Fri May 9 14:52:08 2003 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 5CFC237B401 for ; Fri, 9 May 2003 14:52:08 -0700 (PDT) Received: from mailbox.univie.ac.at (mail.univie.ac.at [131.130.1.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 63C8843F85 for ; Fri, 9 May 2003 14:52:07 -0700 (PDT) (envelope-from l.ertl@univie.ac.at) Received: from dialin202.cc.univie.ac.at (dialin202.cc.univie.ac.at [131.130.202.202]) by mailbox.univie.ac.at (8.12.2/8.12.2) with ESMTP id h49Lpuc9136522 for ; Fri, 9 May 2003 23:52:01 +0200 Date: Fri, 9 May 2003 23:51:51 +0200 (CEST) From: Lukas Ertl To: freebsd-fs@freebsd.org Message-ID: <20030509234356.T638@korben.in.tern> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE X-DCC-ZID-Univie-Metrics: unet 4261; Body=1 Fuz1=1 Fuz2=1 Subject: newfs: useless/bogus check if new last block can be accessed? 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: Fri, 09 May 2003 21:52:08 -0000 Hi fs-hackers, since I'm currently having fun in getting familiar with UFS/FFS and all its related tools, I found the following piece of code in sbin/newfs/mkfs.c= : ---8<--- /* * Validate the given file system size. * Verify that its last block can actually be accessed. * Convert to file system fragment sized units. */ if (fssize <=3D 0) { printf("preposterous size %jd\n", (intmax_t)fssize); exit(13); } wtfs(fssize - (realsectorsize / DEV_BSIZE), realsectorsize, (char *)&sblock); ---8<--- I quite clueless why that wtfs() call is there at all and how it should "verify that its last block can actually be accessed". wtfs() is of type static void, and just calls bwrite() from libufs, ignoring its return value. Anyone can shed some light on this? best regards, le --=20 Lukas Ertl eMail: l.ertl@univie.ac.at UNIX-Systemadministrator Tel.: (+43 1) 4277-14073 Zentraler Informatikdienst (ZID) Fax.: (+43 1) 4277-9140 der Universit=E4t Wien http://mailbox.univie.ac.at/~le/ From owner-freebsd-fs@FreeBSD.ORG Fri May 9 14:57:56 2003 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 7264B37B401 for ; Fri, 9 May 2003 14:57:56 -0700 (PDT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7E44943F93 for ; Fri, 9 May 2003 14:57:55 -0700 (PDT) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.9/8.12.9) with ESMTP id h49Lvsxa014821; Fri, 9 May 2003 23:57:54 +0200 (CEST) (envelope-from phk@phk.freebsd.dk) To: Lukas Ertl From: "Poul-Henning Kamp" In-Reply-To: Your message of "Fri, 09 May 2003 23:51:51 +0200." <20030509234356.T638@korben.in.tern> Date: Fri, 09 May 2003 23:57:54 +0200 Message-ID: <14820.1052517474@critter.freebsd.dk> cc: freebsd-fs@freebsd.org Subject: Re: newfs: useless/bogus check if new last block can be accessed? 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: Fri, 09 May 2003 21:57:56 -0000 In message <20030509234356.T638@korben.in.tern>, Lukas Ertl writes: >Hi fs-hackers, > >since I'm currently having fun in getting familiar with UFS/FFS and all >its related tools, I found the following piece of code in sbin/newfs/mkfs.c: > >[...] > >I quite clueless why that wtfs() call is there at all and how it should >"verify that its last block can actually be accessed". > >wtfs() is of type static void, and just calls bwrite() from libufs, >ignoring its return value. > >Anyone can shed some light on this? In the good old days, people could write any damn number they wanted in a disklabel, and the kernel would let them. This check tried to make sure that the partition length picked up from the disklabel, or entered as an argument actually makes sense as far as you can actually write to the last sector. I'm not sure if this particular bit does anything at this point in time, we may have caught the issue earlier in the process, because today disk devices actually know how large they are. syv# mdconfig -a -t malloc -s 1m -u 5 syv# diskinfo /dev/md5 /dev/md5 512 1048576 2048 syv# newfs -s 2047 md5 /dev/md5: 1.0MB (2044 sectors) block size 16384, fragment size 2048 using 1 cylinder groups of 1.00MB, 63 blks, 128 inodes. super-block backups (for fsck -b #) at: 32 syv# newfs -s 2048 md5 /dev/md5: 1.0MB (2048 sectors) block size 16384, fragment size 2048 using 1 cylinder groups of 1.00MB, 64 blks, 128 inodes. super-block backups (for fsck -b #) at: 32 syv# newfs -s 2049 md5 newfs: /dev/md5: maximum file system size is 2048 syv# -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-freebsd-fs@FreeBSD.ORG Fri May 9 15:07:44 2003 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 B905A37B401 for ; Fri, 9 May 2003 15:07:44 -0700 (PDT) Received: from mailbox.univie.ac.at (mail.univie.ac.at [131.130.1.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id BD4B243FB1 for ; Fri, 9 May 2003 15:07:43 -0700 (PDT) (envelope-from l.ertl@univie.ac.at) Received: from dialin202.cc.univie.ac.at (dialin202.cc.univie.ac.at [131.130.202.202]) by mailbox.univie.ac.at (8.12.2/8.12.2) with ESMTP id h49M7Vc9132800; Sat, 10 May 2003 00:07:36 +0200 Date: Sat, 10 May 2003 00:07:26 +0200 (CEST) From: Lukas Ertl To: Poul-Henning Kamp In-Reply-To: <14820.1052517474@critter.freebsd.dk> Message-ID: <20030510000438.Y638@korben.in.tern> References: <14820.1052517474@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE X-DCC-ZID-Univie-Metrics: mx1 4261; Body=2 Fuz1=2 Fuz2=2 cc: freebsd-fs@freebsd.org Subject: Re: newfs: useless/bogus check if new last block can be accessed? 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: Fri, 09 May 2003 22:07:45 -0000 Hi Poul, On Fri, 9 May 2003, Poul-Henning Kamp wrote: > In message <20030509234356.T638@korben.in.tern>, Lukas Ertl writes: > > > >wtfs() is of type static void, and just calls bwrite() from libufs, > >ignoring its return value. > > In the good old days, people could write any damn number they wanted in > a disklabel, and the kernel would let them. > > This check tried to make sure that the partition length picked up from > the disklabel, or entered as an argument actually makes sense as far > as you can actually write to the last sector. Ok, I see, thanks for the history lesson :-) > I'm not sure if this particular bit does anything at this point in > time, we may have caught the issue earlier in the process, because > today disk devices actually know how large they are. > > [...] > > syv# newfs -s 2049 md5 > newfs: /dev/md5: maximum file system size is 2048 > syv# But since this size check comes much earlier in the code, I guess the wtfs() call is useless and should be removed, shouldn't it? regards, le --=20 Lukas Ertl eMail: l.ertl@univie.ac.at UNIX-Systemadministrator Tel.: (+43 1) 4277-14073 Zentraler Informatikdienst (ZID) Fax.: (+43 1) 4277-9140 der Universit=E4t Wien http://mailbox.univie.ac.at/~le/ From owner-freebsd-fs@FreeBSD.ORG Fri May 9 15:18:01 2003 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 7AC3137B401 for ; Fri, 9 May 2003 15:18:01 -0700 (PDT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8303543F3F for ; Fri, 9 May 2003 15:18:00 -0700 (PDT) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.9/8.12.9) with ESMTP id h49MHxxa015150; Sat, 10 May 2003 00:17:59 +0200 (CEST) (envelope-from phk@phk.freebsd.dk) To: Lukas Ertl From: "Poul-Henning Kamp" In-Reply-To: Your message of "Sat, 10 May 2003 00:07:26 +0200." <20030510000438.Y638@korben.in.tern> Date: Sat, 10 May 2003 00:17:59 +0200 Message-ID: <15149.1052518679@critter.freebsd.dk> cc: freebsd-fs@freebsd.org Subject: Re: newfs: useless/bogus check if new last block can be accessed? 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: Fri, 09 May 2003 22:18:01 -0000 In message <20030510000438.Y638@korben.in.tern>, Lukas Ertl writes: >> syv# newfs -s 2049 md5 >> newfs: /dev/md5: maximum file system size is 2048 >> syv# > >But since this size check comes much earlier in the code, I guess the >wtfs() call is useless and should be removed, shouldn't it? If the check still works, I'd tend to keep it on the basis that it does no harm, but if you tell me that it would never result in an error, then we might as well remove it. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-freebsd-fs@FreeBSD.ORG Fri May 9 15:31:33 2003 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 082C837B401 for ; Fri, 9 May 2003 15:31:33 -0700 (PDT) Received: from mailbox.univie.ac.at (mailbox.univie.ac.at [131.130.1.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id F3EDF43FAF for ; Fri, 9 May 2003 15:31:31 -0700 (PDT) (envelope-from l.ertl@univie.ac.at) Received: from dialin202.cc.univie.ac.at (dialin202.cc.univie.ac.at [131.130.202.202]) by mailbox.univie.ac.at (8.12.2/8.12.2) with ESMTP id h49MVKc9044600; Sat, 10 May 2003 00:31:24 +0200 Date: Sat, 10 May 2003 00:31:15 +0200 (CEST) From: Lukas Ertl To: Poul-Henning Kamp In-Reply-To: <15149.1052518679@critter.freebsd.dk> Message-ID: <20030510002107.T638@korben.in.tern> References: <15149.1052518679@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE X-DCC-ZID-Univie-Metrics: mailbox 4251; Body=2 Fuz1=2 Fuz2=2 cc: freebsd-fs@freebsd.org Subject: Re: newfs: useless/bogus check if new last block can be accessed? 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: Fri, 09 May 2003 22:31:33 -0000 On Sat, 10 May 2003, Poul-Henning Kamp wrote: > In message <20030510000438.Y638@korben.in.tern>, Lukas Ertl writes: > > >> syv# newfs -s 2049 md5 > >> newfs: /dev/md5: maximum file system size is 2048 > >> syv# > > > >But since this size check comes much earlier in the code, I guess the > >wtfs() call is useless and should be removed, shouldn't it? > > If the check still works, I'd tend to keep it on the basis that it > does no harm, but if you tell me that it would never result in an > error, then we might as well remove it. I don't think it does any harm to keep it (WRT to getting a working filesystem), but since I don't see how it would signal an error (and this is why I posted the question) I'd vote for removing the check. And while we're here: shouldn't wtfs() actually give a return value and not be just static void? (In terms of: "be a good programmer and check the return values of your syscalls...") I think it's called often enough in newfs to qualify for a check :-) regards, le --=20 Lukas Ertl eMail: l.ertl@univie.ac.at UNIX-Systemadministrator Tel.: (+43 1) 4277-14073 Zentraler Informatikdienst (ZID) Fax.: (+43 1) 4277-9140 der Universit=E4t Wien http://mailbox.univie.ac.at/~le/ From owner-freebsd-fs@FreeBSD.ORG Fri May 9 15:40:26 2003 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 7CF8737B401 for ; Fri, 9 May 2003 15:40:26 -0700 (PDT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7BF0243FAF for ; Fri, 9 May 2003 15:40:23 -0700 (PDT) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.9/8.12.9) with ESMTP id h49MeLxa015611; Sat, 10 May 2003 00:40:21 +0200 (CEST) (envelope-from phk@phk.freebsd.dk) To: Lukas Ertl From: "Poul-Henning Kamp" In-Reply-To: Your message of "Sat, 10 May 2003 00:31:15 +0200." <20030510002107.T638@korben.in.tern> Date: Sat, 10 May 2003 00:40:21 +0200 Message-ID: <15610.1052520021@critter.freebsd.dk> cc: freebsd-fs@freebsd.org Subject: Re: newfs: useless/bogus check if new last block can be accessed? 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: Fri, 09 May 2003 22:40:26 -0000 In message <20030510002107.T638@korben.in.tern>, Lukas Ertl writes: >I don't think it does any harm to keep it (WRT to getting a working >filesystem), but since I don't see how it would signal an error (and this >is why I posted the question) I'd vote for removing the check. > >And while we're here: shouldn't wtfs() actually give a return value and >not be just static void? (In terms of: "be a good programmer and check the >return values of your syscalls...") I think it's called often enough in >newfs to qualify for a check :-) Get in touch with jmallett@freebsd.org who has been actively trying to improve the UFS/FFS tools for some time, it sounds like the two of you are on the same page :-) -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-freebsd-fs@FreeBSD.ORG Fri May 9 15:47:44 2003 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 0906637B401; Fri, 9 May 2003 15:47:44 -0700 (PDT) Received: from mailbox.univie.ac.at (mailbox.univie.ac.at [131.130.1.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id D4EC843FBD; Fri, 9 May 2003 15:47:42 -0700 (PDT) (envelope-from l.ertl@univie.ac.at) Received: from dialin202.cc.univie.ac.at (dialin202.cc.univie.ac.at [131.130.202.202]) by mailbox.univie.ac.at (8.12.2/8.12.2) with ESMTP id h49MlVc9032714; Sat, 10 May 2003 00:47:35 +0200 Date: Sat, 10 May 2003 00:47:26 +0200 (CEST) From: Lukas Ertl To: Poul-Henning Kamp In-Reply-To: <15610.1052520021@critter.freebsd.dk> Message-ID: <20030510004537.H638@korben.in.tern> References: <15610.1052520021@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE X-DCC-ZID-Univie-Metrics: unet 4261; Body=3 Fuz1=3 Fuz2=3 cc: freebsd-fs@freebsd.org cc: jmallett@freebsd.org Subject: Re: newfs: useless/bogus check if new last block can be accessed? 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: Fri, 09 May 2003 22:47:44 -0000 On Sat, 10 May 2003, Poul-Henning Kamp wrote: > In message <20030510002107.T638@korben.in.tern>, Lukas Ertl writes: > > >I don't think it does any harm to keep it (WRT to getting a working > >filesystem), but since I don't see how it would signal an error (and thi= s > >is why I posted the question) I'd vote for removing the check. > > > >And while we're here: shouldn't wtfs() actually give a return value and > >not be just static void? (In terms of: "be a good programmer and check t= he > >return values of your syscalls...") I think it's called often enough in > >newfs to qualify for a check :-) > > Get in touch with jmallett@freebsd.org who has been actively trying to > improve the UFS/FFS tools for some time, it sounds like the two of you > are on the same page :-) :-) Ok, although I guess she's on this list anyway, I'm CC'ing her and hope she's interested if I can come up with some fixes... regards, le --=20 Lukas Ertl eMail: l.ertl@univie.ac.at UNIX-Systemadministrator Tel.: (+43 1) 4277-14073 Zentraler Informatikdienst (ZID) Fax.: (+43 1) 4277-9140 der Universit=E4t Wien http://mailbox.univie.ac.at/~le/ From owner-freebsd-fs@FreeBSD.ORG Fri May 9 18:32:29 2003 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 931) id 0DE8537B401; Fri, 9 May 2003 18:32:29 -0700 (PDT) Date: Fri, 9 May 2003 20:32:29 -0500 From: Juli Mallett To: Lukas Ertl Message-ID: <20030509203228.A62797@FreeBSD.org> References: <15610.1052520021@critter.freebsd.dk> <20030510004537.H638@korben.in.tern> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20030510004537.H638@korben.in.tern>; from l.ertl@univie.ac.at on Sat, May 10, 2003 at 12:47:26AM +0200 X-Title: Code Maven X-Towel: Yes X-Negacore: Yes X-Authentication-Warning: localhost: juli pwned teh intarweb cc: freebsd-fs@freebsd.org cc: Poul-Henning Kamp Subject: Re: newfs: useless/bogus check if new last block can be accessed? 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: Sat, 10 May 2003 01:32:29 -0000 * Lukas Ertl [ Date: 2003-05-09 ] [ w.r.t. Re: newfs: useless/bogus check if new last block can be accessed? ] > On Sat, 10 May 2003, Poul-Henning Kamp wrote: > > > In message <20030510002107.T638@korben.in.tern>, Lukas Ertl writes: > > > > >I don't think it does any harm to keep it (WRT to getting a working > > >filesystem), but since I don't see how it would signal an error (and this > > >is why I posted the question) I'd vote for removing the check. > > > > > >And while we're here: shouldn't wtfs() actually give a return value and > > >not be just static void? (In terms of: "be a good programmer and check the > > >return values of your syscalls...") I think it's called often enough in > > >newfs to qualify for a check :-) > > > > Get in touch with jmallett@freebsd.org who has been actively trying to > > improve the UFS/FFS tools for some time, it sounds like the two of you > > are on the same page :-) > > :-) > > Ok, although I guess she's on this list anyway, I'm CC'ing her and hope > she's interested if I can come up with some fixes... I at one point had some warnx calls (at minimum, since things tend to work and it's better to let someone shoot their foot maybe than use errx, cause at that point, it's a bit late.) and so on. I didn't ever get them into CVS as I was working on general libufs-ification at the time of newfs, and then tracking down why that broke things (*blush*), and I didn't want to put in too many new failure cases I could be blamed for :) Do a bunch of testing with errx, maybe, see if things blow up, and if so, maybe make it advisory (e.g. warnx) and track down the real root of the problem. When I was discussing some generalised API for accessing members of the sblock (which went nowhere due to over-engineering, and too much faith...er, yeah, it went nowhere), one of the things I wanted to do was have a "naive" flag as part of an (undeveloped) generalised flags (external, not like MINE_) interface, which would let libufs do the exploding, if things went wrong. But that's beyond what you're talking about. Do some testing, maybe some cleanups along what you mentioned, I'll be glad to see it done, as long as things still work :) Thanx, juli. -- juli mallett. email: jmallett@freebsd.org; efnet: juli; From owner-freebsd-fs@FreeBSD.ORG Fri May 9 19:02:40 2003 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 32D9537B401; Fri, 9 May 2003 19:02:40 -0700 (PDT) Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) by mx1.FreeBSD.org (Postfix) with SMTP id 69F8F43F85; Fri, 9 May 2003 19:02:38 -0700 (PDT) (envelope-from iedowse@maths.tcd.ie) Received: from walton.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id ; 10 May 2003 03:02:37 +0100 (BST) To: Juli Mallett In-Reply-To: Your message of "Fri, 09 May 2003 20:32:29 CDT." <20030509203228.A62797@FreeBSD.org> Date: Sat, 10 May 2003 03:02:37 +0100 From: Ian Dowse Message-ID: <200305100302.aa28788@salmon.maths.tcd.ie> cc: freebsd-fs@FreeBSD.org cc: Poul-Henning Kamp cc: Lukas Ertl Subject: Re: newfs: useless/bogus check if new last block can be accessed? 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: Sat, 10 May 2003 02:02:40 -0000 In message <20030509203228.A62797@FreeBSD.org>, Juli Mallett writes: >I at one point had some warnx calls (at minimum, since things tend to work >and it's better to let someone shoot their foot maybe than use errx, cause >at that point, it's a bit late.) and so on. I didn't ever get them into >CVS as I was working on general libufs-ification at the time of newfs, and >then tracking down why that broke things (*blush*), and I didn't want to >put in too many new failure cases I could be blamed for :) Do a bunch of The missing error checking appears to be a regression introduced in revision 1.71 of mkfs.c; before that, any write failures in wtfs() would cause newfs to output the sector number, the errno string and then exit. >(which went nowhere due to over-engineering, and too much faith...er, yeah, >it went nowhere), one of the things I wanted to do was have a "naive" flag >as part of an (undeveloped) generalised flags (external, not like MINE_) >interface, which would let libufs do the exploding, if things went wrong. Something like the patch below should do the trick for now. This puts back the old exit code and sector number information, but relies on the undocumented (?) behaviour of bwrite() leaving a sensible value in errno. Ian Index: mkfs.c =================================================================== RCS file: /dump/FreeBSD-CVS/src/sbin/newfs/mkfs.c,v retrieving revision 1.75 diff -u -r1.75 mkfs.c --- mkfs.c 3 May 2003 18:41:58 -0000 1.75 +++ mkfs.c 10 May 2003 01:56:39 -0000 @@ -849,7 +849,8 @@ { if (Nflag) return; - bwrite(&disk, bno, bf, size); + if (bwrite(&disk, bno, bf, size) < 0) + err(36, "wtfs: %d bytes at sector %jd", size, (intmax_t)bno); } /* From owner-freebsd-fs@FreeBSD.ORG Fri May 9 20:39:31 2003 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 931) id EED5B37B401; Fri, 9 May 2003 20:39:31 -0700 (PDT) Date: Fri, 9 May 2003 22:39:31 -0500 From: Juli Mallett To: Ian Dowse Message-ID: <20030509223931.A75707@FreeBSD.org> References: <20030509203228.A62797@FreeBSD.org> <200305100302.aa28788@salmon.maths.tcd.ie> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <200305100302.aa28788@salmon.maths.tcd.ie>; from iedowse@maths.tcd.ie on Sat, May 10, 2003 at 03:02:37AM +0100 X-Title: Code Maven X-Towel: Yes X-Negacore: Yes X-Authentication-Warning: localhost: juli pwned teh intarweb cc: freebsd-fs@FreeBSD.org cc: Poul-Henning Kamp cc: Lukas Ertl Subject: Re: newfs: useless/bogus check if new last block can be accessed? 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: Sat, 10 May 2003 03:39:32 -0000 * Ian Dowse [ Date: 2003-05-09 ] [ w.r.t. Re: newfs: useless/bogus check if new last block can be accessed? ] > In message <20030509203228.A62797@FreeBSD.org>, Juli Mallett writes: > >(which went nowhere due to over-engineering, and too much faith...er, yeah, > >it went nowhere), one of the things I wanted to do was have a "naive" flag > >as part of an (undeveloped) generalised flags (external, not like MINE_) > >interface, which would let libufs do the exploding, if things went wrong. > > Something like the patch below should do the trick for now. This > puts back the old exit code and sector number information, but > relies on the undocumented (?) behaviour of bwrite() leaving a > sensible value in errno. That looks pretty sane. And bwrite is undocumented. All contracts are explicit for now. Once it's documented that changes. Thanx, juli. -- juli mallett. email: jmallett@freebsd.org; efnet: juli; From owner-freebsd-fs@FreeBSD.ORG Sat May 10 06:09:32 2003 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 11FFA37B401; Sat, 10 May 2003 06:09:32 -0700 (PDT) Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) by mx1.FreeBSD.org (Postfix) with SMTP id 9AC3243F85; Sat, 10 May 2003 06:09:30 -0700 (PDT) (envelope-from iedowse@maths.tcd.ie) Received: from walton.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id ; 10 May 2003 14:09:29 +0100 (BST) To: Juli Mallett In-Reply-To: Your message of "Fri, 09 May 2003 22:39:31 CDT." <20030509223931.A75707@FreeBSD.org> Date: Sat, 10 May 2003 14:09:29 +0100 From: Ian Dowse Message-ID: <200305101409.aa30329@salmon.maths.tcd.ie> cc: freebsd-fs@FreeBSD.org cc: Poul-Henning Kamp cc: Lukas Ertl Subject: Re: newfs: useless/bogus check if new last block can be accessed? 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: Sat, 10 May 2003 13:09:32 -0000 In message <20030509223931.A75707@FreeBSD.org>, Juli Mallett writes: >* Ian Dowse [ Date: 2003-05-09 ] >> Something like the patch below should do the trick for now. This >> puts back the old exit code and sector number information, but >> relies on the undocumented (?) behaviour of bwrite() leaving a >> sensible value in errno. > >That looks pretty sane. And bwrite is undocumented. All contracts >are explicit for now. Once it's documented that changes. Actually, the patch isn't quite right, as errno won't be set if there was a short write instead of an error. Unfortunately, there is no way to fix this without changing the libufs API, since bwrite() maps short writes to a -1 return value, so the caller can't tell whether errno is valid. I think bwrite() either needs to have the same semantics as pwrite(2), or else libufs should have the ability to display or return an error message. To avoid loss of previous functionality, the error message would need to at least include the errno string, so the string currently written to d_error is not sufficient. What is using libufs's bwrite()? Would it be better to just make errors fatal for now so that a useful diagnostic can be printed? Ian From owner-freebsd-fs@FreeBSD.ORG Sat May 10 07:41:34 2003 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 9FFE937B401; Sat, 10 May 2003 07:41:34 -0700 (PDT) Received: from bremen.shuttle.de (bremen.shuttle.de [194.95.249.251]) by mx1.FreeBSD.org (Postfix) with ESMTP id B1B1743FE0; Sat, 10 May 2003 07:41:33 -0700 (PDT) (envelope-from schweikh@schweikhardt.net) Received: from bremen.shuttle.de (localhost [127.0.0.1]) by bremen.shuttle.de (Postfix) with ESMTP id 0F10A17D44; Sat, 10 May 2003 16:41:32 +0200 (CEST) Received: (from uucp@localhost)h4AEfVC7011365; Sat, 10 May 2003 16:41:31 +0200 Received: (from schweikh@localhost) by hal9000.schweikhardt.net (8.12.9/8.12.9) id h4AEfW1C004768; Sat, 10 May 2003 16:41:32 +0200 (CEST) (envelope-from schweikh) Date: Sat, 10 May 2003 16:41:32 +0200 From: Jens Schweikhardt To: Farid Hajji Message-ID: <20030510144132.GA4214@schweikhardt.net> References: <200305100055.37190.me@farid-hajji.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200305100055.37190.me@farid-hajji.de> User-Agent: Mutt/1.4.1i cc: freebsd-fs@freebsd.org cc: freebsd-current@freebsd.org Subject: Re: Are snapshots always consistent? X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: freebsd-fs@freebsd.org List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2003 14:41:35 -0000 Farid, On Sat, May 10, 2003 at 12:55:37AM +0200, Farid Hajji wrote: # I'm somewhat confused about snapshots. # # Are snapshots (e.g. created with dump -L) supposed to # be always in a consistent state? # # What happens if a snapshot is taken, while background # fsck is fixing a filesystem? I'm no expert in file systems, but AFAIK the bg fsck mostly looks for unreferenced blocks and puts them in the free block bitmap again, while dump reads files (contents) and does not store block bitmaps and other fs meta information. So, these operations should not interfere with one another. # If snapshots are not always consistent, how can one # be sure about dump -L output? Is it better to take # a snapshot first, fsck it, and _then_ dump the # snapshot without -L (how?)? The most appropriate place to ask this is probably freebsd-fs@ (in Cc: and Reply-To:). Regards, Jens -- Jens Schweikhardt http://www.schweikhardt.net/ SIGSIG -- signature too long (core dumped) From owner-freebsd-fs@FreeBSD.ORG Sat May 10 13:53:18 2003 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 931) id 4F4D737B404; Sat, 10 May 2003 13:53:18 -0700 (PDT) Date: Sat, 10 May 2003 15:53:18 -0500 From: Juli Mallett To: Ian Dowse Message-ID: <20030510155318.A40429@FreeBSD.org> References: <20030509223931.A75707@FreeBSD.org> <200305101409.aa30329@salmon.maths.tcd.ie> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <200305101409.aa30329@salmon.maths.tcd.ie>; from iedowse@maths.tcd.ie on Sat, May 10, 2003 at 02:09:29PM +0100 X-Title: Code Maven X-Towel: Yes X-Negacore: Yes X-Authentication-Warning: localhost: juli pwned teh intarweb cc: freebsd-fs@FreeBSD.org cc: Poul-Henning Kamp cc: Lukas Ertl Subject: Re: newfs: useless/bogus check if new last block can be accessed? 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: Sat, 10 May 2003 20:53:18 -0000 * Ian Dowse [ Date: 2003-05-10 ] [ w.r.t. Re: newfs: useless/bogus check if new last block can be accessed? ] > In message <20030509223931.A75707@FreeBSD.org>, Juli Mallett writes: > >* Ian Dowse [ Date: 2003-05-09 ] > >> Something like the patch below should do the trick for now. This > >> puts back the old exit code and sector number information, but > >> relies on the undocumented (?) behaviour of bwrite() leaving a > >> sensible value in errno. > > > >That looks pretty sane. And bwrite is undocumented. All contracts > >are explicit for now. Once it's documented that changes. > > Actually, the patch isn't quite right, as errno won't be set if > there was a short write instead of an error. Unfortunately, there > is no way to fix this without changing the libufs API, since bwrite() > maps short writes to a -1 return value, so the caller can't tell > whether errno is valid. Well... > I think bwrite() either needs to have the same semantics as pwrite(2), > or else libufs should have the ability to display or return an error > message. To avoid loss of previous functionality, the error message > would need to at least include the errno string, so the string > currently written to d_error is not sufficient. It's fairly easy to use d_error and errno in a combination that is both useful in the errno sense and in the descriptive error sense. If errno is set, and d_error is set, do both, otherwise, use what is there? > What is using libufs's bwrite()? Would it be better to just make > errors fatal for now so that a useful diagnostic can be printed? Everything using libufs*. That means every fs tool except for the growfs and related tools, which I seem to recall rely on a lot of voodoo. clri does in my tree, but I don't know if I ever merged it back in. I'd like to have a standard erroring function in libufs again some time, but it would need to do what's described above, and so on. Otherwise the individual utility/application chooses how to format errors, which is the current issue. I don't see how we don't get a useful combination out of this, assuming that an error is an error to a filesystem program, and so the errors it gets don't have to be fully informative. If you want to set errno on short reads/writes, feel free to, and it can be documented appropriately in time. But really you want something like ufserr() from other libufs consumers, except without lossage of errno (some or all may do this, I forget). Thanx, juli. * - A safe assumption though not true for dumpfs. -- juli mallett. email: jmallett@freebsd.org; efnet: juli; From owner-freebsd-fs@FreeBSD.ORG Sat May 10 15:01:00 2003 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 EB23437B401; Sat, 10 May 2003 15:01:00 -0700 (PDT) Received: from mailbox.univie.ac.at (mailbox.univie.ac.at [131.130.1.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6E43F43FE5; Sat, 10 May 2003 15:00:59 -0700 (PDT) (envelope-from l.ertl@univie.ac.at) Received: from dialin202.cc.univie.ac.at (dialin202.cc.univie.ac.at [131.130.202.202]) by mailbox.univie.ac.at (8.12.2/8.12.2) with ESMTP id h4AM0hc9063124; Sun, 11 May 2003 00:00:50 +0200 Date: Sun, 11 May 2003 00:00:37 +0200 (CEST) From: Lukas Ertl To: Juli Mallett In-Reply-To: <20030510155318.A40429@FreeBSD.org> Message-ID: <20030510235436.S616@korben.in.tern> References: <20030509223931.A75707@FreeBSD.org> <200305101409.aa30329@salmon.maths.tcd.ie> <20030510155318.A40429@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE X-DCC-ZID-Univie-Metrics: unet 4261; Body=4 Fuz1=4 Fuz2=4 cc: freebsd-fs@FreeBSD.ORG cc: Ian Dowse cc: Poul-Henning Kamp Subject: Re: newfs: useless/bogus check if new last block can be accessed? 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: Sat, 10 May 2003 22:01:01 -0000 On Sat, 10 May 2003, Juli Mallett wrote: > * Ian Dowse [ Date: 2003-05-10 ] > > > What is using libufs's bwrite()? Would it be better to just make > > errors fatal for now so that a useful diagnostic can be printed? > > Everything using libufs*. That means every fs tool A quick grep showed badsect, dumpfs, newfs and tunefs use libufs - of course, as you already mentioned, dumpfs doesn't do writes. > except for the growfs and related tools, which I seem to recall rely on > a lot of voodoo. BTW, growfs needs some fixes, too (bin/51138). > clri does in my tree, but I don't know if I ever merged it back in. No, clri ist currently not on the list. > But really you want something like ufserr() from other libufs > consumers, except without lossage of errno (some or all may do > this, I forget). You mean ufserr() as currently in dumpfs? regards, le --=20 Lukas Ertl eMail: l.ertl@univie.ac.at UNIX-Systemadministrator Tel.: (+43 1) 4277-14073 Zentraler Informatikdienst (ZID) Fax.: (+43 1) 4277-9140 der Universit=E4t Wien http://mailbox.univie.ac.at/~le/