Labels

hpunix (63) marathi kavita (52) linux (21) solaris11 (11) AWS (5) numerology (5)
Showing posts with label boot. Show all posts
Showing posts with label boot. Show all posts

Tuesday, July 30, 2024

How to create bootable USB in solaris

How to Create a Bootable USB (Pen Drive) in Solaris

Creating a bootable USB in Solaris is a crucial task for system administrators, especially when dealing with server recovery, new installations, or maintenance scenarios. Whether you're recovering a root password or booting a server from ISO media, having a bootable USB ready can save valuable time.


Why Is It Required?

There are several scenarios where booting from a USB ISO image becomes necessary:

  • Root password recovery
  • Fresh OS installation
  • Server in maintenance mode
  • Booting from ISO for troubleshooting

Step-by-Step Guide

Step 1: Download the Solaris ISO

Search on Google:
Solaris 11.4 ISO download

Choose the correct ISO based on your server architecture:

  • SPARC → Download SPARC USB Text Installer
  • X86 → Download X86 USB Text Installer

For SPARC hardware, download:

SPARC Text Installer ISO

Step 2: Transfer ISO to a Test Solaris Server

Once downloaded, copy the ISO to a working Solaris server.


root@cdom3:~# ls -lrth
-rw-r--r--   1 root     root        1.1G Jul 18 13:09 sol-11_4-text-sparc.usb
root@cdom3:~#

Step 3: Write ISO to USB Drive

Insert the USB drive into the test server and run:

root@cdom3:~# usbcopy sol-11_4-text-sparc.usb

You’ll see output like:

image type: dd-able Sparc
Found the following USB devices:
0:      /dev/rdsk/c9t0d0s2      14.7 GB SanDisk  Cruzer Blade     1.00
Enter the number of your choice: 0

WARNING: All data on your USB storage will be lost.

Are you sure you want to install to
SanDisk Cruzer Blade 1.00, 14700 MB at /dev/rdsk/c9t0d0s2 ?  (y/n) y
Copying and verifying image to USB device
Finished 1160 MB in 234 seconds (4.9MB/s)
Successfully completed copy to USB


Step 4: Remove USB and Insert into Target Server

Once the image is successfully copied, remove the USB from the test server and insert it into the target server (in maintenance mode).


Step 5: Boot Server from USB

At the OK prompt, scan for connected devices

{0} ok probe-scsi-all       

Target 9
  Unit 0   Disk   HITACHI  H109030SESUN300G A606    585937500 Blocks, 300 GB
  SASDeviceName 5000cca043487328  SASAddress 5000cca043487329  PhyNum 0
Target a
  Unit 0   Disk   HITACHI  H109030SESUN300G A606    585937500 Blocks, 300 GB
  SASDeviceName 5000cca043487400  SASAddress 5000cca043487401  PhyNum 1

/pci@340/pci@1/pci@0/pci@3/usb@0/hub@8/storage@1
  Unit 0   Removable Disk     SanDiskCruzer Blade1.00

Identify the USB device:

{0} ok devalias
Select the USB disk (e.g., option h) and create a device alias:
{0} ok show-disks
a) /reboot-memory@0
b) /pci@380/pci@1/pci@0/pci@7/SUNW,qlc@0,1/fp@0,0/disk
c) /pci@380/pci@1/pci@0/pci@7/SUNW,qlc@0/fp@0,0/disk
d) /pci@380/pci@1/pci@0/pci@6/SUNW,qlc@0,1/fp@0,0/disk
e) /pci@380/pci@1/pci@0/pci@6/SUNW,qlc@0/fp@0,0/disk
f) /pci@3c0/pci@1/pci@0/pci@2/scsi@0/disk
g) /pci@300/pci@1/pci@0/pci@2/scsi@0/disk
h) /pci@340/pci@1/pci@0/pci@3/usb@0/hub@8/storage@1/disk
i) /iscsi-hba/disk
q) NO SELECTION
Enter Selection, q to quit: h
/pci@340/pci@1/pci@0/pci@3/usb@0/hub@8/storage@1/disk has been selected.
Type ^Y ( Control-Y ) to insert it in the command line.
e.g. ok nvalias mydev ^Y
         for creating devalias mydev for /pci@340/pci@1/pci@0/pci@3/usb@0/hub@8/storage@1/disk
Boot from the USB:
{0} ok boot mydev
Boot device: /pci@300/pci@1/pci@0/pci@2/scsi@0/disk@p0  File and args: mydev
/
If that fails, boot directly using the full device path:
{0} ok boot /pci@340/pci@1/pci@0/pci@3/usb@0/hub@8/storage@1/disk

Conclusion

Creating a bootable USB in Solaris is straightforward but powerful. It enables administrators to recover, reinstall, or troubleshoot servers efficiently. Always ensure you select the correct ISO and verify the USB copy process before proceeding.


Regards,

Kiren Jadhav

Wednesday, June 11, 2014

Root Disk mirroring on Integrity servers (HPUX 11.31)

Root Disk mirroring on Integrity servers (HPUX 11.31)

Please take below few outputs before proceeding:

#lvlnboot –v

# cat /stand/bootconf

#ioscan –m dsf |egrep ‘p1|p2|p3’

1.            Use the following commands to determine the size of the EFI, HP-UX, and HPSP partitions in megabytes on the current boot disk:
# /usr/sbin/diskinfo -b /dev/rdisk/boot_disk_p1 | awk '{print $1 / (1024)}'    
# /usr/sbin/diskinfo -b /dev/rdisk/boot_disk_p2 | awk '{print $1 / (1024)}'
# /usr/sbin/diskinfo -b /dev/rdisk/boot_disk_p3 | awk '{print $1 / (1024)}'


2.            Identify a disk that is not currently in use to be used as the mirror. This EFI partition should be as large as the EFI partition on the current disk. The HP-UX partition should be large enough to hold all the logical volumes in the clone. Although the HPSP partition is optional, if it is created, it should be the same size as the HPSP on the clone.


3.       Create a temporary file, for example /tmp/partitionfile , containing the number of partitions and the size of each partition to be created on the mirror disk. Use the information from steps 1 and 2 to determine partition sizes. Here is a sample command to create the file, indicating three partitions with an EFI partition size of 500 MB, an HPSP partition size of 400 MB, and the remaining space allocated to the HP-UX partition:

# print '3\nEFI 500MB\nHPUX 100%\nHPSP 400MB' > /tmp/partitionfile

See idisk(1M) for more information about partitioning disks.
4.       Use the file created in step 3 to partition the mirror disk with idisk .

(The echo will reply to the confirmation request from the idisk command.)

# /usr/bin/echo yes | idisk -wf /tmp/partitionfile /dev/rdisk/mirror_disk
/tmp/partitionfile may be removed if desired.

# /usr/bin/echo yes | idisk -wf /tmp/partitionfile /dev/rdisk/disk140

Check it by using command:

5.       Use ioscan –fnkC disk to determine the hardware path to the mirror disk.
  1. Use the insf command to create device files for all the newly-created partitions:
# /usr/sbin/insf -e -H hardware_path_to_mirror_disk

7.       Run the pvcreate command on the character device file for the HP-UX (second) partition of the mirror disk using the -B option to make the disk bootable and the -f option to overwrite any pre-existing data on the disk:
# /usr/sbin/pvcreate -f -B /dev/rdisk/mirror_disk_p2

8.       Extend the root volume group to the HP-UX partition of the mirror disk using the block device file of the second (HP-UX) partition in the following command:

# /usr/sbin/vgextend /dev/vg00 /dev/disk/mirror_disk_p2

9.       Run mkboot to complete the setup of the disk as a boot disk. The -e option tells mkboot to use EFI layout, and the -l option tells mkboot that this volume will be used by a volume manager even if it is not currently used by one.


NOTE:
No partition number is given to this command; it looks at the whole disk.
  1. # /usr/sbin/mkboot -e -l /dev/disk/mirror_disk
  1. Create a temporary AUTO file and use the efi_cp command to copy it to the mirror using the block device of the first (EFI) partition. The –lq option ensures that the system will boot without quorum. In the event of the primary boot disk failing, this will allow the mirror disk to boot.
# print 'boot vmunix -lq' > /tmp/AUTO
# /usr/sbin/efi_cp -d /dev/disk/mirror_disks2_p1 /tmp/AUTO /EFI/HPUX/AUTO
Finish with (for either) the following:  # /usr/bin/rm /tmp/AUTO

12.   Starting with the boot, swap, and root logical volumes, run lvextend to mirror each logical volume:

# /usr/sbin/lvextend m 1 /dev/vg00/lvol1 /dev/dsk/mirror_disk_p2
# /usr/sbin/lvextend m 1 /dev/vg00/lvol2 /dev/dsk/mirror_disk_p2 . .  . . .  . . .  . . .  . . .  . . .

Note down all LV name in /tmp/lvanme file.

13.   Run the following lvlnboot commands to re-establish LVM’s knowledge of the root and boot file systems and primary swap and dump.

# /usr/sbin/lvlnboot -b /dev/vg00/lvol1
# /usr/sbin/lvlnboot -r /dev/vg00/lvol3                  
# /usr/sbin/lvlnboot -s /dev/vg00/lvol2                  
# /usr/sbin/lvlnboot -d /dev/vg00/lvol2                    
# /usr/sbin/lvlnboot –R
  1. Add the block device special file of the HP-UX (second) partition of the mirror to the /stand/bootconf file. The lower case l in the following command indicates that the disk is managed by LVM or VxVM.
# /usr/bin/echo "l /dev/disk/mirror_disk_p2" >> /stand/bootconf
  1. If desired, set the alternate boot path to the mirror_disk , using the hardware address determined in step 5. For HP-UX 11iv3, you can just use the block device special file name.
# /usr/sbin/setboot -a mirror_disk
  1. If the mirror disk includes an HPSP partition, use the efi_fsinit command on the character device file for the HPSP (third) partition to initialize it with an EFI file system:
# /usr/sbin/efi_fsinit -d /dev/rdisk/mirror_disk_p3


Thanks...
Kalyanjit

**Let's Share our knowledge**