Dump and restore a file system

From ezUnix
Jump to: navigation, search
                                    pdf_icon.png Download this article as a single PDF document 


It's very easy to create a dump of your UFS file system and restore it afterwards.
The files created by ufsdump will dump only copy system files and not entire partition as opposite to 'dd' and this way save significant amount of space.


This HowTo was written using OpenSolaris 2008.11 on an Intel x86-compatible computer.


We assume your backup is mounted as a separate drive on /backup
Run following command to create a system dump of your root slice:

# cd /backup
# dumpfs 0fu root-dump /dev/dsk/c1t0d0s0

This command dumps / mounted on /dev/dsk/c1t0d0s0 with Level 0 dump. There are 9 dump levels
From man ufsdump(1M):

All files specified  by  files_to_dump
that  have  been  modified  since  the last ufsdump at a
lower dump level are copied to the dump_file destination
(normally  a  magnetic tape device).  For instance, if a
"level 2" dump was done on Monday, followed by a  "level
4"  dump  on  Tuesday,  a  subsequent  "level 3" dump on
Wednesday would contain  all  files  modified  or  added
since  the  "level  2" (Monday) backup. A "level 0" dump
copies the entire file system to the dump_file.

To restore your backup run ufsrestore(1M), i.e. to restore file with backup of your root file system, mount this file system somewhere, cd to it and run ufsrestore, i.e:

# mount /dev/dsk/c1t0d0s0 /mnt
# cd /mnt
# ufsrestore xf root-dump 

That's all folks!


<comments />

Azan said ...

<comment date="2013-01-10T08:14:21Z" name="Azan"> קרס לי ה hard disk ואני בשגעון של לנסות לשחזר את הקבצים והתמונות שלי.יכולים לתת לי המלצה על חברת שחזור קבצים שמשחזרת כונן קשיח?מישהו מכיר את או את recover ויכול להמליץ או על חברה אחרת? אולי אתם מכירים תוכנה טובה לשחזור קבצים לבד? </comment>