Dump/restore to clone disk

Matthew Seaman m.seaman at infracaninophile.co.uk
Mon Feb 22 09:33:14 UTC 2010

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

and succeeding chapters

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



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


More information about the freebsd-questions mailing list