Backing up using fssnap and ufsdump

Hi all!

Here's my situation:
I need to backup a running system before I can bring it down
I've tried performing a ufsdump while it's in multi-user mode but my ufsdump fails because there is too much activity on the system.

So I read that I could use fssnap to create a snapshot of (in my case / ) and then I could use ufsdump to create a backup of that snapshot.

But I get confused trying to understand how I am able to get this to work

I noticed that I cannot use fssnap on the same filesystem so I've attached 2 extra HDD's (/backup is a 146GB and /mnt is 72GB)

So I created a snapshot of / with a maxsize of 16 ( / is only 15GB)

#fssnap -F ufs -o maxsize=16g,backing-store=/backup /

# /usr/lib/fs/ufs/fssnap -i /

Snapshot number               : 0

Block Device                  : /dev/fssnap/0

Raw Device                    : /dev/rfssnap/0

Mount point                   : /

Device state                  : idle

Backing store path            : /backup/snapshot0

Backing store size            : 8352 KB

Maximum backing store size    : 16777216 KB

Snapshot create time          : Wed Oct 20 15:18:30 1999

Copy-on-write granularity     : 32 KB

I then copied the VTOC to my 72GB drive (/mnt)

# prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s - /dev/rdsk/c0t3d0s2

fmthard:  New volume table of contents now in place.

 

# newfs /dev/rdsk/c0t3d0s2

newfs: construct a new file system /dev/rdsk/c0t3d0s2: (y/n)? y

Warning: 2496 sector(s) in last cylinder unallocated

/dev/rdsk/c0t3d0s2:     143349312 sectors in 23332 cylinders of 48 tracks, 128 sectors

        69994.8MB in 1459 cyl groups (16 c/g, 48.00MB/g, 5824 i/g)

super-block backups (for fsck -F ufs -o b=#) at:

 32, 98464, 196896, 295328, 393760, 492192, 590624, 689056, 787488, 885920,

Initializing cylinder groups:

............................

super-block backups for last 10 cylinder groups at:

 142447776, 142546208, 142644640, 142743072, 142841504, 142939936, 143038368,

 143136800, 143235232, 143333664

 

# mount -F ufs -o rw /dev/dsk/c0t3d0s0 /mnt


The command in question is this:

This will create a backup of /backup (disk2) and restore it under /mnt (disk3)

# ufsdump 0f - /backup | ( cd /mnt ; ufsrestore xvf - )

After I started this job I came across this error

DUMP: "yes" or "no"? DUMP: NEEDS ATTENTION: Do you want to attempt to continue? ("yes" or "no")

I said yes, and it continued on; said something about
DUMP: Warning - block 1651667564 is beyond the end of hard disk

Right now it is still performing the ufsdump / ufsrestore
So I will know later in the day, or tomorrow when this is finished

So I don't know if it will fail, I know I need to install the boot block and then I will try to boot from that drive

But does anyone have any ideas or better alternatives to how I am doing this?
My references were the sun doc sites but I couldn't get a very good idea as they were pointing to tape and I am pointing to hard disk (which should work the same I think)

It should be:

# ufsdump 0f - /dev/rfssnap/0 | ( cd /mnt ; ufsrestore xvf - )

/backup is used only to store data that has changed since creating snapshot. /dev/rfssnap/0 contains the snapshot itself. I didn't test it though :wink:

bartus thank you! :slight_smile:

I will let you all know how this goes for me.

Here's what I did!

# fssnap -F ufs -o maxsize=5g,backing-store=/backup,unlink / 
/dev/fssnap/0

# /usr/lib/fs/ufs/fssnap -i
Snapshot number               : 0
Block Device                  : /dev/fssnap/0
Raw Device                    : /dev/rfssnap/0
Mount point                   : /
Device state                  : idle
Backing store path            : /backup/snapshot0 <UNLINKED>
Backing store size            : 896 KB
Maximum backing store size    : 5242880 KB
Snapshot create time          : Thu Oct 21 16:15:28 1999
Copy-on-write granularity     : 32 KB

# ufsdump 0f - /dev/rfssnap/0 | ( cd /mnt ; ufsrestore xvf - )
Verify volume and initialize maps
  DUMP: Date of this level 0 dump: October 21, 1999  4:15:28 PM EDT
  DUMP: Date of last level 0 dump: the epoch
  DUMP: Dumping /dev/rfssnap/0 to standard output.
  DUMP: Mapping (Pass I) [regular files]
  DUMP: Mapping (Pass II) [directories]
  DUMP: Writing 32 Kilobyte records
  DUMP: Estimated 30682412 blocks (14981.65MB).
Dump   date: October 21, 1999  4:15:28 PM EDT
Dumped from: the epoch
Level 0 dump of an unlisted file system on cm02:/dev/rfssnap/0
Label: none
  DUMP: Dumping (Pass III) [directories]
Extract directories from tape

So far so good :slight_smile: It's currently making the nodes

After looking at the documentation again (for anyone else who still has questions)

The backing-store is a location that houses any changes since the snapshot you created.
The raw device is the virtual device the system creates to hold the snapshot in my case (/dev/rfssnap/0)

Hopefully all goes well
I'll update when this is finished

It worked!

Thanks for all the help! :slight_smile:
All I had to do was install the boot partition

# /usr/sbin/installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c0t3d0s0