SmartOsCommands

SmartOS commands

Linux to SmartOS command List#

  • tcpdump -i eth1 = snoop -d net1
  • ping6 -s 1300 = ping -A inet6 -as sau.frubar.net 1300
  • top = prstat
  • ip route = ipadm & dladm
  • lspci = prtconf
  • fdisk -l = diskinfo | echo | format | cfgadm -alv | grep sata
  • route -n = netstat -rn
  • sysctl -a = ndd /dev/ip \? | awk '{ print $1 }' | while read x; do echo -n "$x "; ndd -get /dev/ip $x; done | sort

Service Management Facility (SMF)

  • list all running processes: svcs
  • show info about specific service (process) (e.g logfile path): svcs -l servicename
  • {start | stop | restart} service: svcadm {enable | disable | restart} servicename
  • try to reactivate service in maintenance state: svcadm clear servicename
  • import a smf manifest: svccfg import /path/to/manifest.xml
  • remove a smf manifest: svccfg delete servicename
  • show all available services: svccfg list

MIBE

Global Zone

root password

to change the root password you have to generate a new pw hash with /usr/lib/cryptpass somepassword and put the hash in /usbkey/shadow e.g.: root:SOMEPASSWORDHASH:14897::::::

imgadm

  • add new imgadm repo (e.g. skylime datasets): imgadm sources -a http://datasets.at/

zpool

zfs

  • Show all zfs file systems: zfs list
  • Show all snapshots: zfs list -t snapshot
  • Delete a snatpshot and all its children: zfs destroy -r zones/mcube@fullbackup-2014-08-26
  • Show all origins (e.g. which image is origin of which zone): zfs get origin
  • Show mountpoint of dataset: zfs get mountpoint tank/dataset
  • Alter quota to 6TB of dataset: zfs set quota=6T zones/0735b504-f6ca-4ad5-b891-da5138fa2c22/data/private
  • Set quota back to inherit (standard): zfs set quota=none zones/0735b504-f6ca-4ad5-b891-da5138fa2c22/data/private

delegated datasets

set mountpoint: zfs set mountpoint=/content zones/9deca4a4-0cf1-44fc-accf-9769a42cbe1b/data/pkgsrc

create snapshot: zfs snapshot -r zones/cf93903e-2f36-4580-8233-ca1d5eb3bbd2-reprovisioning-data@backup

send delegated dataset from old into new zone: zfs send zones/cf93903e-2f36-4580-8233-ca1d5eb3bbd2-reprovisioning-data@backup | zlogin 9deca4a4-0cf1-44fc-accf-9769a42cbe1b "zfs recv -vFd zones/9deca4a4-0cf1-44fc-accf-9769a42cbe1b/data"

special stuff

add delegated dataset to existing zone:

zonecfg -z cf93903e-2f36-4580-8233-ca1d5eb3bbd2
add dataset
set name=zones/cf93903e-2f36-4580-8233-ca1d5eb3bbd2/data
end

remove delegated dataset from existing zone:

zonecfg -z cf93903e-2f36-4580-8233-ca1d5eb3bbd2
remove dataset name=zones/cf93903e-2f36-4580-8233-ca1d5eb3bbd2/data
exit

set zoned=off in order to (be able to) rename the dataset:

zfs set zoned=off zones/mcube/cf93903e-2f36-4580-8233-ca1d5eb3bbd2/data
zfs rename zones/mcube/cf93903e-2f36-4580-8233-ca1d5eb3bbd2 zones/cf93903e-2f36-4580-8233-ca1d5eb3bbd2
zfs set zoned=on zones/cf93903e-2f36-4580-8233-ca1d5eb3bbd2/data

KVM Zones

  • Get the VNC Port for the VM: vmadm info 12a0b81a-8237-4876-a22b-b15fe3cea25e

Zones

Setting up pkgsrc repository

Please check the current available release on: http://pkgsrc.smartos.skylime.net/packages/SmartOS/ and alter the path from */2013Q4/* to the newest available release.

echo "http://pkgsrc.smartos.skylime.net/packages/SmartOS/2014Q2/x86_64/All/ > /opt/local/etc/pkgin/repositories.conf"
pkgin up
pkgin install *packagename*

Update and full upgrade of all packages: pkgin up && pkgin fug Show all installed packages with vulnerabilities: pkg_admin audit

Reprovision

echo '{ "image_uuid": "d192eea8-ed68-11e3-bbc1-df80db1cbe67" }' | vmadm reprovision 40bbc4e1-c6b3-454d-8a59-2cb3e3647850

unexplained collection (mostly network)

blogroll

social