10/24/2011

Differences in Solaris compared to Linux

Differences in Solaris 10/11 compared to Linux


Summary

Oracle has a good listing of system administration tools for Solaris 10 and RHEL 5 side-by-side:
https://wikis.oracle.com/pages/viewpage.action?pageId=22609926

//cdrom/volume used as an automatic mount point instead of /media or /run/user/
/etc/shells - Man page exists in Solaris, but file is missing.

To install VirtualBox Guest Additions use: pkgadd -d /cdrom/vbox-guest-additions-cdrom/VboxSolarisAdditions.pkg. This installs the package SUNWvboxguest.

ping -I 1 sol10 64 5 - ping at one second intervals host sol10 with 64 byte packets 5 times

catman - Command to build the man page indexes (windex) instead of makewhatis.

Software Management
Another blogger made a great summary at http://sol10pkgmgmt.blogspot.com/


pkgadd -d virtualboxguestadditions.pkg to install a software package.
pkgadd -d . SUNWbash to install from a filesystem directory.
pkginfo -  view installed package information
pkginfo -d /cdrom/cdrom0/Solaris_10/Product/ -  view package information from a directory (cdrom)


sys-unconfig Unconfigures a system, removing it's name and IP address information. Upon the next boot, the system will prompt for the new configuration.  Starting with Solaris 11, the command has been replaced with sysconfig.

touch /reconfigure - have system re-detect devices such as additional hard drives
Then use the format command to make the fdisk partition, the partition slices, and the disk label.  Use the following commands from the format prompt to carry out these actions:
  • fdisk
  • partition
  • label

useradd -m username If you don't use the -m option with Solaris, then it won't create the user's home directory.
find The find command is aware of the file time stamps in days: -atime, -mtime and -ctime, but not in minutes: -amin, -mmin, and -cmin.

Networking

The default gateway or router entry is placed in /etc/defaultrouter in Solaris 10.
The hosts table is maintained in /etc/inet/hosts file in Solaris, instead of /etc/hosts in Linux.
Combined with the /etc/inet/netmasks file in Solaris, this determines the interface configuration.
The /etc/resolv.conf file is used for DNS resolution, but it does not exist by default.
The /etc/nsswitch.conf file is used to determine order of hosts name resolution.
By default, the hosts entry is:
hosts: files
To use the nameserver entries in the /etc/resolv.conf, update /etc/nsswitch.conf  to:
hosts: dns files
Use ifconfig -a to view all interfaces.
ifconfig e1000g0 down to bring down that interface
ifconfig e1000g0 plumb up to bring up an interface
rup - will ping all hosts in the /etc/inet/hosts file

Network Routing

The following illustrates viewing, deleting, and adding the default gateway. In this scenario, the default was 10.0.2.1, and was changed to 10.0.0.1.

route -p show

route get default

route -p delete default 10.0.2.1

route -f -p

echo 10.0.0.1 > /etc/defaultrouter
route -p add default 10.0.0.1
route -p show
route get default
route get 0.0.0.0


This Pocket Survival Guide to Solaris is very helpful for typical system administration tasks: http://www2.fiu.edu/~tho01/psg/sol.html


Listing services
svcs

Starting a service 


# svcadm enable svc:/network/login:rlogin

Usage: svcadm [-v] [cmd [args ... ]]

        svcadm enable [-rst] ...      - enable and online service(s)
        svcadm disable [-st] ...      - disable and offline service(s)
        svcadm restart ...            - restart specified service(s)
        svcadm refresh ...            - re-read service configuration
        svcadm mark [-It] ... - set maintenance state
        svcadm clear ...              - clear maintenance state
        svcadm milestone [-d]       - advance to a service milestone

        Services can be specified using an FMRI, abbreviation, or fnmatch(5)
        pattern, as shown in these examples for svc:/network/smtp:sendmail

        svcadm svc:/network/smtp:sendmail
        svcadm network/smtp:sendmail
        svcadm network/*mail
        svcadm network/smtp
        svcadm smtp:sendmail
        svcadm smtp
        svcadm sendmail


Shutting Down Solaris 10 

init 5 - to power off the system in Solaris. This would put most Linux distros into a graphical mode.
init 0 - to put the system in a state where it is safe to power off (PROM prompt on SPARC)



Sections of the Manual are Different



1
Basic user commands
1M
System Admin commands
2
OS Calls
3
Library functions
4
Configuration files
5
Miscellaneous topics
6
Games and demos
7
Hardware and device driver files
9
DDI (Device Driver Interface) and DKI (Driver/Kernel Interface)
To view a manual section, you use the -s option in Solaris
man -s 4 passwd
Instead of the Linux method
man 5 passwd

Disk Management

du -k - show in kilobytes instead of 512byte sectors.  There is also a -h option.
df -k - show in kilobytes instead of 512byte sectors.  There is also a -h option.
quot -a - show all users usage of the filesystem

fdisk /dev/rdsk/c0t3d0p0 - create an initial partition before being able to use as a volume
metadb -a -f c0t3d0s2 - force creating a replica database
metainit d21 1 1 c0t3d0s2 - create a RAID 0 device
fdisk /dev/rdsk/c0t4d0p0 - create an initial partition before being able to use as a volume
metadb -a -f c0t4d0s2 - force creating a replica database
metainit d22 1 1 c0t4d0s2 - create a RAID 0 device
metainit d25 -m d21 - create a RAID1 device
metattach d25 d22 - attach the second mirror
newfs /dev/md/rdsk/d25 - create the file system
mount /dev/md/dsk/d25 /testing - mount the new file system

newfs /dev/md/dsk/d25

Single User Mode

In Linux, you can get to single user mode on an init-based system by appending an "S" to the kernel line in the bootloader.  If the Linux system uses systemd instead of init, then you can append the kernel line with "systemd.unit=rescue.target".

In Solaris, you can get to single user mode by appending "-s" to the kernel line in the bootloader.

     The following command restricts the running services to sin-
     gle user mode:

       # svcadm milestone milestone/single-user

     The following command restores the running services:

       # svcadm milestone all

Stop-A
On a standard keyboard use CTRL+PAUSE+A

SUSE Enterprise Linux Server 11

Since the early 90's most of my Linux experience has been with Redhat or Redhat-derived distributions like RHEL, Fedora, and Centos. As the company I work for is no longer partnered with Redhat to provide training, I am not having to teach as much Redhat system administration. Instead, I'm branching out into other distributions, like Ubuntu, and the subject of my post today: SUSE.
Over the weekend, I signed up for the free trial and downloaded the SUSE Enterprise Linux Server (SLES) 11. This morning, I had the joy of installing SLES. I was very pleased with it's installer. I had issues at first with getting the video resolution to work on the old computer I was attempting to install it on. No problem, the installer has a function key to change video resolution. The installer wanted to partition the internal hard drive, but I wanted to install on to an USB key. Again, no problem, there was a very intuitive and powerful graphical partitioning tool. I'm not sure why it took a couple of hours to complete, I would have thought that installing to a USB Flash drive would have been faster, but that may have been caused by the slow DVD drive.
Now, that the system is up and running, I want to start blogging some of the key differences between SUSE and RH:

RH uses the Gnome Desktop Environment by default and SUSE uses KDE, but both desktops are available in both distributions. The SUSE desktop only uses a bottom panel with a single menu at the left side of the panel that allows the user to access applications, documents, places, devices and their settings easily. It has obviously been customized with a professional appearance. In contrast, the RH systems seem to ship with the standard Gnome desktop.

Both systems distribute software as rpm files, and low level software information can be obtained with the rpm command. SUSE uses zypper as it's front end, instead of RH which uses yum. SUSE is configured by default to allow you to install additonal software from the DVD, unlike RH where that would need to be manually configured. Most of the yum configuration is done in /etc/yum.conf and /etc/yum.repos.d/ directory, which zypper is configured with /etc/zypp/zypper.conf and /etc/zypp/repos.d/.

For installing debug-info rpm packages, RH derived use debuginfo-install and SUSE derived use pk-debuginfo-install. Where RH uses yum provides \*/command to locate the package to install for a specific command, SUSE uses cnf command, or you can zypper search command.

While RH has gone from SysVInit, to upstart, and even is experimenting with systemd in Fedora, SUSE still uses SysVInit. So, for RH you must be aware of either upstart scripts in /etc/init, or whatever systemd uses, and learn a new way to configure services to start. With SUSE, it is still the traditional /etc/inittab, /etc/rc#.d, and the scripts in /etc/init.d/. Both support using chkconfig for easily managing which services will start at which runlevels. They both also have support for the service command to start, stop, reload, and check the status of services. Interestingly, in SUSE, every script in /etc/init.d is linked to a file in /usr/sbin/. For example, /etc/init.d/sshd can be run with /usr/sbin/rcsshd.

RH has moved up to ext4 file system for it's default, and SUSE doesn't have default support for it yet in 11.2, but it is the default in OpenSUSE. For SUSE, the package ext4dev-kmp-default is available as a Technical Preview. I tried to install the ext4dev-kmp-default, but I was still unable to mount an ext4 file system with SUSE.

RH uses SELinux to protect the system against mis-behaved processes, while SUSE still uses AppArmor. I thought that I had heard that SUSE was going to be using SELinux, but there does not seem to be any trace of it. From what I understand, SELinux provides better protection, but is more difficult to configure. Whereas, AppArmor can be fooled with linked files, it is designed to be much easier to use.

Now, with RH you get a notification if you have SELinux Troubleshooter installed, however if have not found an equivalent for AppArmor.

The locate command is not available by default in SUSE, so install the findutils-locate package to be able to use the locate command.

10/10/2011

Motorola Droid Bionic 4G Issue and SD Card path

The very day after my previous post on the Droid Bionic, where I had said I had heard of people having 4G issues, then I began to experience those issues myself. If I turned the phone off, and started it back up again, it would come back to using 4G, but only for a minute or two. The same thing would occur if I toggled airplane mode. After tolerating the situation for several days, I decided I wanted to take the phone in to see if I could get it replaced.
As I planned to reset the phone completely, to also assure myself that it wasn't some kind of software glitch, I wanted to back up all my photos, videos, and music. So, I plugged my phone into my computer, and switched the USB connection to USB Mass Storage. I'm using CentOS 6, so the devices mounted under /media, but both as /media/MOT. I think I should backup, relabel and restore my external SD card, so it can mount under a different path.
Unless, you know what directories and files you have stored where, then it would be difficult to tell which is the internal and which is the external memory. Unfortunately, the way Motorola has the paths internally defined, the internal SD card path is /mnt/sdcard/ (or /sdcard) and the external SD card path is /mnt/sdcard-ext (or /sdcard-ext). Knowing the paths can me the confidence that I had copied everything from the internal /sdcard to the external /sdcard-ext.
Of course, I have the Android SDK installed, so I can start up a shell on my phone with:
adb shell
Next, I could look for the directories or folders to backup from the internal card with:
ls /sdcard
Then, for each folder to backup, I executed something like:
cp -r /sdcard/dcim/ /sdcard-ext/
With the backups all done, and resetting the phone to factory complete not fixing the problem, I headed off to the Verizon store to spend two hours watching the guy try to get my phone to work for more than a minute. I was amazed in one minute where my phone was downloading at a rate of 27,000 kbps! At my house, the best I can normally do is around 18,000 kbps. He reset the phone to factory again, he pulled and reset my SIM card, he exchanged my SIM card, he made sure there were no problems with my account, and with the 4G network. It was obvious after all the testing and troubleshooting, when he could set his phone down and have full bars of 4G, and mine would drop 4G and go to 3G that there was a problem with my device. Yet, he would not admit to it, and I started to get irate.
When they were refusing to agree that there was a problem with my phone, that first they needed to escalate the issue to a "real" technician before they could be sure that there was actually a problem with my device, I threatened to simply return my phone. This got a manager's attention, and he offered me free data service while I was waiting for a "real" technician to contact me. As that would not add up to two dollars, I counter-offered that I wanted to get a free cover, and showed him the $14.99 silicone cover that I had been considering. He agreed, and credited me with a free cover, and I agreed to wait for the "real" technician to contact me within 24-48 hours.
My visit to the store was on a Saturday, so I felt it fair to wait until Tuesday before they contacted me. Wednesday morning, I got a call from an unidentified caller and ignored it, waiting to see what the voicemail was about, but none was left. I called 611 with the feeling that perhaps it was Verizon, and sure enough it had been. I don't know if they were planning on sending me a new phone or not, as the woman started to say, "the resolution is that because you live in an area that is known to have problems...", I interrupted her.
I told her, "Stop right there, that is not a resolution. I paid for a phone to have 4G, and I want to have it. My phone did have 4G for the first couple of weeks, and then it stopped working correctly. I spent two hours in the store on Saturday, and everyone else could keep 4G, but me. I want it replaced, or I will return it". She very nicely said, "I will help you with that." Two days later, and I got my new phone. I don't want to jinx myself, but for at least the last three days it has been working well with 4G.

About Me - WrightRocket

My photo

I've worked with computers for over 30 years, programming, administering, using and building them from scratch.

I'm an instructor for technical computer courses, an editor and developer of training manuals, and an Android developer.