From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RLywO-0005tf-To for garchives@archives.gentoo.org; Thu, 03 Nov 2011 15:10:53 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 772AD21C05E; Thu, 3 Nov 2011 15:10:42 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id CE72B21C04B for ; Thu, 3 Nov 2011 15:10:06 +0000 (UTC) Received: from [192.168.26.4] (ip98-164-193-252.oc.oc.cox.net [98.164.193.252]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: zmedico) by smtp.gentoo.org (Postfix) with ESMTPSA id 2F61E1B400B for ; Thu, 3 Nov 2011 15:10:05 +0000 (UTC) Message-ID: <4EB2AECB.9060607@gentoo.org> Date: Thu, 03 Nov 2011 08:10:03 -0700 From: Zac Medico User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:7.0.1) Gecko/20111001 Thunderbird/7.0.1 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] recovering from corrupted vdb References: <4EB277D9.3070302@gentoo.org> In-Reply-To: <4EB277D9.3070302@gentoo.org> X-Enigmail-Version: 1.4a1pre Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 6fe72e20-6bb7-41f3-bdc6-b33147ab6ee7 X-Archives-Hash: 69643d5d6fcbef2f2b092ebf830bf3fc On 11/03/2011 04:15 AM, "Pawe=C5=82 Hajdan, Jr." wrote: > Shouldn't portage offer some means to recover from a corrupted vdb? >=20 > I just stumbled upon > > and it seems really bad. >=20 > It would suck if the only solution to this is reinstall (I remember > package database becoming corrupted in some RPM-based distro I had year= s > ago and I hated it). Your best protection is to have a redundant backup on a separate disk. When I do updates, I always clone my root partition to another partition on a separate disk and chroot into that for the updates, and I keep that spare partition as a backup in case one of my disks fails. For cloning, a command like `rsync -axH --delete / /mnt/backup_rootfs/` works well for me. I've also used btrfs subvolume snapshots for quick and efficient cloning of my root filesystem, but that doesn't give the kind of redundancy that a separate filesystem on a separate disk gives. > If the recovery is already possible, we should get a doc explaining wha= t > to do. Otherwise it'd be really great to implement some recovery logic. >=20 > I think we can't salvage much from a corrupted db (anything can happen, > and the reporter mentions some code being present in the files), but at > least "emerge -e world" or equivalent should be possible. Due to circular dependencies, you need a seed vdb to start with. If you don't have a redundant backup, another option would be to simply remove the corrupt /var/db/pkg and replace it with a copy from a stage3 tarball. --=20 Thanks, Zac