From owner-freebsd-questions@FreeBSD.ORG Thu Nov 19 15:19:00 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B07871065679 for ; Thu, 19 Nov 2009 15:19:00 +0000 (UTC) (envelope-from gnemmi@gmail.com) Received: from mail-fx0-f227.google.com (mail-fx0-f227.google.com [209.85.220.227]) by mx1.freebsd.org (Postfix) with ESMTP id 1099C8FC14 for ; Thu, 19 Nov 2009 15:18:59 +0000 (UTC) Received: by fxm27 with SMTP id 27so2615538fxm.3 for ; Thu, 19 Nov 2009 07:18:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=pttu1iSGoHXs16CFZL8A+j+Hh6Ev3d+i37qKbRqEG3U=; b=jjtNbLAqvjspg0L9qZ4WVoJG+Pfe3EEYcEfcwvccGs0zOv3QcoGmwgJzpAH636zmMZ xPU+kBasMgd6YWZ58X1LElbRLTI7JJYFs4KwOV8pOmzUxnSjnW6C1quTNd3wJf8NkhGt xIi0pcHg2j4+qUwSZW8wW/VsONomwivclbw9U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=VTvvcB5awhbWwjhy77NUP/01f61snT0DK8VXjgxUI3y/kwK3930kHrObzY2T7X8LWU oGs6IUGfmnpBZ17/ccx8UF2059fsua9qljoiUdQmR31bxbKzBO7EkD8Ux8Uu74H7vErY hbOW8Vn10b2S6+LSwj7boAVVRayiLkycoj7do= MIME-Version: 1.0 Received: by 10.103.76.34 with SMTP id d34mr57313mul.31.1258643939016; Thu, 19 Nov 2009 07:18:59 -0800 (PST) In-Reply-To: <4B054D6D.9040304@otenet.gr> References: <8021a2660911190504s65a197d7r60205a648f27c187@mail.gmail.com> <4B054D6D.9040304@otenet.gr> Date: Thu, 19 Nov 2009 12:18:58 -0300 Message-ID: <19e9a5dc0911190718v62f0446ga467684d8aa69872@mail.gmail.com> From: Gonzalo Nemmi To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Re: moving an entire system 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: Thu, 19 Nov 2009 15:19:00 -0000 On Thu, Nov 19, 2009 at 10:51 AM, Manolis Kiagias wrote: > n dhert wrote: > > I want to move the contents of a freebsd72 system entirely to different > > hardware (also Intel 64-bit), using dump/restore > > These are the filesystems now: > > /dev/da0s1a 2026030 650876 1213072 35% / > > /dev/da0s1e 20308398 652820 18030908 3% /tmp > > /dev/da0s1f 95719170 12449998 75611640 14% /usr > > /dev/da0s1d 20308398 2960282 15723446 16% /var > > /dev/da1p1 2175407698 168279068 1833096016 8% /home > > How should one proceed? I have an 286 Gb external USB disk formatted with > a > > single > > slice large enough to hold all dumps of all fileystems, mounted on > /seagate > > /dev/da2s1a 283810126 12 260463064 0% /seagate > > > > a. put the original machine in single-user mode > > b. use dump (could L be left out if machine is in single-user mode?) > > > > yes > > /sbin/dump -0aL -f /seagate/dumpofroot.dmp /dev/da0s1a > > /sbin/dump -0aL -f /seagate/dumpoftmp.dmp /dev/da0s1e > > /sbin/dump -0aL -f /seagate/dumpofusr.dmp /dev/da0s1f > > /sbin/dump -0aL -f /seagate/dumpofvar.dmp /dev/da0s1d > > /sbin/dump -0aL -f /seagate/dumpofhome.dmp /dev/da1p1 > > > > so far so good. You probably don't need to dump /tmp. > > > c. on the target machine, do a complete install of freeBSD72 from CD with > > same partition layout as original machine > > > > No need. Just boot using the DVD or LiveFS and select the fixit option, > and the 'Use the Live CD/DVD filesystem' > > > (On the target machine /home will be on /dev/da0s1g (no longer on > > /dev/da1p1)) > > > > d. target machine, plug in the external USB disk and mount it > > # mkdir /seagate > > # mount /dev/da2s1a /seagate > > > > e. restore file systems > > How exactly ? is this ok for /home : > > # umount /home > > # /sbin/newfs /dev/da0s1g > > # /sbin/mount /dev/da0s1g /mnt > > # cd /mnt > > # /sbin/restore rf /seagate/dumpofhome.dmp > > # umount /mnt > > # mount /dev/da0s1g /home > > > > for /tmp, /usr and /var? > > It is safe to use same procedure? or else, how to do ? > > > > And what for / file system ??? > > will same procedure work ? > > > First off, use the fdisk option of sysinstall to create a slice. Press > w to exit, so the slice table is immediately written to disk. You may > also use sysinstall to create the individual partitions, although this > can be accomplished with bsdlabel once you are at the prompt. > > Install the MBR and boot blocks (assuming /dev/da0 is your boot disk and > /dev/da0s1 is the FreeBSD slice): > > fdisk -B /dev/da0 > bsdlabel -B /dev/da0s1 > > newfs all the new partitions, using -U for soft updates where needed. > Usually soft updates are used in /var /usr and /tmp > > newfs /dev/da0s1a > newfs -U /dev/da0s1d > newfs -U /dev/da0s1e > newfs -U /dev/da0s1f > and so on. You may also add journaling (gjournal) at this point, it is > actually quite easy. > > You will need two temporary mount points, one for your external drive > and one for the partition you will be restoring. The /mnt is available > as a mount point in the LiveFS cd, create another temporary one: > > mkdir /seagate > > Now, mount your backup in /seagate: > > mount /dev/da2s1a /seagate > > Mount one of the new partitions in /mnt: > > mount /dev/da0s1a /mnt > cd /mnt > TMPDIR=/seagate restore -rvf /seagate/dumpofroot.dmp > > Note: restore will need some tmp space, hence the TMPDIR > Before you umount /, edit at least /mnt/etc/fstab and fix your device > entries with the new ones. > > cd / > umount /mnt > > Repeat with all other partitions. Don't forget to newfs the /tmp > partition that you will not be restoring. > I hope you get the general idea, you will have to adjust this slightly > for your needs. > > After the first normal boot: > > chmod -R 1777 /tmp > chmod -R 1777 /var/tmp > > (set sticky bit on temp space) > > > Thank you both for this really clear, explanative, concise and plain simple how-to! I will probably edit some parts, translate it to spanish and post it in my forum. As soon as I do so, I'll let you guys know. You guys just wrote a _should_be_in_a_magazine_ article ! Thank you! Best Regards Gonzalo Nemmi