From owner-freebsd-geom@FreeBSD.ORG Sun Dec 11 23:30:47 2005 Return-Path: X-Original-To: freebsd-geom@freebsd.org Delivered-To: freebsd-geom@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DB04116A41F for ; Sun, 11 Dec 2005 23:30:47 +0000 (GMT) (envelope-from nonsolosoft@diff.org) Received: from fe-4c.inet.it (fe-4c.inet.it [213.92.5.108]) by mx1.FreeBSD.org (Postfix) with ESMTP id 15D1A43D5A for ; Sun, 11 Dec 2005 23:30:46 +0000 (GMT) (envelope-from nonsolosoft@diff.org) Received: from 81-174-26-135.f5.ngi.it ([::ffff:81.174.26.135]) by fe-4c.inet.it via I-SMTP-5.2.3-521 id ::ffff:81.174.26.135+u70dm8iU1XK; Mon, 12 Dec 2005 00:30:43 +0100 Received: from [127.0.0.1] (localhost [127.0.0.1]) by k7.diff.org (8.13.4/8.13.4) with ESMTP id jBBNVDvQ001022; Mon, 12 Dec 2005 00:31:13 +0100 (CET) (envelope-from nonsolosoft@diff.org) Message-ID: <439CB6C0.30109@diff.org> Date: Mon, 12 Dec 2005 00:31:12 +0100 From: Ferruccio Zamuner Organization: NonSoLoSoft - http://www.nonsolosoft.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.12) Gecko/20051116 X-Accept-Language: it, en-us, en MIME-Version: 1.0 To: freebsd-geom@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: nonsolosoft@diff.org Subject: from vinum on FreeBSD 4.x to gvinum on 5.4 and 6.0 X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: nonsolosoft@diff.org List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Dec 2005 23:30:48 -0000 Hi, I was using vinum on FreeBSD 4.x (since x >= 8) without big problems: if for power failure sometime I'd a kernel panic during reboot on vinum I've always restored vinum metadata from original creation file using resetconfig first and create -f mydefinitionfile after; and I've never lost data from vinum partitions. -----vinum mydefinitionfile ------------- drive med device /dev/ad5s1e drive new device /dev/ad6s1e volume sicuro plex org concat sd length 10g drive med plex org concat sd length 10g drive new volume veloce plex org striped 512k sd length 5g drive med sd length 5g drive new volume vtmp plex org concat sd length 300m drive med volume vvar plex org concat sd length 300m drive med ----- end of file ----- Before to upgrade my system to 5.4 I've done backup as usual and I don't expect that vinum partitions survive but using gvinum I've mount them (both mirror and stripped) without problem. Yesterday I've upgrade 5.4 to 6.0 and at first reboot gvinum shows me that drive definitions has been lost: there were still volumes, plexes, subdisks but no drives. I've tried to use gvinum commands: 1) "resetconfig" is not supported by gvinum. 2) I've create a new vinum definition file for only drives (to integrate current configuration) --- mynewdefinitionfile -- drive med device /dev/ad5s1e drive new device /dev/ad6s1e --- end file --- 3) "create -f mynewdefinitionfile" on gvinum dumps current configuration with '#' char starting eachline in a vi, but drives were not yet. 4) "create mynewdefinitionfile" on gvinum stalled the OS and I'd to reset the box. Then I thought to use FreeBSD 4.x recovery CDROM to restore vinum configuration: 1) fortunatly I still had a old 4.11 root partition in my system because FreeBSD 4.x recovery CDROM has not any vinum.ko module. 2) "# kldload /mnt/oldroot/modules/vinum.ko" 3) "# vinum" gives: "Can't get config for plex 0: Invalid argument" Segmentation fault (core dump) 4) then I tried to run vinum again and it starts. 5) while vinum "ld" has no drive defined, "lv" gives me all volumes list, "ls" the full subdisk list but "lp" gives the same error "Can't get config for plex 0". 6) "resetconfig" succeed 7) "create -f mydefinitionfile" gives me same error "Can't get config for plex 0". Then from vinum man pages I've read that vinum stores metadata in first 131,5Kb, so I've run "# dd if=/dev/zero of=/dev/ad5s1e count=263" and run again vinum: 8) "ld","lp","lv","ls" no output, it seems ok finally. 9) "create -f mynewdefinitionfile" apparently succeed writting drives: 2, but "ld" shows no drives. 10) if I run again "create -f mynewdefinitionfile" it writes "drives: 4", but again "ld" shows no drives. 11) "resetconfig" again in vinum, it succeed. 12) "create -f mydefinitionfile" it fails again with error "Can't get config for plex 0". How can I reset really such vinum metadata to recover data stored in vinum partitions? Actually I was very interested to content of partition "/vinum/sicuro" and it was simple: # dd if=/dev/ad5s1e of=/usr/vinum_sicuro.bin skip=265 count=2097152 # mdconfig -a -t vnode -f /usr/vinum_sicuro -u 1 # bsdlabel -w md1 auto # mount /dev/md1c /mnt/ Then I recover first data contents easly. Bye, \fer --- NonSoLoSoft (Italy) - http://www.nonsolosoft.com/