Basic question regarding root file system copy to another disk

Hello,
I am creating a new disk using the following command:

dd if=/dev/zero of=/export/home/ramdisk/0 bs=512 count=4096k

after creating the disk, i tool a ufsdump of a solaris 10 filesytem (disk size 512MB)

ufsdump -cvf /export/home/ufsdump/sol_orig /

and then restored the dump files onto the newly created 2GB disk (after creating a newfs and mounting that disk to /mnt/sol_2gb):

ufsrestore -rvf /export/home/ufsdump/sol_orig /mnt/sol_2gb

after that, i installed the boot block on the 2gb disk:

installboot /usr/platform/sun4v/lib/fs/ufs/bootblk /dev/rdsk/c0t0d0s3

where, c0t0d0s3 is the newly created 2gb disk.

then I try to use the 2 gb disk to boot the system just by using the boot command.
This is when the SMF services start to load and after everything is loaded, I get the errors. (see attached image)

I am using Legion which is a T-2000 simulator (T-1 processor, sun4v arch). I have attached the config. file for the simulator.

When i boot from the original 512Mb image, there is no issue at all.
Could someone help me with why just copying the file system to a bigger disk maybe causing so much trouble.

Let me say straight away that the question you ask is not "basic".

What you are trying to do is fundamentally a DR routine and setting up the root (boot) on a new disk in a different slot to the original boot drive.

I am not familiar with the T-2000 simulator you are using but, disregarding that, the check list for such an operation on standard Sun hardware for a UFS boot partition is:

label the disk
set the vtoc
restore the root filesystem
edit (if necessary) the system file (/etc/system)
create any new required device nodes (/dev/<node>)
edit (if necessary) the vfstab file (/etc/vfstab)
write out the bootblk appropriate to the hardware platform

Once that is all done, you will definitely have seriously changed the boot filesystem so you must do an orderly shutdown and then tell Solaris to reconfigure on booting with:

ok> boot -r

the first time that you boot. If the O/S is pre-10u3 you then need to update the boot archive. Boot archive architecture was not used after 10u3.

You don't indicate your level of expertise and some of the above might need to be expanded for you. If so, just post back. Some of the above would normally be done whilst booted from CD and the new root filesystem mounted under /a.

Hope that helps.

1 Like

Thanks hicksd8.
I didn't have the idea that it needs all those steps to be done.

I am surely not expert, but have some idea of the stuff. If possible, could you give me some steps for creating this virtual disk with extra space from the existing one.

For starter, when I run "format" command on the simulator, on just the original one, I get errors:

bash-3.00# format
Searching for disks...WARNING: hsimd_ioctl: cmd 410 not implemented


Error: Device c0t0d0: controller name (SUNW,sun4v-virtual)
is invalid.  Device will not be displayed.
done
No disks found!

Also, if i just use the following command to clone the original disk, it works just fine:

dd if=/export/home/ramdisk/disk/s10hw2 of=/export/home/ramdisk/0

i guess I am going to need help on creating this bigger disk ...:o

Thanks

So 'format' doesn't find the original disk that boots okay?

Perhaps that is not an error in this virtualised environment. I repeat, I do not know your 'simulator' environment.

However, in your post#1, you say that the newly created (virtual) disk is device c0t0d0s3. If it doesn't show in 'format', how did you know that?

It is likely that this platform has its own boot block(s) for booting so I would be careful writing boot blocks out. (Boot blocks reside in sectors 0 and 1 of the physical drive and, after execution, pass control to the partition it's booting from.

Also, if you are changing from booting from c0t0d0s0 to booting from c0t0d0s3 then the device nodes /dev/dsk/c0t0d0s3 and /dev/rdsk/c0t0d0s3 must exist on that filesystem before it can be booted from. ALSO, if /usr is a separate filesystem, the /etc/vfstab must tell Solaris where to find that. The nodes for that device must exist too. So (if /usr is not included on the root filesystem) it must be an available device for Solaris to boot. Other filesystems may fail to mount but the system will still boot.

Hi Zam,

Can you post the output of

echo | format

And assuming that this is an LDOM, the config using the

ldm list-bindings

Sorry this should be executed in the control domain

Regards

Dave

Hello hicksd8,
I created the (virtual) disk (using dd, ufsdump, ufsrestore) in a physical machine. Then in the Legion simulator config file, there is an option to add that disk to slice 3 of c0t0d0s# which I did. Thus I was calling the disk to be at c0t0d0s3.

// disk ... must use virtual_disk directive
            device "memory" 0x1f40000000 +513M  {
                virtual_disk;
                load s0 rom "disk.s10hw2";
                load s3 shared "sol_2gb";
            }

When I am trying to boot with just the newly created disk (sol_2gb), I replace the "disk.s10hw2" in s0 with the new disk name and comment out the s3 line.

Here is my /etc/vfstab in the simulator with just the original disk (disk.s10hw2)"

bash-3.00# more /etc/vfstab
#device         device          mount           FS      fsck    mount   mount
#to mount       to fsck         point           type    pass    at boot options
#
fd      -       /dev/fd fd      -       no      -
/proc   -       /proc   proc    -       no      -
/dev/dsk/c0t0d0s1       -       -       swap    -       no      -
/dev/dsk/c0t0d0s0       /dev/rdsk/c0t0d0s0      /       ufs     1       no      -
/dev/dsk/c0t0d0s3       /dev/rdsk/c0t0d0s3      /export ufs     1       no      -
/devices        -       /devices        devfs   -       no      -
ctfs    -       /system/contract        ctfs    -       no      -
objfs   -       /system/object  objfs   -       no      -
swap    -       /tmp    tmpfs   -       yes     -

---------- Post updated at 11:16 AM ---------- Previous update was at 11:12 AM ----------

Dave,
here is the output from the simulator:

bash-3.00# echo | format
Searching for disks...WARNING: hsimd_ioctl: cmd 410 not implemented


Error: Device c0t0d0: controller name (SUNW,sun4v-virtual)
is invalid.  Device will not be displayed.
done
No disks found!

bash-3.00# ldm list-bindings
bash: ldm: command not found

Hi Zam,

I have had a look around on the web for things related to this, I see you have posted this in a couple of places looking for help.

So lets start at the begining, you say you created the virtual disk in aphysical machine, what physical machine first?

I can see from the vfstab that you have what looks like a standard set of mounted file systems with slice 3 mounted on /export.

What I'm strugling with is this other slice 3 that you have created presumably in the host machine which is presumably passed to the virtual as s3, and you can't see it from the virtual.

If you boot from the original disk and in the virtual environment you run

echo | format

what output do you get?

Also if you run

cfgadm -v

What output do you get?

Regards

Dave

Here is the output from the virtual environment with the original disk:

bash-3.00# echo | format
Searching for disks...WARNING: hsimd_ioctl: cmd 410 not implemented


Error: Device c0t0d0: controller name (SUNW,sun4v-virtual)
is invalid.  Device will not be displayed.
done
No disks found!

bash-3.00# cfgadm -v
cfgadm: Configuration administration not supported

When I add the 2gb disk in slice 3, after booting up, i additionally need to mount that slice to /export to be able to see it.

---------- Post updated at 11:54 AM ---------- Previous update was at 11:39 AM ----------

Here is the /etc/vfstab output from the simulator of T1 processor after adding second disk (2.9 gb).

Configuration file edit:

// disk ... must use virtual_disk directive
    62                          device "memory" 0x1f40000000 +4096M  {
    63                                  virtual_disk;
    64                                  load s0 rom "disk.s10hw2";
    65                                  load s3 shared "Openslrs.img";
    66                          }

once the system boots up, I mounted the using the following command:

 mount /dev/dsk/c0t0d0s3

And the /etv/vfstab output:

more /etc/vfstab
#device         device          mount           FS      fsck    mount   mount
#to mount       to fsck         point           type    pass    at boot options
#
fd      -       /dev/fd fd      -       no      -
/proc   -       /proc   proc    -       no      -
/dev/dsk/c0t0d0s1       -       -       swap    -       no      -
/dev/dsk/c0t0d0s0       /dev/rdsk/c0t0d0s0      /       ufs     1       no      -
/dev/dsk/c0t0d0s3       /dev/rdsk/c0t0d0s3      /export ufs     1       no      -
/devices        -       /devices        devfs   -       no      -
ctfs    -       /system/contract        ctfs    -       no      -
objfs   -       /system/object  objfs   -       no      -
swap    -       /tmp    tmpfs   -       yes     -

df -k output:

bash-3.00# df -k
Filesystem            kbytes    used   avail capacity  Mounted on
/dev/dsk/c0t0d0s0     491522  237119  205251    54%    /
/devices                   0       0       0     0%    /devices
ctfs                       0       0       0     0%    /system/contract
proc                       0       0       0     0%    /proc
mnttab                     0       0       0     0%    /etc/mnttab
swap                  159944     248  159696     1%    /etc/svc/volatile
objfs                      0       0       0     0%    /system/object
/platform/sun4v/lib/libc_psr/libc_psr_hwcap1.so.1
                      491522  237119  205251    54%    /platform/sun4v/lib/libc_psr.so.1
/platform/sun4v/lib/sparcv9/libc_psr/libc_psr_hwcap1.so.1
                      491522  237119  205251    54%    /platform/sun4v/lib/sparcv9/libc_psr.so.1
fd                         0       0       0     0%    /dev/fd
swap                  159696       0  159696     0%    /tmp
swap                  159696       0  159696     0%    /var/run
/dev/dsk/c0t0d0s3    2934669  764348 2111628    27%    /export

---------- Post updated at 03:46 PM ---------- Previous update was at 11:54 AM ----------

fyi, i was following procedures explained in this thread for creating the disk:
https://community.oracle.com/thread/2124713?start=0&tstart=0

Hi Zam,

The first thing I would say is that ypu already have the device

/dev/dsk/c0t0d0s3       /dev/rdsk/c0t0d0s3      /export ufs     1       no      -

So it will not be possible to mount an other on the same mount point.

You will have to check the command

lofiadm

Along with the command

mount

You will need these commands to enable you to do what you need.

Regards

Dave

Hello Dave,
Do you suggest, if I change to "s4" instead in the config file, then it would work?

Hi Zam,

If by "s4" you mean;

/dev/dsk/c0t0d0s4

Then probably - normally in Solaris if you wanted to boot an alternate path. So you may have to be aware of that as well.

Regards

Dave