From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 31 11:42:14 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C213816A4CE for ; Sun, 31 Oct 2004 11:42:14 +0000 (GMT) Received: from www.kukulies.org (www.kukulies.org [213.146.112.180]) by mx1.FreeBSD.org (Postfix) with ESMTP id 77F8743D49 for ; Sun, 31 Oct 2004 11:42:13 +0000 (GMT) (envelope-from kuku@www.kukulies.org) Received: from www.kukulies.org (localhost [127.0.0.1]) by www.kukulies.org (8.12.11/8.12.10) with ESMTP id i9VBgAqE046869 for ; Sun, 31 Oct 2004 12:42:11 +0100 (CET) (envelope-from kuku@www.kukulies.org) Received: (from kuku@localhost) by www.kukulies.org (8.12.11/8.12.10/Submit) id i9VBgAAu046868 for hackers@freebsd.org; Sun, 31 Oct 2004 12:42:10 +0100 (CET) (envelope-from kuku) Date: Sun, 31 Oct 2004 12:42:10 +0100 From: "Christoph P. Kukulies" To: hackers@freebsd.org Message-ID: <20041031114210.GA46741@kukulies.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i Subject: finding alternate superblocks in ffs X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Oct 2004 11:42:14 -0000 Yesterday a major desaster happened: I stumbled across the power cable of my Dell Inspiron notebook. The notebook fell to the floor. FreeBSD was running at that time. Nothing seemed to got damaged, just a palm rest popped off. Ah yes, the HD bay sprung off and in a moment of reflex I pushed it in again in the running system. After that I tried to mount the disk (which had not been mounted at that point of time). Anyway, trying to # fsck_ffs /dev/ad2s1e ** /dev/ad2s1e Cannot find file system superblock LOOK FOR ALTERNATE SUPERBLOCKS? [yn] y 32 is not a file system superblock 89808 is not a file system superblock 179584 is not a file system superblock 269360 is not a file system superblock 359136 is not a file system superblock 448912 is not a file system superblock 538688 is not a file system superblock 628464 is not a file system superblock 718240 is not a file system superblock 808016 is not a file system superblock .... 20813728 is not a file system superblock 20903504 is not a file system superblock 20993280 is not a file system superblock 21083056 is not a file system superblock 21172832 is not a file system superblock 21262608 is not a file system superblock SEARCH FOR ALTERNATE SUPER-BLOCK FAILED. YOU MUST USE THE -b OPTION TO FSCK TO SPECIFY THE LOCATION OF AN ALTERNATE SUPER-BLOCK TO SUPPLY NEEDED INFORMATION; SEE fsck(8). # Any idea what I can do now? I wrote a little program that opens /dev/ad2s1e #include #include #include #include #include #include #include #include #include #include #include #include #include #include main(){ int fd; int k,i=0; int buf[512/(sizeof (int))]; if((fd=open("/dev/ad2s1e",O_RDONLY)) < 0) printf("error opening device\n"),exit(2); printf("opened device\n"); while(read(fd,buf,512)>0){ for(k=0;k<(512/(sizeof (int)));k++){ /*if(buf[k]==FS_UFS1_MAGIC) printf("UFS1 * %d\n",i),fflush(stdout); */ if(buf[k]==FS_UFS2_MAGIC) printf("UFS2 * %d\n",i),fflush(stdout); i++; } } } I'm not sure whether my approach is correct. Anyway, the blocks I find with that method aren't recognized as superblocks either. -- Chris Christoph P. U. Kukulies kuku_at_kukulies.org