Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Nov 2009 18:39:55 +0100
From:      Roland Smith <rsmith@xs4all.nl>
To:        n dhert <ndhert@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: moving an entire system
Message-ID:  <20091119173955.GA70521@slackbox.xs4all.nl>
In-Reply-To: <8021a2660911190504s65a197d7r60205a648f27c187@mail.gmail.com>
References:  <8021a2660911190504s65a197d7r60205a648f27c187@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20091119173955.GA70521>