XSCF> snapshot -L F -t username@10.140.0.21:/tmp/mark
Thursday, 25 January 2018
How to Access (Root) Disk under Solaris Volume Manager Control (SVM) from Failsafe or CDROM and Update the boot_archive in Solaris 10
The
following procedure describes how to fsck and mount a mirrored metadevice
during a failsafe boot. In this procedure, the root (/) file system that is
used is /dev/dsk/c0t0d0s0.
Boot
the failsafe archive.
SPARC platform: From the ok prompt, type the following
command:
ok boot -F failsafe
If
the system is already running, open a terminal window, become superuser, and
type the following command:
# reboot -- "-F failsafe"
Note: Do not get the boot_archive updated automatically in this step. It would destroy the consistency of your mirror.
Booting
the system in failsafe mode produces the following output:
Starting shell. #
During
the failsafe boot, when prompted by the system to select a device to mount,
type q to indicate none:
Please select a device to be mounted (q for
none)[?,??,q]: q
Temporarily
mount a submirror of the root (/) file system as read-only on the /a
directory:
# mount -o ro /dev/dsk/c0t0d0s0 /a
Copy
the md.conf file to the /kernel/drv directory:
# cp /a/kernel/drv/md.conf /kernel/drv/
Cat
the vfstab file to identify the root disk, /var, /usr file systems, etc:
# cat /a/etc/vfstab
Unmount
the /a directory:
# umount /a
Use
the update_drv command to load the Solaris Volume Manager md driver. Ignore any
warning messages printed by the update_drv command:
# update_drv -f md
Running
the update_drv command causes the configuration to be read, and the necessary
devices to be created.
Use
metastat to confirm that the SVM database has been loaded:
# metastat -p
Note:
You might have to wait a few seconds (up to a minute) before the metastat
command executes successfully. The md driver takes some time to load its
configuration. If you are too quick, the metastat (and metasync) commands will
give you an error message. Just wait some more seconds in this case and execute
the metastat or metasync commands again.
Use
the metasync command to ensure that the root (/) file system is in sync:
# metasync d0
Now
fsck can be safely run on d0:
# fsck -o f -y /dev/md/rdsk/d0
Please
repeat this command if any file system errors were fixed. You have to repeat it
until the file system is clean. This can take 3 or 4 runs of fsck command.
Force option -o f prevents fsck from skipping the file system check. It is recommended to use option -y as well to confirm all changes to the file system.
Force option -o f prevents fsck from skipping the file system check. It is recommended to use option -y as well to confirm all changes to the file system.
Mount
the root mirror metadevice on the /a directory:
# mount /dev/md/dsk/d0 /a
Note:
If you have separate usr or var file systems repeat the previous fsck step for
the corresponding meta devices for /usr and /var and mount the file systems to
/a/usr and /a/var respectively.
Update
the boot archive:
# bootadm update-archive -v -R /a
If
the boot archive fails to be updated, or an error message is displayed, update
the timestamp on the /a/kernel/drv/md.conf file, then run bootadm
update-archive again.
This will force an update of the boot archive:
This will force an update of the boot archive:
# touch /a/kernel/drv/md.conf
# bootadm update-archive -v -R /a
The
update of the boot archive takes a few minutes to complete. If the boot archive
was updated successfully, a message similar to the following is displayed:
changed /a/etc/system
cannot find: /a/etc/cluster/nodeid: No such file or
directory
cannot find: /a/etc/devices/mdi_ib_cache: No such
file or directory
Creating ram disk on /a updating
/a/platform/i86pc/boot_archive
This
is expected output and does not constitute an error.
These
messages are a result of entries in /boot/solaris/filelist.ramdisk , which may
or may not exist on system.
# less /boot/solaris/filelist.ramdisk
etc/cluster/nodeid
etc/dacf.conf
etc/mach
kernel
platform
Unmount
all previously mounted file systems /a/var, /a/usr and /a:
# umount /a/var
# umount /a/usr
# umount /a
Reboot
the system:
# reboot
Taking Solaris 11 rpool snapshot image (Flar Archive) for Installation purpose
Solaris 11 Taking rpool zfs snapshot image (Flar archive):
----------------------------------------------------------------------
Taking snapshot of rpool.
#zfs snapshot -r rpool@Solaris11_3
We can remove swap and core dump dataset from rpool snapshot to maintain the OS image size.
#zfs destroy rpool/swap@Solaris11_3
#zfs destroy rpool/dump@Solaris11_3
Taking image and storing on shared path:
#zfs send -Rv rpool@Solaris11_3 | gzip | ssh root@191.168.28.54 "cat > /Flar/rpool_Solaris11_3_$(hostname)_$(date +%Y%m%d).zfs.gz"
----------------------------------------------------------------------
Taking snapshot of rpool.
#zfs snapshot -r rpool@Solaris11_3
We can remove swap and core dump dataset from rpool snapshot to maintain the OS image size.
#zfs destroy rpool/swap@Solaris11_3
#zfs destroy rpool/dump@Solaris11_3
Taking image and storing on shared path:
#zfs send -Rv rpool@Solaris11_3 | gzip | ssh root@191.168.28.54 "cat > /Flar/rpool_Solaris11_3_$(hostname)_$(date +%Y%m%d).zfs.gz"
Subscribe to:
Posts (Atom)