Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Feb 2010 09:33:01 +0000
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        Aiza <aiza21@comclark.com>
Cc:        freebsd-questions <questions@freebsd.org>
Subject:   Re: Dump/restore to clone disk
Message-ID:  <4B824F4D.5010200@infracaninophile.co.uk>
In-Reply-To: <4B82416B.7050001@comclark.com>
References:  <4B82416B.7050001@comclark.com>

next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 22/02/2010 08:33, Aiza wrote:
> What happened to swap? The fstab will be showing it as
> the first file system on the hard drive slice.
> Is something missing here?

Swap isn't a filesystem.  There's no persistent content in a swap
partition, so there's nothing to copy.  All you need to do is identify
a partition as a swap area within /etc/fstab, and the system will
initialise it automatically at boot-time.

> What about the file system sizes.
> Will the restored hard drive have the same
> file system sizes as the source file system?

No -- this is not necessary.  So long as the target filesystem is
sufficiently big to contain all of the contents of your dump, it should
work fine.

> Is there some way to allocate larger file systems
> on the target without using sysinstall to prepare
> the target beforehand?

Certainly.  sysinstall(8) really isn't the right tool for this sort of
disk operation once you've got beyond doing an initial installation.
For the default combination of UFS+MBR look at the following man pages:

    * fdisk(8) -- create and manage PC slices on the drive
    * boot0cfg(8) -- install/configure boot managers (not generally
       needed)
    * bsdlabel(8) -- create BSD partition tables within a slice
    * newfs(8) -- write a filesystem onto a partition

There are alternatives nowadays: gpart(8) effectively replaces fdisk
and bsdlabel on systems using GPT or EFI or various other
technologies.  zfs(8) similarly replaces bsdlabel and newfs if you want
to use that for managing your disks.

For more information see:


http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/disks-adding.html
and succeeding chapters
    http://lists.freebsd.org/pipermail/freebsd-geom/2009-April/003440.html
    http://wiki.freebsd.org/ZFS

> Is there some command to display
> the file system allocation size?

df(1) shows you the size of filesystems, bsdlabel(8) shows you the size
of the underlying partitions.  Normally the filesystem will completely
fill the partition it is created in, but it is possible to increase the
size of a partition without increasing the size of the filesystem.
There's not much point in doing that, as it just wastes space:
growfs(8) can expand a filesystem to match the enclosing partition.

To see the size of partitions via bsdlabel(1):

   #  bsdlabel da0s1
# /dev/da0s1:
8 partitions:
#        size   offset    fstype   [fsize bsize bps/cpg]
  a: 67487663  4194304    4.2BSD     2048 16384 28552
  b:  4194304        0      swap
  c: 71681967        0    unused        0     0         # "raw" part,
don't edit

'size' is given here in units of 512byte sectors -- so the 'a' partiton
is 32.2GiB.

	Cheers,

	Matthew


- -- 
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
                                                  Kent, CT11 9PW
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkuCT00ACgkQ8Mjk52CukIxiBACfWFxImCy9AamOcH3+pafroBCw
404Ani9lZiKoEQzMOx7iQAZycUIS9Wec
=a97y
-----END PGP SIGNATURE-----



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