From owner-freebsd-questions@FreeBSD.ORG Thu Nov 19 17:39:58 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 3A4931065695 for ; Thu, 19 Nov 2009 17:39:58 +0000 (UTC) (envelope-from rsmith@xs4all.nl) Received: from smtp-vbr1.xs4all.nl (smtp-vbr1.xs4all.nl [194.109.24.21]) by mx1.freebsd.org (Postfix) with ESMTP id DDC4F8FC2A for ; Thu, 19 Nov 2009 17:39:57 +0000 (UTC) Received: from slackbox.xs4all.nl (slackbox.xs4all.nl [213.84.242.160]) by smtp-vbr1.xs4all.nl (8.13.8/8.13.8) with ESMTP id nAJHdtQK091691; Thu, 19 Nov 2009 18:39:56 +0100 (CET) (envelope-from rsmith@xs4all.nl) Received: by slackbox.xs4all.nl (Postfix, from userid 1001) id C411ABABF; Thu, 19 Nov 2009 18:39:55 +0100 (CET) Date: Thu, 19 Nov 2009 18:39:55 +0100 From: Roland Smith To: n dhert Message-ID: <20091119173955.GA70521@slackbox.xs4all.nl> References: <8021a2660911190504s65a197d7r60205a648f27c187@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="huq684BweRXVnRxX" Content-Disposition: inline In-Reply-To: <8021a2660911190504s65a197d7r60205a648f27c187@mail.gmail.com> X-GPG-Fingerprint: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 X-GPG-Key: http://www.xs4all.nl/~rsmith/pubkey.txt X-GPG-Notice: If this message is not signed, don't assume I sent it! User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: by XS4ALL Virus Scanner Cc: freebsd-questions@freebsd.org 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 17:39:58 -0000 --huq684BweRXVnRxX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 19, 2009 at 02:04:03PM +0100, n dhert wrote: > I want to move the contents of a freebsd72 system entirely to different > hardware (also Intel 64-bit), using dump/restore If you are running a custom kernel, check that all the drivers for the new hardware are in there! Or switch to the GENERIC kernel before making backup= s. > 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 /seaga= te > /dev/da2s1a 283810126 12 260463064 0% /seagate >=20 > a. put the original machine in single-user mode > b. use dump (could L be left out if machine is in single-user mode?) The L flag is used to denote a live (i.e. mounted) filesystem. So I would k= eep it, unless you can unmount the filesystem you want to dump. If you are using the -L flag there is no need to switch to single user mode. > d. target machine, plug in the external USB disk and mount it > # mkdir /seagate > # mount /dev/da2s1a /seagate Think about your filesystem (bsdlabel) sizes before you create them on the = new machine. If you want to change anything, now is the time. :-) From the look= of it you've got plenty of space, but maybe you want to make /home even bigger= by making /usr and /var smaller, or the other way around? =20 > 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 That looks OK. Personally I always encrypt the partition that contains my /= home with geli(8): geli init -l 256 /dev/da0s1g geli attach /dev/da0s1g newfs -U /dev/da0s1g.eli mount /dev/da0s1g.eli /home The geli init command will ask you to supply a password. The 'geli attach' will ask for the newly chosen password before it created the encrypted device. At the next boot you will be asked for the password before /home is mounted. (Don't forget to change /etc/fstab accordingly!). In the unfortunate case that your machine is stolen, encryption protects yo= ur privacy by preventing others from reading your private data! > for /tmp, /usr and /var? I wouldn't bother with making a backup of /tmp. If your new hardware differs from the old one, you should check if to need = to adapt /boot/loader.conf, /etc/rc.conf (different network chip?) and /etc/sysctl.conf (e.g. hw.snd.default_unit if the new machine has more than one sound device). Also check if /etc/fstab is still valid. In general, che= ck all configuration files that could have an inpact. On the other hand, you might want to take the opportunity to switch to 8.0-PRERELEASE. In that cause you only have to backup your own data and the system configuration files. Roland --=20 R.F.Smith http://www.xs4all.nl/~rsmith/ [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated] pgp: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 (KeyID: C321A725) --huq684BweRXVnRxX Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.13 (FreeBSD) iEYEARECAAYFAksFgusACgkQEnfvsMMhpyWfmQCfY5p0o0K5vfQX4kNiIwviiVir j2kAn1OFIaG3I1Lk/0B74wdlV/Kp/ZCg =0guM -----END PGP SIGNATURE----- --huq684BweRXVnRxX--