from vinum on FreeBSD 4.x to gvinum on 5.4 and 6.0
Ferruccio Zamuner
nonsolosoft at diff.org
Sun Dec 11 15:30:48 PST 2005
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/
More information about the freebsd-geom
mailing list