System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Backing up a raw file system

 
SOLVED
Go to solution
mbarak
Occasional Contributor

Backing up a raw file system

Hello Forum,

 

Is that possible to backup a raw file system on HPUX 11iv1? maybe by copying the data to another disk.

 

For the vxfs file system we can use the command copy, shall I use the command dd for the raw file system ?

Did anyone try it before?

 

Thanks. 

3 REPLIES
Matti_Kurkela
Honored Contributor
Solution

Re: Backing up a raw file system

What kind of data does the "raw file system" contain?

 

If it's e.g. an Oracle database, it would be better to use the appropriate database backup/restore tools for that database.(RMAN? Full export? You should ask your DBA to suggest a good solution.)

 

When you have a dd-type backup, your only option is to completely restore the whole raw disk/LV; with a proper database backup, it is easy to restore only selected parts if a full restore is not needed (for example, if you only need to restore one accidentally-deleted table whose name is known).

 

If you want to backup a database with dd, the database should be shutdown (or set in backup mode) while dd runs. Otherwise there is a risk that something might be written to the database while dd is running; if one part of the write operation changes already-backed-up data and another part changes something that dd has yet to copy, your backup will be corrupted, as it will contain a random mixture of data from "before" and "after" the write operation.

 

A "dd" backup will always be the full size of the raw file system, and it must be restored to a disk/LV that is at least the same size: any less and there is a risk that some important data will be truncated. If you restore a "dd" backup to a disk/LV that is larger than the original, the extra capacity is likely to be wasted, unless there is some application-specific method to tell the application to start using the extra space.

 

If you have no other suitable tools and you can shutdown the database/application for backup, it is possible to use dd. But I strongly suggest using some other tool that is more appropriate to whatever is inside your raw filesystem.

MK
Hein van den Heuvel
Honored Contributor

Re: Backing up a raw file system

 

I largely agree with Matti, but best I know you _can_ pipe DD output from a raw into a compress too (like zip/bzip2/gzip -c) and visa versa.

That way the file can be a lot smaller than then raw device, notably if the raw device was intiallized  with all zeros before use (dd if=/dev/zero of=...).

Also, be sure to use a large blocksize on the dd. For example bs=1m

 

hth,

Hein

 

rariasn
Honored Contributor

Re: Backing up a raw file system

Hi:

 

Sample copy with "ssh"

 

dd if=/dev/vgoracle/rlvol1 bs=64K| ssh node2 "dd of=/dev/vgoracle/rlvol1 bs=64k"

 

rgs,