From owner-freebsd-geom@FreeBSD.ORG Mon Dec 17 10:33:34 2007 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C057916A41A; Mon, 17 Dec 2007 10:33:34 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from falcon.cybervisiontech.com (falcon.cybervisiontech.com [217.20.163.9]) by mx1.freebsd.org (Postfix) with ESMTP id 8638F13C535; Mon, 17 Dec 2007 10:33:34 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from localhost (localhost [127.0.0.1]) by falcon.cybervisiontech.com (Postfix) with ESMTP id 2FBD4744014; Mon, 17 Dec 2007 12:33:33 +0200 (EET) X-Virus-Scanned: Debian amavisd-new at falcon.cybervisiontech.com Received: from falcon.cybervisiontech.com ([127.0.0.1]) by localhost (falcon.cybervisiontech.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sNAZdl9n5Upv; Mon, 17 Dec 2007 12:33:33 +0200 (EET) Received: from [10.2.1.87] (gateway.cybervisiontech.com.ua [88.81.251.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by falcon.cybervisiontech.com (Postfix) with ESMTP id 0B06D744012; Mon, 17 Dec 2007 12:33:33 +0200 (EET) Message-ID: <4766507C.6090404@icyb.net.ua> Date: Mon, 17 Dec 2007 12:33:32 +0200 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.9 (X11/20071116) MIME-Version: 1.0 To: Pawel Jakub Dawidek , freebsd-geom@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Subject: gjournal 6.X and fs snapshots X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Dec 2007 10:33:34 -0000 Pawel, it seems that 6.X gjournal (with .deleted/ directory) keeps files for fs snapshots "forever". I use "dump -L" to create backups of live filesystems and noticed that after some days dump fails with: mksnap_ffs: Cannot create /var/.snap/dump_snapshot: No space left on device I looked into .deleted and see 20 files owned by operator with the same "huge" size (circa size of the whole fs). So my conclusion was that those are the snapshot files, so I have 20 active snapshots and so I have exhausted their limit. Does this look as a correct understanding ? Is there a way to cleanup those without a reboot ? Can I simply rm them (without any bad consequences) ? -- Andriy Gapon From owner-freebsd-geom@FreeBSD.ORG Mon Dec 17 10:41:10 2007 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6646616A46C; Mon, 17 Dec 2007 10:41:10 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from falcon.cybervisiontech.com (falcon.cybervisiontech.com [217.20.163.9]) by mx1.freebsd.org (Postfix) with ESMTP id 3200113C4CE; Mon, 17 Dec 2007 10:41:10 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from localhost (localhost [127.0.0.1]) by falcon.cybervisiontech.com (Postfix) with ESMTP id 0DBB9744014; Mon, 17 Dec 2007 12:41:09 +0200 (EET) X-Virus-Scanned: Debian amavisd-new at falcon.cybervisiontech.com Received: from falcon.cybervisiontech.com ([127.0.0.1]) by localhost (falcon.cybervisiontech.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FGfd2LocLG1O; Mon, 17 Dec 2007 12:41:08 +0200 (EET) Received: from [10.2.1.87] (gateway.cybervisiontech.com.ua [88.81.251.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by falcon.cybervisiontech.com (Postfix) with ESMTP id DD5B1744012; Mon, 17 Dec 2007 12:41:08 +0200 (EET) Message-ID: <47665244.1070108@icyb.net.ua> Date: Mon, 17 Dec 2007 12:41:08 +0200 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.9 (X11/20071116) MIME-Version: 1.0 To: Pawel Jakub Dawidek , freebsd-geom@freebsd.org References: <4766507C.6090404@icyb.net.ua> In-Reply-To: <4766507C.6090404@icyb.net.ua> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Subject: Re: gjournal 6.X and fs snapshots X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Dec 2007 10:41:10 -0000 on 17/12/2007 12:33 Andriy Gapon said the following: > Pawel, > > it seems that 6.X gjournal (with .deleted/ directory) keeps files for fs > snapshots "forever". I use "dump -L" to create backups of live > filesystems and noticed that after some days dump fails with: > mksnap_ffs: Cannot create /var/.snap/dump_snapshot: No space left on device > > I looked into .deleted and see 20 files owned by operator with the same > "huge" size (circa size of the whole fs). So my conclusion was that > those are the snapshot files, so I have 20 active snapshots and so I > have exhausted their limit. And yes, using mdconfig and mount I could mount one of the files and it was an image of the fs. > Does this look as a correct understanding ? Is there a way to cleanup > those without a reboot ? Can I simply rm them (without any bad > consequences) ? Well, I removed one and everything seems to have gone ok. So, I guess I could declare this issue a "minor annoyance" and live with it until upgrade to 7. I hope that in 7 gjournal doesn't keep the snapshots around after they are deleted. -- Andriy Gapon From owner-freebsd-geom@FreeBSD.ORG Mon Dec 17 11:06:57 2007 Return-Path: Delivered-To: freebsd-geom@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7641F16A47C for ; Mon, 17 Dec 2007 11:06:57 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 7906A13C45A for ; Mon, 17 Dec 2007 11:06:57 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id lBHB6vHn088218 for ; Mon, 17 Dec 2007 11:06:57 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id lBHB6uQB088214 for freebsd-geom@FreeBSD.org; Mon, 17 Dec 2007 11:06:56 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 17 Dec 2007 11:06:56 GMT Message-Id: <200712171106.lBHB6uQB088214@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-geom@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-geom@FreeBSD.org X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Dec 2007 11:06:57 -0000 Current FreeBSD problem reports Critical problems Serious problems S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/73177 geom kldload geom_* causes panic due to memory exhaustion o kern/76538 geom [gbde] nfs-write on gbde partition stalls and continue o kern/83464 geom [geom] [patch] Unhandled malloc failures within libgeo o kern/84556 geom [geom] GBDE-encrypted swap causes panic at shutdown o kern/87544 geom [gbde] mmaping large files on a gbde filesystem deadlo o kern/89102 geom [geom_vfs] [panic] panic when forced unmount FS from u o bin/90093 geom fdisk(8) incapable of altering in-core geometry o kern/90582 geom [geom_mirror] [panic] Restore cause panic string (ffs_ o kern/98034 geom [geom] dereference of NULL pointer in acd_geom_detach o kern/104389 geom [geom] [patch] sys/geom/geom_dump.c doesn't encode XML o kern/113419 geom [geom] geom fox multipathing not failing back o misc/113543 geom [geom] [patch] geom(8) utilities don't work inside the o kern/113957 geom [gmirror] gmirror is intermittently reporting a degrad o kern/115572 geom [gbde] gbde partitions fail at 28bit/48bit LBA address 14 problems total. Non-critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- o bin/78131 geom gbde "destroy" not working. o kern/79251 geom [2TB] newfs fails on 2.6TB gbde device o kern/94632 geom [geom] Kernel output resets input while GELI asks for f kern/105390 geom [geli] filesystem on a md backed by sparse file with s o kern/107707 geom [geom] [patch] add new class geom_xbox360 to slice up p bin/110705 geom gmirror control utility does not exit with correct exi o kern/113837 geom [geom] unable to access 1024 sector size storage o kern/113885 geom [geom] [patch] improved gmirror balance algorithm o kern/114532 geom GEOM_MIRROR shows up in kldstat even if compiled in th o kern/115547 geom [geom] [patch] for GEOM Eli to get password from stdin 10 problems total. From owner-freebsd-geom@FreeBSD.ORG Tue Dec 18 00:27:54 2007 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73D8F16A417 for ; Tue, 18 Dec 2007 00:27:54 +0000 (UTC) (envelope-from brendonj.lists@gmail.com) Received: from hs-out-2122.google.com (hs-out-0708.google.com [64.233.178.244]) by mx1.freebsd.org (Postfix) with ESMTP id 2BF7B13C44B for ; Tue, 18 Dec 2007 00:27:53 +0000 (UTC) (envelope-from brendonj.lists@gmail.com) Received: by hs-out-2122.google.com with SMTP id j58so2916947hsj.11 for ; Mon, 17 Dec 2007 16:27:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=ds/YLQkDNABRgZdauC6V7aSX4COphy8xvf13MUhR6I8=; b=JwEPDdqXNxcZ+kh/xQpdMqGggpWMCl0yY51YrUhRf9wapT96dCMvU18JQAvwluwmrHcHggZz6vVTqqIAMcX/Qej65Hv0urSlPRWFY3zP/c7zwf0rruvyxtE67NfH2Qa7mEjaXzloVnznvGpsBmTDfxAwRl2faEXYtrv/5/Rkfnw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=QtrVKeaJtS9H+HgjtL7Bpd1vFAFCZL8qXtthWf4Q6CS0ukRo084sU0Xg+R82xzRy/rJ9y4gJ3cN6dYvtdopXFQ3dJsITQbwAr/74bhqBXDOzox7pJjMkZDQkrbWaDwBCbyeY8dujDis26H9xf7iVwgKOnXaxW9Gdlj3oSICZqZ8= Received: by 10.150.146.14 with SMTP id t14mr2658986ybd.67.1197935933734; Mon, 17 Dec 2007 15:58:53 -0800 (PST) Received: by 10.151.9.7 with HTTP; Mon, 17 Dec 2007 15:58:53 -0800 (PST) Message-ID: Date: Mon, 17 Dec 2007 15:58:53 -0800 From: "Brendon Janos" To: freebsd-geom@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: gmirror RAID-1 of 2-slices/disk? (not just 1 slice, not whole-disk ... ) X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Dec 2007 00:27:54 -0000 Hi, I've an amd64 box w/ two identical SATA drives, ad4 & ad6. I've installed FreeBSD 6.2-RELEASE-p9 SMP onto two slices on ad4, partitioned as: ad4s1: / /swap /usr /tmp ad4s2: /var/ /var/db /var/spool /home "All" I'd like to accomplish is to mirror each ad4 slice to ad6. I *thought* this was going to be straighforward ... In addition to spending the weekend poring over threads here, and everything else I could google, I've 'landed' @ these 3 primary references, http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/geom-mirror.html http://people.freebsd.org/~rse/mirror/ http://ezine.daemonnews.org/200502/diskmirror.html Although generally helpful, they all detail whole-disk mirrors, and mention -- without 'howto' detail -- slice mirrors. I've attempted (detail below) to adapt the procedures to my 2-slice scenario; unfrotunately, after slogging through, on reboot, at various times I'm greeted by either: (1) a 'mountroot>' prompt, with a suddenly, completely non-responsive keyboard (2) an error message: "THE FOLLOWING FILE SYSTEMS HAD AN UNEXPECTED INCONSISTENCY ... Unknown Error. Help!" As poignantly punctuated by the "Unknown Error. Help!", I've obviously done something wrong. Can someone please take a look at what I've done and suggest appropriate corrections & improvements? Or, should I be using gvinum? (Yes, I'm aware this all is 'tortured' ... which is consistent with my current state!) Thanks. Brendon # Assign VARs setenv d1 "ad4" setenv d2 "ad6" setenv gm "gm0" # zero out the 2nd disk dd if=/dev/zero of=/dev/${d2} bs=512 count=79 # find the START & SIZE of each source slice setenv start_s1 `fdisk /dev/${d1} | grep -A4 'partition 1' | grep 'start ' |\ head -1 | sed -e 's;^.*start \([0-9]*\).*$;\1;'` setenv start_s2 `fdisk /dev/${d1} | grep -A4 'partition 2' | grep 'start ' |\ head -1 | sed -e 's;^.*start \([0-9]*\).*$;\1;'` setenv size_s1 `fdisk /dev/${d1} | grep -A4 'partition 1' | grep ', size ' |\ head -1 | sed -e 's;^.*size \([0-9]*\).*$;\1;'` setenv size_s2 `fdisk /dev/${d1} | grep -A4 'partition 2' | grep ', size ' |\ head -1 | sed -e 's;^.*size \([0-9]*\).*$;\1;'` # decrement the size of each slice by 1 setenv size_s1 `expr $size_s1 - 1` setenv size_s2 `expr $size_s2 - 1` # create an FDISK config file for the target drive slices cat << EOF > /tmp/fdisk_conf g c16383 h16 s63 a 1 p 1 165 $start_s1 $size_s1 p 2 165 $start_s2 $size_s2 p 3 0 0 0 p 4 0 0 0 EOF # create the target slices, loading a FreeBSD boot0 MBR into the active slice fdisk -v -f/tmp/fdisk_conf -b/boot/boot0 -i /dev/${d2} # assign gmirror labels to each target slice gmirror label -v -n -b round-robin ${gm}s1 /dev/${d2}s1 gmirror label -v -n -b round-robin ${gm}s2 /dev/${d2}s2 # load gmirror load # check gmirror status Name Status Components mirror/gm0s1 COMPLETE ad6s1 mirror/gm0s2 COMPLETE ad6s2 # place BSD partition disklabels onto gmirror slices # reformatted, because I simply couldn't read the reference # modified to sort partitions by OFFSET, so size corrections don't bomb #!/bin/sh for S in 1 2 do (bsdlabel /dev/mirror/${gm}s${S} | grep 'c:'; \ bsdlabel /dev/${d1}s${S} | grep '[abdefgh]:' | sort -k 3n ; \ ) | \ awk 'BEGIN { sizeC = 0; n = 0; } \ /c:/ { \ partC = $1; \ sizeC = $2; \ offsetC = $3; \ fstypeC = $4; \ fsizeC = $5; \ bsizeC = $6; \ printf("%s %d %s %s %s %s\n", \ partC, \ sizeC, \ offsetC, \ fstypeC, \ fsizeC, \ bsizeC ); \ next;} \ /[abdefgh]:/ { \ part = $1; \ size = $2; \ offset = $3; \ fstype = $4; \ fsize = $5; \ bsize = $6; \ if (sizeC > 0 && n+size > sizeC) { size = sizeC-n }; \ n += size; \ printf("%s %d %s %s %s %s\n", \ part, \ size, \ offset, \ fstype, \ fsize, \ bsize ); }' > /tmp/bsdlabel_s${S}.txt bsdlabel -R /dev/mirror/${gm}s${S} /tmp/bsdlabel_s${S}.txt done # dump & restore filesystem data from first to second disk #!/bin/sh for S in 1 2 do for P in `bsdlabel /dev/${d1}s${S} | egrep '^ *[adefgh]:' | sed -e 's/^ *\([adefgh]\).*/\1/'` do FS=`egrep "^ */dev/${d1}s${S}${P}" /etc/fstab | awk '{ print $2; }'` newfs -U /dev/mirror/${gm}s${S}${P} && \ mount /dev/mirror/${gm}s${S}${P} /mnt${FS} && \ dump -L -0 -f- ${FS} | (cd /mnt$FS && restore -r -v -f-) done done # crete a gmirror-aware fstab sed -e "s;dev/${d1}s1;dev/mirror/${gm}s1;g" \ /tmp/fstab.gmirror sed -e "s;dev/${d1}s2;dev/mirror/${gm}s2;g" \ /mnt/etc/fstab # load the mirro on boot echo 'geom_mirror_load="YES"' > /boot/loader.conf # instruct boot stage 2 loader on first disk to boot # with the boot stage 3 loader from the second disk echo "1:ad(6,1,a)/boot/loader" > /boot.config # reboot system shutdown -r now AND, the errors as mentioned above ...