Dump & Restore to smaller partition

Jerry McAllister jerrymc at clunix.cl.msu.edu
Tue Jul 5 14:36:15 GMT 2005


> 
> Hello,
> 
> Does anyone know if the dump and restore method for
> moving a partition to a new disk requires the destination
> partition to be as big or bigger that the source?

It will need to be big enough to contain all the data.
It the old file system had a lot of empty (unused) space then
the new one can be smaller by about the amount of space
that was unused..   

> >From my understanding, the whole partition, including
> blank space will be dumped and restored. If this is the
> case then the destination will need to be at least as big.

Only the files (directories are also files) get dumped.  It
does not dump the filesystem as it was newfs-ed.  Rather it
makes a list of all the files & directories by inode number and
then dumps each along with all ownership, permission, flag and
link information.

> My situation is as follows:
> I have a 30GB usr partition with about 10GB of data in it.
> I want to move this data (flags and all!) to a new 20GB
> usr partition.
> 
> Will dump/restore do this? .. or what should i use?

No problem.

After making the new partition with disklabel and making a filesystem 
out of it with newfs.   Presuming your old 30 GB filesystem is mounted
as /fsa and the new 20 GB filesystem is mounted as /fsb, 

    dump 0af /fsa/fsa.dump /fsa
    cd /fsb
    restore rf /fsa/fsa.dump

should work just fine - although it makes me nervous to put the
dump file in the same filesystem you are dumping.   Since it makes
the inode list before it starts dumping and creating the dump file,
it should work.  It just feels weird.    So, if you have some other
place to put a 10 GB dump file, then go ahead and use it instead.

////jerry

> 
> Thanks! 
> Gareth
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"


More information about the freebsd-questions mailing list