UFS Backup

killasmurf86 said:
If you want to skip some parts of file system tree when you make backup with dump, you can set nodump flag on that directory with chflags(1) prior to dumping

Good to know, thanks, but does chflags nodump allow one to block off a dump of an entire directory and all its subdirectories? That would mean that dump would need to build an internal directory tree, which is quite counter to the (classical) design of dump. I can see that chflags can easily block the dumping of a particular file (inode), but that's pretty limited in usefulness (maybe good for bad block inodes though...)
 
dump(8) does build a directory tree.

Directories and regular files which have their “nodump” flag (UF_NODUMP)
set will be omitted along with everything under such directories, subject
to the -h option.
 
wblock said:
dump(8) does build a directory tree.
hmmm.. I guess I should try it...

It still would seem to have some problems/issues... the NODUMP flag resides at the inode level, no? So then what happens if a file (inode) is flagged as NODUMP, but is multiply linked in other directories which are not NODUMP flagged. Those directories will be missing a file that probably should be there, or not...

Or what happens if there is a filesystem inconsistency and there is, for example, a stray link in a NODUMP directory back to root... could get nasty.

Here's what McKusick said a while ago, but perhaps dump has changed since then...
The dump program runs on the raw disk partition dumping sequentially by inode number. So, it has no idea of the file-tree hierarchy. Thus any propagation of the "nodump" flag would have to be done by the filesystem (or by using a different archiving program)... (i.e. chflags -R nodump manually)

Kirk McKusick

===testing

Indeed I think I have found a problem with the nodump flag:

Code:
mkdir test
mkdir test2
cp bigfile test
ln test/bigfile test2
chflags nodump test
dump 0Lahf 0 /tmp/dumpfile DEV_THIS_FS

and the dump fails to contain test2/bigfile even though there is no nodump flag on bigfile, only on the test directory. This is wrong, in my view...
 
That's because dump doesn't consider nodump flags if it is dumping level 0 snapshot. Use level 1 (or above), for example:
Code:
dump -1aLu -f /backup/root.dmp /
 
bbzz said:
That's because dump doesn't consider nodump flags if it is dumping level 0 snapshot. Use level 1 (or above), for example:
Code:
dump -1aLu -f /backup/root.dmp /

A suggestion on dump flags:

# dump -1[b]Lauf[/b] ....
^^ very easy to remember
 
UFS2? and backup all slices

Hi I'm only familiar with ufsdump/ufsrestore on Solaris 10. I found it awesome for bare metal system-state restore. Still trying to get comfortable with this using ZFS on root. In fact I'm considering using only UFS2 for root + OS related filesystems.

Does dump/restore work witht the latest UFS2 (UFS+J, UFS+S etc) filesystems? Sorry, I'm new to FreeBSD.

Also, on Solaris ufsdump uses the special reserved slice 2 to backup entire disk. Then you just partition and format the new slices, move to / and ufsdump the whole lot. Worked well for me. Does FreeBSD have an equivelent of slice 2 (the backup slice)?
 
It works fine.

I also should work with UFS2+SJ when that will be available

Not sure what is this slice 2 on Solaris
 
Thanks for confirming that dump/restore works on current UFS2 filesystems.

In Solaris UFS, slice 2 is a reserved slice, slice 0 is usually / (root), slice 1 is swap, /usr is commonly put on s3, /var on s4 etc.

If your HD is c0t0d0 (controller zero, terminal zero, disk zero) then c0t0d0s0 is root filesystem, c0t0d0s1 is swap, c0t0d0s3 may be /usr, c0t0d0s5 may be /home (actually /export/home on Solaris). But c0t0d0s2 relates to the whole disk, sometimes called overlap. So ufsdump -0f /mnt/backup.dump /dev/dsk/c0t0d0s2 will back up the entire disk.

I guess FreeBSD doesn't have an overlap slice. Not a big deal probably, just have to backup slices separately.

Would this be a good layout for a FreeBSD 8.2/9 installation?:

Code:
da0s1a         => / (UFS2)
da0s1b         => swap
da0s1c         => /usr (UFS2)
da0s1d         => /var (UFS2)
da0s2          => data (zpool)
data/usr/local => /usr/local  (zfs)
data/usr/home  => /usr/home (zfs)
data/mysql     => /var/db/mysql (zfs)
...etc...
 
In FreeBSD, if you're using bsdlabels (bsdlabel(8)), then you have label c, which is unused, However I don't know what is it's purpose...
I don't think dump would work on it
 
Hi,
I'm new on FreeBSD and have some trouble with restoring my backup. I'm on the "single user mode", I format my partition with [cmd=]newfs -U /dev/ad....[/cmd] and mount it. The problem is that this partition was the /usr and it seems like binaries like gzcat were there... So I have no way to unzip my compressed backup file!

Is there a way to unzip it without the need of my other OS (linux/mageia) and enough space on it to temporarly store the uncompressed dump (My external backup hard drive is FAT formated, so can't deals with files bigger than 4GB ...)

Thanks
 
Yes, gunzip was in /usr/bin/

You can download FreeBSD DVD or Fixit CD, burn it and boot from it.
There you can go to Fixit mode and from there you can fix just about anything, as there will be all the tools you need.

I recommend to keep /usr with root fs, not much point in separating it. /usr/local however is other case, as it contains stuff installed from ports.
 
First, thanks for the fast answer!

/usr and / are separate fs because I've strictly followed a "how to install FreeBSD" :) On Linux I used to do only 2 partitions : / and /home.

BTW, my problem is not there, since I do dump/restore just to be able to resize my ufs partitions. It seems to be the best (only?) way to do that. So one day in the future I will have to restore the root directory too!

Do you think I can do all these stuff directly from the install CD? It's sure that it will be easier since the partitions won't be on read-only mode (such as my root directory now...) and I will have all the tolls needed!

thanks
 
Install CD, might not contain fixit mode.... (DVD and Fixit CD does)
Anyway, there shouldn't be any problems

P.S.
Some defaults should be overlooked (I think)
 
thanks for the idea.
It was hard to find a liveCD booting my machine, but frenzy 1.3 did. So I could format and restore everything. :beer

wblock : I saw you site during my search, but when I saw the size of the .iso, I was afraid that there was missing some tools :)
 
Hi, I been reading this thread. I need to come up with a backup solution to my server.

I need to backup everything to a usb external hard drive. The hard drive is formatted with fat32. Since I used it with windows currently. I want to use this to backup my server that is using FreeBSD 8.1 currently. I want to do the backups soon.

I want to install FreeBSD 9.0 well upgrade my system. Is it worth upgrading my system?

I seen many users on these forums complaining about hardware issues not working after installing FreeBSD 9.0 or upgrading from 8.0 to 9.0

Yet, first off I would like to know what needs to be typed to backup the whole file system/hard_drive.

I need a complete backup where I know 100% for sure if anything goes wrong I can rely on this backup to bring my server back to where it should be at.

I do know I need to use a dump level 0. Just need to know how I can copy everything from root to my external hard drive.
 
It isnt working when i try to restore the mbr, i have to set the bs to 512K or it just dont apear to copy the partition table. I'm checking it by using ls on /dev.

Basically when i use "dd if=/dev/ada0 of=/dev/ada1 bs=512 count=1" what apears on /dev is /dev/ada1, but when i set the bs to 512K, the partitions apears, but i cant mount it anywhere.

Can anyone help me?

PS: I'm new to FreeBSD, and i'm not a native english speaker. :p
 
Back
Top