- -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.
- Delete a swap file from the current swap configuration.
- -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:
- 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 - Add the swap file to the system’s swap space.# swap -a /export/data/swapfile
- List the details of the modified system swap space with swap -l
- List a summary of the modified system swap space with swap -s
- 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 –
- Create a 1G swap file named swapfile in the partition that have enough free space, for example
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
Solaris nic drivers
http://freenicdrivers.la.coocan.jp/
Solaris 11 package management (IPS) cheatsheet
Install a package called diagnostic/wireshark:pkg install diagnostic/wireshark
Uninstall a package called diagnostic/wireshark using a short form of the package
name:pkg uninstall wireshark
Update all possible packages to the newest version, including all Oracle Solaris zones:pkg update
Do a dry run of an update of all possible packages to the newest version:pkg update -nv
Update all system packages to the newest version and require a new BE:pkg update --be-name fix-nfs-issue
List packages currently installed on a system:pkg list
Show information about an installed package called wireshark:pkg info wireshark
Show information about an uninstalled package called xchat:pkg info -r xchat
Show the contents of an installed package called wireshark:pkg contents wireshark
Show all PNG files of an installed package called wireshark:pkg contents -o path -a path=*.png wireshark
Search all locally installed packages for the match gcc:pkg search -l gcc
Search all packages in the configured repositories that contain dev header
gcrypt-module.h:pkg search 'gcrypt-module.h'
Search for all packages in the configured repositories that have the
classification Web Services/Application and Web Servers:pkg search -o pkg.name 'set:info.classification:*Application
and Web Servers’
Search for all packages installed locally that have a dependency on
library/libxml2:pkg search –l -o pkg.name 'depend::library/libxml2'
Browse package command history (includes graphical Package Manager client):pkg history
Purge package command history:pkg purge-history
Verify the integrity of the current system image:pkg verify
Verify the integrity of installed package called wireshark:pkg verify wireshark
Fix any errors reported by pkg verify on an installed package called wireshark:pkg fix wireshark
Freeze a package called wireshark to prevent any accidental future updates:pkg freeze wireshark
List currently associated publishers:pkg publisher
Add a publisher at a specified repository URI:pkg set-publisher -p http://www.example.com/solaris11
Add a publisher:pkg set-publisher -g http://www.example.com/solaris11 siteapps
Remove a publisher:pkg unset-publisher siteapps
Query a repository URI for publisher names and package counts:pkgrepo -s http://pkg.oracle.com/solaris/release info
Change to the Oracle Solaris support repository with pre-downloaded certificates
and keys from the Oracle Solaris release repository:pkg set-publisher -G http://pkg.oracle.com/solaris/release \
-g http://pkg.oracle.com/solaris/support -k /path/to/ssl_key \
-c /path/to/ssl_cert solaris
Configuring a nic in Solaris 11
root@solaris01:~# dladm show-phys
LINK MEDIA STATE SPEED DUPLEX DEVICE
net0 Ethernet unknown 100 full bfe0
To configure the interface using dhcp
# ipadm create-ip net0 # ipadm create-addr -T dhcp net0
print devices in solaris
root@solaris01:~# prtconf -v | awk ‘/model/{getline; print}’
value=’Host bridge’
value=’VGA compatible controller’
value=’Video controller’
value=’Mixed Mode device’
value=’PCI-PCI bridge’
value=’Network controller’
value=’PCI-PCI bridge’
value=’Universal Serial Bus UHCI compliant’
value=’Universal Serial Bus UHCI compliant’
value=’Universal Serial Bus UHCI compliant’
value=’Universal Serial Bus UHCI compliant’
value=’Universal Serial Bus EHCI compliant’
value=’Subtractive Decode PCI-PCI bridge’
value=’Ethernet controller’
value=’FireWire (IEEE 1394) OpenHCI compliant’
value=’Unknown class of pci/pnpbios device’
value=’System peripheral’
value=’System peripheral’
value=’System peripheral’
value=’ISA bridge’
value=’Motherboard’
value=’Motherboard’
value=’Motherboard’
value=’PS/2 Port for PS/2-style Mice’
value=’System keyboard’
value=’Motherboard’
value=’Motherboard’
value=’IDE controller’
value=’SMBus (System Management Bus)’
Everytime you want to identify a device look at the vendor id + device id
name='device-id' type=int items=1
value=00004311
name='devsel-speed' type=int items=1
value=00000000
name='interrupts' type=int items=1
value=00000001
name='model' type=string items=1
value='Network controller'
name='power-consumption' type=int items=2
value=00000001.00000001
name='reg' type=int items=10
value=000b0000.00000000.00000000.00000000.00000000.020b0010.00000000.00000000.00000000.00004000
name='revision-id' type=int items=1
value=00000001
name='subsystem-id' type=int items=1
value=00000007
name='subsystem-vendor-id' type=int items=1
value=00001028
name='unit-address' type=string items=1
value='0'
name='vendor-id' type=int items=1
value=000014e4
In this case the 14e4:4311 is a BCM4311 802.11b/g WLAN
iscsi target server
Solaris 11 links
Download Media
https://www.oracle.com/solaris/solaris11/downloads/solaris-downloads.html
Create IPS repository
https://www.thegeekdiary.com/solaris-11-ips-hand-on-lab-creating-ips-repository/
http://www.snatchbrain.com/?p=401
Hands-On labs for solaris 11
https://www.oracle.com/technical-resources/articles/solaris11/solaris-labs.html
Device driver for Broadcom BCM4401 100Base-T NIC
https://docs.oracle.com/cd/E86824_01/html/E54777/bfe-7d.html
Solaris 11 training path
Download Solaris SW
https://fsck.technology/software/Sun%20Microsystems/Solaris%20Install%20Media/Sun%20Solaris%2010/
https://archive.org/details/SunSolaris9OperatingEnvironmentSPARCPlatformEdition
Opencsw IPS repository
Set Kodi to autostart in the VGA port in ElementaryOS
Create file /lib/systemd/system/kodi.service with contents
[Unit]
Description = Kodi Media Center
After = remote-fs.target network-online.target
Wants = network-online.target
[Service]
User = root
Group = root
Type = simple
ExecStart = /scripts/kodi.sh
Restart = on-abort
RestartSec = 5
[Install]
WantedBy = multi-user.target
Run: systemctl daemon-reload
create /scripts/kodi.sh
#!/bin/sh
xinit /scripts/kodi.bash
exit $?
create /scripts/kodi.bash
#!/bin/sh
(while true;do
xrandr --output LVDS-1 --off --output VGA-1 --auto > /var/log/xrandr.log 2>&1
sleep 2
done) &
/usr/bin/kodi-standalone
exit $?
Setup the system to start on multiuser level: systemctl set-default multi-user.target
To go back to the default login level: systemctl set-default graphical.target
Grow filesystem with lvm
lvextend -r -l 100%FREE /dev/vg02/lvol01