Brett's Notes

Monday, June 13, 2005

Auto Negotiation Situation...

The other day I ran into a little issue with Samba acting a bit slow. When trying to move a file to one of my Samba shares, stuff was moving at about 5mb per minute. Yikes! During the trouble-shooting process, our network person asked me if the NIC on the Solaris server was set to auto-negotiate. My answer was something like, "uhh... I'll check... I think.... uhh..."

I quickly found that right clicking on "My Network Places" wasn't going to work. Solaris is fun sometimes. Anyway, the following are output from to commands I used to check the auto-negotiate status. One is ndd and the other is kstat. Either is a great way to check a butt-load of settings. NOTE: Both commands use 'ce' in them. My network card is named ce0 I would imagine that you'll need to change that based on your cards name...
Enjoy!

root@asmpri->ndd
module to query ? /dev/ce
name to get/set ? ?
? (read only)
instance (read and write)
adv_autoneg_cap (read and write)
adv_1000fdx_cap (read and write)
adv_1000hdx_cap (read and write)
adv_100T4_cap (read and write)
adv_100fdx_cap (read and write)
adv_100hdx_cap (read and write)
adv_10fdx_cap (read and write)
adv_10hdx_cap (read and write)
adv_asmpause_cap (read and write)
adv_pause_cap (read and write)
master_cfg_enable (read and write)
master_cfg_value (read and write)
use_int_xcvr (read and write)
enable_ipg0 (read and write)
ipg0 (read and write)
ipg1 (read and write)
ipg2 (read and write)
rx_intr_pkts (read and write)
rx_intr_time (read and write)
red_dv4to6k (read and write)
red_dv6to8k (read and write)
red_dv8to10k (read and write)
red_dv10to12k (read and write)
tx_dma_weight (read and write)
rx_dma_weight (read and write)
infinite_burst (read and write)
disable_64bit (read and write)
accept_jumbo (read and write)
laggr_multistream (read and write)
link_status (read only)
link_mode (read only)
link_speed (read only)
name to get/set ? ad_autoneg_cap
value ?
length ?
operation failed, Invalid argument
name to get/set ? adv_autoneg_cap
value ?
length ?1



root@asmpri->kstat -m ce
module: ce instance: 0
name: ce0 class: net
adv_cap_1000fdx 1
adv_cap_1000hdx 0
adv_cap_100T4 0
adv_cap_100fdx 0
adv_cap_100hdx 0
adv_cap_10fdx 0
adv_cap_10hdx 0
adv_cap_asmpause 0
adv_cap_autoneg 1
adv_cap_pause 0
alignment_err 0
brdcstrcv 1669253
brdcstxmt 2257
cap_1000fdx 1
cap_1000hdx 1
cap_100T4 0
cap_100fdx 1
cap_100hdx 1
cap_10fdx 1
cap_10hdx 1
cap_asmpause 0
cap_autoneg 1
cap_pause 0
code_violations 0
collisions 0
crc_err 0
crtime 155.479126808
excessive_collisions 0
first_collision 0
ierrors 0
ifspeed 1000000000
ipackets 500687989
ipackets64 500687989
ipackets_cpu00 500687989
late_collisions 0
lb_mode 0
length_err 0
link_T4 0
link_asmpause 0
link_duplex 2
link_pause 0
link_speed 1000
link_up 1
lp_cap_1000fdx 1
lp_cap_1000hdx 1
lp_cap_100T4 0
lp_cap_100fdx 0
lp_cap_100hdx 0
lp_cap_10fdx 0
lp_cap_10hdx 0
lp_cap_asmpause 1
lp_cap_autoneg 1
lp_cap_pause 0
mac_mtu 1522
mac_reset 0
multircv 0
multixmt 0
norcvbuf 0
noxmtbuf 0
obytes 451609519
obytes64 253854679983
oerrors 0
opackets 358404350
opackets64 358404350
pci_bad_ack_err 0
pci_bus_speed 33
pci_dmarz_err 0
pci_dmawz_err 0
pci_drto_err 0
pci_err 0
pci_parity_err 0
pci_rma_err 0
pci_rta_err 0
peak_attempts 0
promisc off
qos_mode 0
rbytes 1491222884
rbytes64 568426905956
rev_id 32
rx_allocb_fail 0
rx_hdr_drops 0
rx_hdr_pkts 96382599
rx_inits 0
rx_jumbo_pkts 0
rx_len_mm 0
rx_msgdup_fail 0
rx_mtu_drops 0
rx_mtu_pkts 404305390
rx_new_hdr_pgs 3011956
rx_new_mtu_pgs 101076347
rx_new_nxt_pgs 0
rx_new_pages 104088303
rx_no_buf 0
rx_no_comp_wb 0
rx_nocanput 0
rx_nxt_drops 0
rx_ov_flow 496
rx_pkts_dropped 0
rx_rel_bit 1682649
rx_rel_flow 0
rx_reused_pgs 99729253
rx_split_pkts 0
rx_tag_err 0
rx_taskq_waits 0
snaptime 779976.843649325
trunk_mode 0
tx_allocb_fail 0
tx_ddi_pkts 16009006
tx_dma_bind_fail 0
tx_dvma_pkts 150956650
tx_hdr_pkts 192653983
tx_inits 0
tx_jumbo_pkts 0
tx_max_pend 53
tx_msgdup_fail 0
tx_no_desc 0
tx_nocanput 0
tx_queue0 79403754
tx_queue1 85432666
tx_queue2 110301541
tx_queue3 83319991
tx_starts 358410239
tx_uflo 0
xcvr_addr 1
xcvr_id 2121811
xcvr_inits 6
xcvr_inuse 1

Thursday, April 21, 2005

IP Address Folly...

I ran into an interesting problem today. We had a 5.6 workstation and its network printer move from one subnet to another. My job was to change their IPs and get them to print. The IP change was done by updating the following files:

/etc/hosts
/etc/hostname.bge0
/etc/resolv.conf
/etc/netmasks
/etc/nodename
/etc/defaultrouter
(don't forget /etc/inet/ipnodes if you're working in Solaris 10!)

This was no prob. I changed the printer's IP, default gateway and netmask. I found an entry for the printer in the hosts file, so I updated that.

It wouldn't print.

I found that the print was still trying to go to the printer's old IP. Here was the answer:

/etc/lp/printers/queue_name/configuration

It appears that when the printer was set up, they used an IP instead of a hostname & hosts file entry. This is what the configuration file looks like:

Banner: on:AlwaysContent types: simpleDevice: /dev/nullInterface: /usr/lib/lp/model/netstandardPrinter type: unknownModules:Options: dest=10.150.10.63:text,protocol=bsd,timeout=90

I'm not sure why there was an entry for the printer in the hosts file if it was set up this way. *shrug*

Personally, I don't like to hard code IPs outside of the usual places...

Wednesday, April 20, 2005

'Printing in Solaris' or 'Diary of a Madman'...

This thing helped me get a printer set up on our network...


HP Jetdirect Print Servers - Configuring LPD Printing on Sun Solaris
Introduction

This document describes how to configure the HP Jetdirect print server for use with Sun Solaris systems that have the Line Printer Daemon (LPD) installed.
Line Printer Daemon (LPD) refers to the protocol and programs associated with line-printer spooling services that may be installed on various TCP/IP systems.
Click here for more complete information from Sun’s Web site .

There are several different methods that could be used to print form Sun Solaris. Each is discussed below.
Configuring print queues using lpadmin for Solaris 2.6

1. Type: lpadmin -p queue_name -v /dev/null
2. Type: lpadmin -p queue_name -i /usr/lib/lp/model/netstandard
3. Type: lpadmin -p queue_name -o dest=hostname_or_IP:text -o protocol=bsd -o timeout=time_in_seconds


NOTE: On the "dest=hostname:xxxx" variable, use "raw" for PostScript®, HPG/L2, or other formatted files. Use "text" for unformatted ASCII files; this adds a carriage return/line feed termination command and will prevent the print from stair-stepping typical with UNIX ASCII text. For a HP Jetdirect three port external print server, use "raw1" or "text1" for parallel port one, "raw2" or "text2" for parallel port two and "raw3" or "text3" for port three.
Click here additional information on stair-stepping.

4. Type: enable queue_name NOTE: This command won’t work in the Bourne shell. Switch to csh
5. Type: accept queue_name NOTE: This command won’t work in the Bourne shell. Switch to csh

If the operating system is Solaris 2.6 or 7, the printer configuration may be stored in several different locations, depending on how the system is set up for "Naming Services;" therefore manually editing files is not an appropriate option. The best method of changing the remote printer name to "text" is the one of the following commands: lpset -a bsdaddr=IP address of Jetdirect,text local lp destination name lpset -n systemfns -a bsdaddr=IPaddress of Jetdirect,text local lp destination name
For more information about these steps, refer to the man pages on the Solaris computer (at a system prompt, type “man lpadmin”.

Thursday, April 07, 2005

/etc/passwd And The Hole In My Head...

What do you edit to set the default login shell for a user? This one took me all day. That's right- no mental giant here. I'll not post the bunny trails I went down to get this simple answer; I'll just give you the goods.

/etc/passwd

This file contains entries that look like this:

networker:x:1011:1009::/export/home/networker:/usr/bin/sh tester:x:1012:10::/home/tester:/usr/bin/bash saylesb:x:1005:1000::/home/saylesb:/bin/sh asmadm:x:1002:0::/usr/home/asmadm:/bin/csh

By editing the last entry, you change the default login shell. Voila!

Here are the /etc/passwd fields explained:

Name Specifies the user's login name. The user name must be a unique string of 8 bytes or less. There are a number of restrictions on naming users. See the mkuser command for more information.
Password Contains an * (asterisk) indicating an invalid password or an ! (exclamation point) indicating that the password is in the /etc/security/passwd file. Under normal conditions, the field contains an !. If the field has an * and a password is required for user authentication, the user cannot log in.
UserID Specifies the user's unique numeric ID. This ID is used for discretionary access control. The value is a unique decimal integer.
PrincipleGroup Specifies the user's principal group ID. This must be the numeric ID of a group in the user database or a group defined by a network information service. The value is a unique decimal integer.
Gecos Specifies general information about the user that is not needed by the system, such as an office or phone number. The value is a character string. The Gecos field cannot contain a colon.
HomeDirectory Specifies the full path name of the user's home directory. If the user does not have a defined home directory, the home directory of the guest user is used. The value is a character string.
Shell Specifies the initial program or shell that is executed after a user invokes the login command or su command. If a user does not have a defined shell, /usr/bin/sh, the system shell, is used. The value is a character string that may contain arguments to pass to the initial program.

Tuesday, April 05, 2005

FSSNAP: Snap me baby!

Well, I decided to learn to use fssnap to take a 'snapshot' backup of a mounted filesystem.

This is the command I used to execute the backup ov /export/home:

fssnap -F ufs -o bs=/solstor /export/home

I haven't tried a restore, so I can't be sure that it worked. That will be my next post!

Following is the article I found that let me to this command syntax.

NOTE: This document is not intended to be a troubleshooting document. It is simply designed to explain FSSNAP on the most basic level. This is a good document for a Solaris[TM] user who is curious as to what the new fssnap utility is and how it works. Again, it is important to note that this is not a troubleshooting doc nor is it an all encompassing doc. It is a good simple explanation of fssnap at it's most basic level.

FSSNAP - GENERAL OVERVIEW

When discussing FSSNAP, the first thing to consider is what was this utility created for. One of the biggest issues system administrators have to face is their ability to back up their systems. Backup is necessary, but many utilities require that the machine be in a single user mode in order to properly backup. This requires downtime which is not a luxury most system administrators have in today's environment. There are utilities that can back up live filesystems but they are costly. One of the more popular utilities for backups is ufsdump and ufsrestore as it is easy to work, has been around forever (so it is well known), and it's free. The problem is that ufsdump was not created to run on a active filesystem. It is most successful when run in a single user mode or better yet, on an unmounted filesystem.

The fssnap utility was designed to take a "snapshot" of the filesystem, and store it in such away that the snapshot can then be backed up using the ufsdump utility. Thus the ability to backup a live filesystem using ufsdump and have it be successful is now a possibility without having to pay for a utility that will do the same thing.

Fssnap can also be used for other purposes – the above statement is just a one example.

FSSNAP - HOW DOES IT WORK?

Fssnap works with three items: The filesystem being "snapped", a backing-store file created by the user, and the snapshot in a form of a pseudo-device. In this example we will be using fssnap to take a snapshot of /opt filesystem.

Note: in this example /data directory has to exist. It also needs to have enough free space available to contain the /opt filesystem (a worse case scenario).

So, we snap the /opt filesystem as such:

#fssnap -F ufs -o bs=/data/snapshot /opt

/dev/fssnap/0

What will happen here is that activity within the filesystem itself will be brought to a brief halt (similar to if the fslock command was used, but not as intrusive). This happens so that a snapshot of the filesystem can be taken. Once taken, the process within the filesystem will resume. It is a short and usually unnoticeable pause.

Note: One cannot take a snapshot of a filesystem that has a lock on it - xntp in particular puts a lock on root, so in this case, one would have to stop xntp before creating the snapshot. Also, the backing store file can't exist prior to creating the snapshot.

You will notice that when the command is given, it gives you a response of:

/dev/fssnap/0

Fssnap also creates a /data/snapshot file which appears approximately the size of the file system /opt.

So what are each of these two things? Lets start with the /dev/fssnap/0. This is the actual "snapshot" of the /opt filesystem. One can actually mount this device if you wanted to and it would look exactly as /opt did when the snapshot was taken. The /dev/fssnap/0 is a pseudo device and it does not take up any actual space. It is simply a device through which you have access to the snapshot of /opt. But since it is a device, it can be mounted like any other filesystem. Also, like any other unmounted device, you can also run ufsdump on it (Aha!). For visualization purposes, one could view this as a frozen in time workable picture of /opt. For obvious reasons, it is read-only.

What exactly is the backing-store file? In this example, the backing-store file is /data/snapshot. Each filesystem snapped is going to need its own unique backing-store file. This file is actually a sparse file that represents the entire size of the partition on which the filesystem snapped resides. When this file is created, it appears the same size as the filesystem, but it is completely empty (has no space allocated to it). As the original filesystem is updated or modified, so too is the backing-store file. If the filesystem is never updated or modified (since the snapshot was taken), the backing-store file will remain empty.

So, if any data is to be modified on the original /opt filesystem (such as modifying or deleting a file), before the /opt filesystem is modified the current (old) data is first placed in the backing store file, then the /opt filesystem is updated. This way the snapshot will always contain an image of the filesystem from a certain point in time (static).

For example...

We have snapped /opt

it's backing file is /data/snapshot

After we snap the filesystem, JohnUser goes into /opt and updates /opt/anyfile. Before the changes JohnUser made are written to disk, a copy of the original file is saved to the backing-store file (in this case /data/snapshot). Therefore the /opt/anyfile is stored in it's original state(i.e. the way it looked when it was snapped). This copy only has to be done once during the snapshot, even if the file is modified several times (since we only care about the original image of the file and not any subsequent updates). This change is reported to the /dev/fssnap/0 which know knows that when it needs /opt/anyfile it needs to retrieve it from the backing store file and not from the current /opt. Therefore the overall snapped image remains intact. This entire operation is transparent to users (done within the kernel).

That is what fssnap does. When a filesystem is snapped, a device representing that filesystem is created. A sparse backing store file is created which will retain the original data of the filesystem should any of it be altered after the snapshot was taken. When one accesses the /dev/fssnap/0 it looks to both the original filesystem (/opt) and the backing store file (/data/snapshot) to recreate /opt as it existed when the snapshot was taken. All of this is also transparent to the users.

Note that the backing store file cannot be created on the filesystem that is being snapped - if OS is installed as a flat filesystem with no additional filesystems available, one will not be able to use fssnap! Also, more than one snapshot of a filesystem at the same time can't be done. A "device busy" error will result.

FSSNAP - Clearing out the snap shots

Once the fssnap is taken there are only two ways to clear it.

First, a reboot. This will clear the backing-store file as well as the /dev/fsssnap created.

Second, use the fssnap -d option to delete it. Deleting the snapshot will not remove the backing-store file unless the 'unlink' option was given when the snapshot was created, e.g., 'fssnap -F ufs -o bs=/data/snapshot,unlink /opt'.

If the backing store file is not removed, this will not fully remove the snapshot from your system.

For more information, refer to the fssnap_ufs(1M) man page - it contains useful examples of using fssnap with ufsdump.



Monday, April 04, 2005

Why This Blog?

I keep general operating system notes all over the place. I thought I'd try putting some of my scribbles here for easy retrieval. Maybe it'll work, maybe it'll be a big pain in my butt. We'll see!

P.S. (For the RSS heads, here's the feed address- http://brettnotes.blogspot.com/atom.xml )