Solaris 11, error labeling disk

If you get this error while labeling a disk inside “format”:

format> la
 WARNING - This disk may be in use by an application that has
 modified the fdisk table. Ensure that this disk is
 not currently in use before proceeding to use fdisk.

Issue the “fdisk” command inside format

format> fdisk
 No fdisk table exists. The default partition for the disk is:

a 100% "SOLARIS System" partition

Type "y" to accept the default partition, otherwise type "n" to edit the
 partition table.

After this, you can label the disk

Solaris 11 + AD 2016/2019

IDMU=Identity Management for Unix has been deprecated from AD, the last AD version to support it is 2012, but the RFC 2307(unix) attributes still exist in AD, we just need to edit them manually in ADUC=Active Directory Users and Computers manually for each user, via Advanced Options. See the link below :

https://www.ibm.com/docs/en/spectrum-scale/5.0.5?topic=imwr2a-configuring-id-mappings-in-active-directory-users-computers-windows-server-2016-subsequent-versions

These are the attributes to edit:

Field on IMU Unix Attributes tabRFC2307 AD attribute
UIDuidNumber
Logon ShellloginShell
Home DirectoryunixHomeDirectory
Primary group name or group identifier (GID)primaryGroupID

Connect to WPA Wifi AP in Solaris 11

Very few network cards are supported, in this case i have an Ateros chipset card i plugged off from an acer aspire one

root@solaris01:~# dladm show-phys
LINK MEDIA STATE SPEED DUPLEX DEVICE
net0 Ethernet unknown 100 full bfe0
net1 WiFi up 54 unknown arn0

Create the ip address object

root@solaris01:~# ipadm create-ip net1

Verify the nic has been created as an ipadm object

root@solaris01:~# ipadm show-if
IFNAME CLASS STATE ACTIVE OVER
lo0 loopback ok yes --
net0 ip ok yes --
net1 ip ok yes --

Scan wifi networks

root@solaris01:~# dladm scan-wifi
LINK ESSID BSSID SEC STRENGTH MODE SPEED
net1 DunderMifflin 4:95:e6:de:d6:f1 wpa excellent n 54Mb

Create the encrypted object to store the wpa key

root@solaris01:~# dladm create-secobj -c wpa mykey
provide value for mykey:
confirm value for mkey:

Connect to the network

root@solaris01:~# dladm connect-wifi -e DunderMifflin -k mykey
root@solaris01:~# ipadm create-addr -T dhcp net1

Enable root SSH Login in Oracle Solaris 11

1. Change the file /etc/ssh/sshd_config PermitRootLogin yes with PermitRootLogin no and save file.

    vi /etc/ssh/sshd_config  

  PermitRootLogin yes

2. Comment out the “CONSOLE=/dev/console” line in /etc/default/login.

    vi /etc/default/login

  #CONSOLE=/dev/console

3.Remove “;type=role” from the root entry in /etc/user_attr or use the below command.

 rolemod -K type=normal root

4. Restart the Services.

#svcadm restart svc:/network/ssh:default

Create Solaris 11 Zone

zpool create zone1pool /dev/dsk/c3d0s4
zfs create zone1pool/zone1
zfs set mountpoint=none zone1pool
zfs set mountpoint=/zone01 zone1pool/zone1


zonecfg -z zone01
Use ‘create’ to begin configuring a new zone.
zonecfg:zone01> create -b
create: Using system default template ‘SYSdefault’
zonecfg:zone01> set zonepath=/zone01
zonecfg:zone01> set autoboot=true
zonecfg:zone01> set bootargs=”-m verbose”
zonecfg:zone01> verify
zonecfg:zone01> commit
zonecfg:zone01> exit


zoneadm list -icv
zoneadm -z zone01 install
zoneadm list -icv
zfs list | grep -i zone
zoneadm -z zone01 boot
zlogin -C zone01

Create an IPS repo in Solaris 11

Create the zpool to hold the repos

root@solaris01:/sol_11_repo# zpool create sol_11_repo c3d0s2
root@solaris01:/sol_11_repo# zfs set atime=off sol_11_repo
root@solaris01:/sol_11_repo# zfs set compression=zstd sol_11_repo
root@solaris01:/sol_11_repo# zfs set compression=lz4 sol_11_repo

Copy the 5 zip files to the directory you will use and unzip them

root@solaris01:/sol_11_repo# ls *zip
sol-11_4-repo_1of5.zip sol-11_4-repo_2of5.zip sol-11_4-repo_3of5.zip sol-11_4-repo_4of5.zip sol-11_4-repo_5of5.zip
root@solaris01:/sol_11_repo# ls *zip | while read f;do unzip -oq $f; done

Create the repo and refresh it

root@solaris01:/sol_11_repo# pkgrepo create /sol_11_repo
root@solaris01:/sol_11_repo# pkgrepo -s /sol_11_repo refresh
root@solaris01:/sol_11_repo# pkgrepo -s /sol_11_repo/ info
root@solaris01:/sol_11_repo# zfs set sharenfs=on sol_11_repo
root@solaris01:/sol_11_repo# svccfg -s application/pkg/server setprop pkg/inst_root=/sol_11_repo
root@solaris01:/sol_11_repo# svccfg -s application/pkg/server setprop pkg/readonly=true
root@solaris01:/sol_11_repo# svcprop -p pkg/inst_root application/pkg/server
root@solaris01:/sol_11_repo# svcadm refresh application/pkg/server
root@solaris01:/sol_11_repo# pkgrepo refresh -s /sol_11_repo
Initiating repository refresh.

Make sure it is running in port 80

root@solaris01:~# svccfg -s application/pkg/server listprop | grep -i port
pkg/port count 80
root@solaris01:~# svcadm refresh application/pkg/server
root@solaris01:~# svcadm enable application/pkg/server
root@solaris01:~# svcs | grep -i pkg/server
online 9:53:25 svc:/application/pkg/server:default

Get all the new packages from Oracle

root@solaris01:/sol_11_repo# export PKG_SRC=http://pkg.oracle.com/solaris/release/
root@solaris01:/sol_11_repo# export PKG_DEST=/sol_11_repo
root@solaris01:/sol_11_repo# pkgrecv ‘*’

Receive all packages that do not already exist and all changed content
from the repository located at http://pkg.oracle.com/solaris/release/
to the repository located at /export/repoSolaris11.

root@solaris01:/sol_11_repo# pkgrecv -s http://pkg.oracle.com/solaris/release/ -d /sol_11_repo -m all-timestamps '*'

Setup a client to use our repo, and remove Oracle’s

# pkg set -G ‘*’ -g http://192.168.5.17/ solaris

swap in Solaris 11

  • -s To view the summary of the current swap space allocation:# swap -s total: 106256k bytes allocated + 8512k reserved = 114768k used, 587512k available
  • -l  To list details of the system’s virtual swap space:

    # swap -l
    swapfile dev swaplo blocks free
    /dev/dsk/c0t0d0s1 136,1 16 1206736 1084736
    /export/data/swapfile -16 40944 40944
     
  • -d To delete a swap slice or swap slice from the current swap configuration.# swap -d /dev/dsk/c1t0d0s3
     To prevent the swap slice from being configured as part of the swap configuration during a reboot or change of run level, edit the /etc/vfstab file, and remove the swap slice entry from the file.Operations on swap file are similar to operation on swap slice:
    • Delete a swap file from the current swap configuration.
      # swap -d /export/data/swapfile
       
    • Remove the file to free the disk space that it is occupying.# rm /export/data/swapfile
    • To prevent the swap file from being configured as part of the swap  configuration during a reboot or change of run level, edit the /etc/vfstab file, and remove the swap file entry.

      Note – The output of the df -h /export/data/swapfile command shows the space in use until you remove the swap file.
  • -a To add additional swap area
    • To add a swap slice Edit the /etc/vfstab file to add information describing the swap slice.  # vi /etc/vfstab #device device mount FS fsck mount mount #to mount to fsck point type pass at boot optAdd the following line to create the swap slice./dev/dsk/c1t0d0s3 --swap -no -Use the swap -a command to add additional swap area.# swap -a /dev/dsk/c1t0d0s3Note – When the system is subsequently rebooted, the new swap slice /dev/dsk/c1t0d0s3 will be automatically included as part of the swap space as a result of adding the entry to the /etc/vfstab file.  
    • Adding Swap Files. Swap files can be used when you need to add swap space and do not have a free partition to use. To add a swap file, complete the following steps:
      1. Create a 1G swap file named swapfile in the partition that have enough free space, for example /export/data directory.# mkfile 1000m /export/data/swapfile
      2. Add the swap file to the system’s swap space.# swap -a /export/data/swapfile
      3. List the details of the modified system swap space with swap -l
      4. List a summary of the modified system swap space with swap -s
      5. To use a swap file when the system is subsequently rebooted, add an entry for the swap file in the /etc/vfstab file.# vi /etc/vfstab
        #device device mount FS fsck mount mount
        #to mount to fsck point type pass at boot opt
        /export/data/swapfile –swap -no –

Mount USB disk in solaris 11

$ rmformat
Looking for devices...
1. Logical Node: /dev/rdsk/c3t0d0p0
Physical Node: /pci@0,0/pci108e,534a@2,1/storage@3/disk@0,0
Connected Device: SanDisk  Cruzer Micro     0.3
Device Type: Removable
Bus: USB
Size: 245.0 MB
Label: <None>
Access permissions: Medium is not write protected.

You can use the rmmount command with device nicknames, mount points, or device paths, similar to the following:

$ rmmount rmdisk0
$ rmmount NONAME
$ rmmount /dev/dsk/c3t0d0p0:1

The following example unmounts c2t0d0p0 whose mount point is NONAME.

$ rmumount NONAME
NONAME /dev/dsk/c2t0d0p0 unmounted