From owner-freebsd-questions@FreeBSD.ORG Tue May 8 08:44:14 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DE4DC16A400 for ; Tue, 8 May 2007 08:44:14 +0000 (UTC) (envelope-from zhangweiwu@realss.com) Received: from bossdog.realss.com (bossdog.realss.com [211.157.108.128]) by mx1.freebsd.org (Postfix) with ESMTP id B9D1913C447 for ; Tue, 8 May 2007 08:44:12 +0000 (UTC) (envelope-from zhangweiwu@realss.com) Received: from localhost (unknown [127.0.0.1]) by bossdog.realss.com (Postfix) with ESMTP id 562231C000E for ; Tue, 8 May 2007 16:44:29 +0800 (CST) Received: from bossdog.realss.com ([127.0.0.1]) by localhost (bossdog.realss.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 06072-08 for ; Tue, 8 May 2007 16:44:26 +0800 (CST) Received: from [218.193.55.195] (135.17.61.59.board.xm.fj.dynamic.163data.com.cn [59.61.17.135]) by bossdog.realss.com (Postfix) with ESMTP id ED6F41C000D for ; Tue, 8 May 2007 16:44:24 +0800 (CST) From: Zhang Weiwu To: freebsd-questions@freebsd.org Content-Type: text/plain Organization: Real Softservice Date: Tue, 08 May 2007 16:42:59 +0800 Message-Id: <1178613779.6328.85.camel@joe.realss.com> Mime-Version: 1.0 X-Mailer: Evolution 2.8.2 Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at bossdog.realss.com Subject: harddisk failed strangely, badly need to recover data X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 May 2007 08:44:14 -0000 Dear list. I added a 160 GB harddisk to the FreeBSD server several days ago. I have setup only one slice on it (/dev/ad6s1) and it has two partitions on it. /dev/ad6s1c is used as swap /dev/ad6s1d is used as /var Today I decided to reboot the FreeBSD server because I messed up nfs settings. After restart /var/ failed to mount. I was brought to a shell where I am suggested to do fsck manually. fsck manually couldn't help either: [root@exupery /home/zhangweiwu]# fsck /dev/ad6s1d ** /dev/ad6s1d Cannot find file system superblock LOOK FOR ALTERNATE SUPERBLOCKS? [yn] y 32 is not a file system superblock 28780512 is not a file system superblock 57560992 is not a file system superblock 86341472 is not a file system superblock 115121952 is not a file system superblock 143902432 is not a file system superblock 172682912 is not a file system superblock 201463392 is not a file system superblock 230243872 is not a file system superblock 259024352 is not a file system superblock 287804832 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). I tried to fix it by do inga harddisk bad-sector checking for the beginning 1GB of the harddisk (result is successful, no bad sector in the beginning 1GB). The data on the harddisk is not modified/erased during checking Use 'dd if=/dev/ad6 bs=32k | hd -v | grep "19 01 54 19"' to locate the super block and do some calculation to get the superblock sector number (following an Internet article) and pass it to fsck_ufs like this: 'fsck_ufs -b 12032 /dev/ad6s1d'. Under a lot of time pressure I confirmed twice with 'y' for the following questions of whether or not to set some values to default without fully understanding the questions, later seeing more questions I stopped fsck by Ctrl+C. Before running fsck I tried to backup the first 100MB data of /dev/ad6 using dd which should help me recover even if I destroyed superblock of /dev/ad6s1d. Later I realized I have by mistake only backed up the beginning 4.0MB of /dev/ad6 Is it possible now for me to recover the data in /var/ (especially /var/backups)? Thanks a lot in advance! P.S. I am being really unlucky because this harddisk is mostly used for backup purpose and thus is not backed up (who back up the back-up harddisk?) and when I today failed to mount this harddisk, 0.5 hour later the server being backed up by it has got an accident and need the backup data to recover.