Search This Blog

Tuesday 6 July 2010

Solaris Backup and Restore with ufsdump :- Some useful options-


1. Backing up to a file:

root@host #  ufsdump -0f /admin/backup/etc.dump /etc
  DUMP: Date of this level 0 dump: Mon Jul 05 16:41:36 2010
  DUMP: Date of last level 0 dump: the epoch
  DUMP: Dumping /dev/rdsk/c1t0d0s0 (cat:/) to /admin/backup/etc.dump.
  DUMP: Mapping (Pass I) [regular files]
  DUMP: Mapping (Pass II) [directories]
  DUMP: Writing 32 Kilobyte records
  DUMP: Estimated 148290 blocks (72.41MB).
  DUMP: Dumping (Pass III) [directories]
  DUMP: Dumping (Pass IV) [regular files]
  DUMP: 147902 blocks (72.22MB) on 1 volume at 8136 KB/sec
  DUMP: DUMP IS DONE


2. Restoring data from backup file.

For non interactive (this will restore everything) restore:-

ufsrestore -xvf /admin/backup/etc.dump
for interactive restore:-
ufsrestore -ivf /admin/backup/etc.dump
Here is the proceedure to restore single file named hosts.090610 only.
 ufsrestore -ivf /admin/backup/etc.dump

root@host # ufsrestore -ivf etc.dump
Verify volume and initialize maps
Media block size is 126
Dump   date: Mon Jul 05 16:41:36 2010
Dumped from: the epoch
Level 0 dump of a partial file system on cat:/etc
Label: none
Extract directories from tape
Initialize symbol table.
ufsrestore >
ufsrestore > cd /etc
ufsrestore > ls hosts*
   1378  hosts
   5795  hosts.090610
ufsrestore >
ufsrestore > add hosts.090610
Warning: ./etc: File exists
ufsrestore > extract
Extract requested files
You have not read any volumes yet.
Unless you know which volume your file(s) are on you should start
with the last volume and work towards the first.
Specify next volume #: 1
extract file ./etc/hosts.090610
Add links
Set directory mode, owner, and times.
set owner/mode for '.'? [yn] y
Directories already exist, set modes anyway? [yn] y

3. Copying the contents of a directory to another directory including symbolic links. This is useful when you want to migrate data to new mount point or different path.

Here, all the data /etc will be copied to /admin/backup/etc.

root@host #mkdir /admin/backup/etc
root@host# ufsdump -0f  - /etc|(cd /admin/backup/etc;ufsrestore -xvf -).

Just before this command finish, it may prompt for setting ownership, it must be answered as yes.

After complete above command, if  you found that its restored using relative path, you can just use mv command to move the data.

For instance, if the restoration happend /admin/backup/etc/etc, you do a mv *  /admin/backup/etc/etc/* /admin/backup/etc.


Ref:


Solaris 10 System Administration Essentials

No comments:

Post a Comment