Clone Solaris system using cpio backup

Prtvtoc /dev/rdsk/c0t0d0s0

???

Excuse me for my question...what did you mean by "comment out /etc/vfstab for /tmp

Yes.
But I expected that in /etc/vfstab

Which vfstab did you print? The one that is on the boot disk matters (not the one on the cdrom).

1 Like

Sorry for the confusion, the posted photo shows the result of

Cat /etc/vfstab

but then I asked you about the usage of prtvtoc, what option shall I use. I was confused about the syntax that's why I asked if you wanted me to use it this way

I'm sorry, but I'm still not sure what to do next.

/tmp exists

But I Don't what shall I do with it.

I meant that I expected to see /dev/rdsk/c0t0d0s0 in vfstab, i.e. something with /dev/ and not /devices/
For ex:

/dev/dsk/c0t0d0s0  /dev/rdsk/c0t0d0s0  /  ufs  0  -  -

Then it is

prtvtoc /dev/rdsk/c0t0d0s0

I think you showed the wrong vfstab.

1 Like

Let's analyze what seems to have gone wrong with this port.

  1. We (or rather I) took a chance that slices 4 & 5 which were VTOC unassigned were not really used. That was obviously a wrong decision. We now know that slice 4 is used as /tmp and so there is a fair chance that slice 5 is also used for something.
  2. Some top level directories (mountpoints) are missing after the restore. This is no big deal because we can create them.
  3. Some files below /etc seem to be missing. I say "seem" because we haven't proved that. Since these files reside on the root filesystem which is ufs, this is odd. We could list the cpio archive from the NFS handle to the screen and view whether the missing files are, indeed, archived or not.

So if it doesn't take too long, I would suggest that you begin again editing the VTOC allocating some space to slices 4 & 5 as per the original, shrink /usr a little to make room if you are using the smaller disk, writing out the VTOC and creating new filesystems ('newfs') on slices 1 (root), 3 (var), 6 (usr), and slices 4 & 5.
Then restore the cpio archive again. That will overcome problem 1 above.

I'm going to do it again. Since, today is my last day with the good machine as I have to hand it over for production. After that it's me, the bad machine and the CPIO archives.
I will use the larger disk (exact geometry of the good disk). So, I'm going to allocate the slices to exactly match the good disk.
We have gone too far with this, and I don't want to surrender.

If that's the case and you have the time, login as root (multi-user should do), mount the NFS handle on /mnt, and then

# cd /
# tar cvf <path to an NFS file> ./etc

Perhaps call that tar archive something like etcfiles.tar

Then if some files are indeed missing from the /etc tree we can restore them from that.

1 Like

Don't forget to 'newfs' slices 4 & 5.

1 Like

And then boot to single user mode and do the CPIO archive with "find ." again, right??

I read the info in this link
Copying Files to Tape (tar Command) - Oracle Solaris Administration: Devices and File Systems

it doesn't allow me to copy to a directory. it's expecting a device.

I tired

mkdir /mnt/tar
tar cvf /mnt/tar ./etc

The target can be a device (e.g. a tape drive) or a file (e.g. /mnt/archive/etcfiles.tar

cd /
tar cvf /mnt/archive/etcfiles.tar ./etc

That's
c - create
v - verbose
f - target
target specification field, in this case a file on the NFS storage
a space between fields
directory tree to archive, in this case ./etc (and everything below)

Hope that's clear.

Oh! I got you now.

Done

You could do another cpio archive but keep the first one. Give this one another filename.

Also, if you're going to do that let's try other switches

# cd /a
# find . !-fstype nfs -a !-fstype proc -depth -print | cpio -ov -O /mnt/Backup/backup2.cpio

or whatever NFS path you want to choose.

This just excludes NFS filesystems and proc filesystems but should otherwise archive the whole system

why /a?

I'm booting from disk

Ok, you're booting into single-user mode from HD.

You are absolutely correct. Just

# cd /
1 Like

Just view and try to see al the expected files flying by on the screen.

You could probably use X-off (ctrl-s) and x-on (ctrl-q) to pause/continue it if you want. No harm done.

1 Like

any specific directories you're looking for?