[PC-BSD Testing] Backing up a PC-BSD disk

Kris Moore kris at pcbsd.org
Mon Nov 1 07:28:58 PDT 2010


On Mon, Nov 01, 2010 at 12:49:47PM +0300, Odhiambo Washington wrote:
> I installed PC-BSD (FreeBSD option) on a disk on which I only created /
> (ufs+journal) and swap.
> >From the handbook (
> http://www.freebsd.org/doc/en/articles/gjournal-desktop/article.html), I am
> still unable to tell how much space the PC-BSD installer allocated for the
> journal provider, which according to my understanding, resides on the same
> partition as the data.
> 
> Is the journal size defaulting to 1GB as the handbook says, or does the
> installer use a different value?
> 
> 
> [wash at gw ~]$ df -h
> Filesystem          Size   Used     Avail    Capacity Mounted on
> /dev/label/rootfs0  273G    9.8G   242G   4%         /
> devfs                   1.0K     1.0K       0B   100%     /dev
> devfs                   1.0K     1.0K       0B   100%     /var/named/dev
> 
> I am so much used UFS2 type filesystem where I create / and swap and I'd
> always get an identical size disk for backup. The backup would take the
> form:
> 
> dump -L0af - / | (cd /disk2; restore -rf -) # And this is disk duplication
> to me, so I can use disk2 as primary disk should disk one fail.
> 
> When it comes to ufs+journal, I am a bit lost on how to do things right when
> I need to make a second disk (disk2) to have same partition layout as disk
> 1.
> 
> Suppose both disks are 320GB, can I use dd to create the duplicate
> structure, with journaling enabled??
> dd if=/dev/adX of=/dev/adY bs=1m
> 
> But if you tell me that the PC-BSD installer allocated 1GB for the journal,
> then I can follow the handbook instructions to partition my disk
> accordingly. However, given that the installer mounted /dev/label/rootfs0 on
> /, I am not sure what will be the name of my filesystem on disk2 when I
> create it from the CLI. I'd love to partition as follows:
> 
> gw# bsdlabel -A /dev/ad4
> bsdlabel: /dev/ad4: no valid label found
> 
> Since I am unable to read the disk label of the first disk, I am not certain
> how to go about creating a similar label on disk2. I thought I could read
> out the disk label on disk1 and just write that to disk 2.
> 
> 
> Secondly, I am not sure how I can backup the first disk onto disk2 using
> dump once I have done the labels.
> 
> 
> -- 
> Best regards,
> Odhiambo WASHINGTON,
> Nairobi,KE
> +254733744121/+254722743223
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> Damn!!

> _______________________________________________
> Testing mailing list
> Testing at lists.pcbsd.org
> http://lists.pcbsd.org/mailman/listinfo/testing

Personally when I do a backup / clone to another drive, I prefer to just use "tar" to backup
all the files individually, and then re-create the partitions on the new disk fresh, since geom may
be different between them, etc. 

So, heres how I would do it:

# cd /
# tar cvjf /usr/myback.tbz --exclude ./usr/myback.tbz --exclude ./dev .

Then format / mount the new disk somewhere, like /mnt, and extra the archive:

# cd /mnt
# tar xvpf /usr/myback.tbz

Then if you partitioned correctly, you should be able to boot right off the new disk :)


-- 
Kris Moore
PC-BSD Software


More information about the Testing mailing list